Your IP : 13.59.35.218
import{a as ya,b as Ca}from"./chunk-32EYRVZR.js";import{a as Dn,b as Qo,c as ia}from"./chunk-QRGA6IGI.js";import{a as Zo,b as ta,c as wa}from"./chunk-N3NSMNNC.js";import{a as Mn}from"./chunk-QTUBEEH7.js";import{a as na,b as sa,c as ra,d as Cc,e as bs,f as oa,g as aa,h as vs,i as la,j as ca,k as da,l as pa,m as fa,n as ga}from"./chunk-EWSBMFEH.js";import{a as Jo}from"./chunk-MOYBPCLQ.js";import"./chunk-LEQN3D2Q.js";import{a as ba,b as va}from"./chunk-4YFWGFYZ.js";import{b as Bo,c as $o}from"./chunk-KOPGM7TY.js";import{a as ha,c as ua,d as _a}from"./chunk-SKX3CALC.js";import{a as ea,b as ma}from"./chunk-XCB6Q7V4.js";import{b as Vo,c as Ho,d as Go,l as Rn,m as Xo,n as qo,o as Yo}from"./chunk-YEF45YHO.js";import{b as Fn,c as jo,f as Ko}from"./chunk-HDHDVZQK.js";import{c as Uo}from"./chunk-PK74BOF4.js";import"./chunk-UIMIPCPG.js";import{a as yo,b as Co,d as wo,g as So,i as Mo,j as In}from"./chunk-H3YY3OLT.js";import"./chunk-BKOP7W6P.js";import{a as vi}from"./chunk-EI5KBZMB.js";import{a as Bt}from"./chunk-WDCLQCI6.js";import{a as zo}from"./chunk-VX77VCCO.js";import"./chunk-WUJDRKKX.js";import{b as zi,c as Wo,d as wi}from"./chunk-25EXV7IU.js";import{a as ni,d as Vi,e as ui}from"./chunk-CPXWTLES.js";import{a as Bi,d as xo,h as kn,i as Ao,k as Po}from"./chunk-KU75D4PT.js";import{c as Eo,e as ko,f as Do,g as No}from"./chunk-BATIAXZ4.js";import{c as Yt,d as hi,f as po,i as En,j as fo,k as go,l as Tn,m as mo,n as _o,t as Ni,u as bo}from"./chunk-KX5BXGZT.js";import{a as Wt,c as ii,d as To,e as Ln,g as Lo,r as Io,v as Oo,y as Ro,z as Ci}from"./chunk-M6DH5DPB.js";import{$a as Be,$b as nt,Ab as xn,Ac as yi,Ba as Yr,Bb as xt,Bc as Fo,C as ci,Ca as Dt,Cb as Nt,Cc as $i,Da as It,Ea as Ot,Ga as Qr,H as Ji,Ha as Zr,I as Ur,Ia as Ct,Ja as Jr,Ka as _t,L as Ce,La as zt,M as tt,Ma as jt,Pa as Ii,Qa as Oi,Ra as Fi,Sa as eo,Sb as _s,T as _n,Ta as yn,U as Hr,Va as wt,Wa as Kt,Wb as di,Xa as ms,Yb as so,Z as je,Zb as ro,_a as Ne,_b as oo,aa as ki,ab as to,ba as ge,bb as Ht,c as Xt,ca as ti,cc as An,d as vt,da as oi,f as pt,fa as Gr,fc as ao,ga as gs,gb as bi,gc as Pn,ha as Ti,hc as lo,ja as Xr,jc as co,k as ut,ka as qr,kb as Ri,kc as ho,l as yt,la as Kr,lc as uo,m as Vr,ma as Ae,mb as io,n as li,na as Te,oa as Ke,oc as Di,p as zr,pa as Mt,q as Re,qa as kt,qc as ct,r as De,ra as Li,sa as it,sc as vo,tb as Cn,ub as Jt,va as Ge,vb as St,w as jr,wb as wn,x as Rt,xa as pe,xb as Sn,y as lt,ya as bn,yb as no,yc as On,z as Wr,za as vn}from"./chunk-SXUPRFOU.js";import{A as Zi,G as Je,H as Ft,N as Tt,S as Vt,Y as ri,_ as Qt,a as ft,b as At,ba as Rr,c as us,ca as Zt,e as _i,ea as Dr,f as ps,fa as Nr,g as qe,h as s,i as ee,j as J,ja as Br,k as G,l as Pi,m as Ue,o as Or,p as mn,s as Mi,sa as $r,t as st,ta as Ut,va as Pt,xa as mt,y as Fr,z as fs,za as Ei}from"./chunk-ERDNNTNA.js";var Hn=_i(()=>{});var el=_i(()=>{});var tl=_i(()=>{});var Ps=_i(()=>{});var Es=_i(()=>{});var il=_i(()=>{});var Ol=_i((exports,module)=>{(function(n,_){typeof exports=="object"&&typeof module=="object"?module.exports=n.pdfjsLib=_():typeof define=="function"&&define.amd?define("pdfjs-dist/build/pdf",[],()=>n.pdfjsLib=_()):typeof exports=="object"?exports["pdfjs-dist/build/pdf"]=n.pdfjsLib=_():n["pdfjs-dist/build/pdf"]=n.pdfjsLib=_()})(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(h,n)=>{var at;Object.defineProperty(n,"__esModule",{value:!0}),n.VerbosityLevel=n.Util=n.UnknownErrorException=n.UnexpectedResponseException=n.TextRenderingMode=n.RenderingIntentFlag=n.PromiseCapability=n.PermissionFlag=n.PasswordResponses=n.PasswordException=n.PageActionEventType=n.OPS=n.MissingPDFException=n.MAX_IMAGE_SIZE_TO_CACHE=n.LINE_FACTOR=n.LINE_DESCENT_FACTOR=n.InvalidPDFException=n.ImageKind=n.IDENTITY_MATRIX=n.FormatError=n.FeatureTest=n.FONT_IDENTITY_MATRIX=n.DocumentActionEventType=n.CMapCompressionType=n.BaseException=n.BASELINE_FACTOR=n.AnnotationType=n.AnnotationReplyType=n.AnnotationPrefix=n.AnnotationMode=n.AnnotationFlag=n.AnnotationFieldFlag=n.AnnotationEditorType=n.AnnotationEditorPrefix=n.AnnotationEditorParamsType=n.AnnotationBorderStyleType=n.AnnotationActionEventType=n.AbortException=void 0,n.assert=a,n.bytesToString=xe,n.createValidAbsoluteUrl=E,n.getModificationDate=oe,n.getUuid=We,n.getVerbosityLevel=U,n.info=q,n.isArrayBuffer=le,n.isArrayEqual=se,n.isNodeJS=void 0,n.normalizeUnicode=ze,n.objectFromMap=Ee,n.objectSize=Xe,n.setVerbosityLevel=V,n.shadow=B,n.string32=ke,n.stringToBytes=Se,n.stringToPDFString=z,n.stringToUTF8String=Q,n.unreachable=x,n.utf8StringToString=K,n.warn=$;let _=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");n.isNodeJS=_;let e=[1,0,0,1,0,0];n.IDENTITY_MATRIX=e;let t=[.001,0,0,.001,0,0];n.FONT_IDENTITY_MATRIX=t;let i=1e7;n.MAX_IMAGE_SIZE_TO_CACHE=i;let r=1.35;n.LINE_FACTOR=r;let m=.35;n.LINE_DESCENT_FACTOR=m;let o=m/r;n.BASELINE_FACTOR=o;let u={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};n.RenderingIntentFlag=u;let d={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};n.AnnotationMode=d;let v="pdfjs_internal_editor_";n.AnnotationEditorPrefix=v;let T={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};n.AnnotationEditorType=T;let A={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};n.AnnotationEditorParamsType=A;let M={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};n.PermissionFlag=M;let F={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};n.TextRenderingMode=F;let S={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};n.ImageKind=S;let b={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};n.AnnotationType=b;let N={GROUP:"Group",REPLY:"R"};n.AnnotationReplyType=N;let L={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};n.AnnotationFlag=L;let g={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};n.AnnotationFieldFlag=g;let f={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};n.AnnotationBorderStyleType=f;let p={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"};n.AnnotationActionEventType=p;let C={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};n.DocumentActionEventType=C;let P={O:"PageOpen",C:"PageClose"};n.PageActionEventType=P;let k={ERRORS:0,WARNINGS:1,INFOS:5};n.VerbosityLevel=k;let R={NONE:0,BINARY:1};n.CMapCompressionType=R;let W={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};n.OPS=W;let w={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};n.PasswordResponses=w;let D=k.WARNINGS;function V(be){Number.isInteger(be)&&(D=be)}function U(){return D}function q(be){D>=k.INFOS&&console.log(`Info: ${be}`)}function $(be){D>=k.WARNINGS&&console.log(`Warning: ${be}`)}function x(be){throw new Error(be)}function a(be,he){be||x(he)}function c(be){switch(be?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function E(be,he=null,ce=null){if(!be)return null;try{if(ce&&typeof be=="string"&&(ce.addDefaultProtocol&&be.startsWith("www.")&&be.match(/\./g)?.length>=2&&(be=`http://${be}`),ce.tryConvertEncoding))try{be=Q(be)}catch{}let Me=he?new URL(be,he):new URL(be);if(c(Me))return Me}catch{}return null}function B(be,he,ce,Me=!1){return Object.defineProperty(be,he,{value:ce,enumerable:!Me,configurable:!0,writable:!1}),ce}let O=function(){function he(ce,Me){this.constructor===he&&x("Cannot initialize BaseException."),this.message=ce,this.name=Me}return he.prototype=new Error,he.constructor=he,he}();n.BaseException=O;class Y extends O{constructor(he,ce){super(he,"PasswordException"),this.code=ce}}n.PasswordException=Y;class Z extends O{constructor(he,ce){super(he,"UnknownErrorException"),this.details=ce}}n.UnknownErrorException=Z;class X extends O{constructor(he){super(he,"InvalidPDFException")}}n.InvalidPDFException=X;class ie extends O{constructor(he){super(he,"MissingPDFException")}}n.MissingPDFException=ie;class ne extends O{constructor(he,ce){super(he,"UnexpectedResponseException"),this.status=ce}}n.UnexpectedResponseException=ne;class de extends O{constructor(he){super(he,"FormatError")}}n.FormatError=de;class me extends O{constructor(he){super(he,"AbortException")}}n.AbortException=me;function xe(be){(typeof be!="object"||be?.length===void 0)&&x("Invalid argument for bytesToString");let he=be.length,ce=8192;if(he<ce)return String.fromCharCode.apply(null,be);let Me=[];for(let et=0;et<he;et+=ce){let te=Math.min(et+ce,he),Pe=be.subarray(et,te);Me.push(String.fromCharCode.apply(null,Pe))}return Me.join("")}function Se(be){typeof be!="string"&&x("Invalid argument for stringToBytes");let he=be.length,ce=new Uint8Array(he);for(let Me=0;Me<he;++Me)ce[Me]=be.charCodeAt(Me)&255;return ce}function ke(be){return String.fromCharCode(be>>24&255,be>>16&255,be>>8&255,be&255)}function Xe(be){return Object.keys(be).length}function Ee(be){let he=Object.create(null);for(let[ce,Me]of be)he[ce]=Me;return he}function _e(){let be=new Uint8Array(4);return be[0]=1,new Uint32Array(be.buffer,0,1)[0]===1}function ue(){try{return new Function(""),!0}catch{return!1}}class re{static get isLittleEndian(){return B(this,"isLittleEndian",_e())}static get isEvalSupported(){return B(this,"isEvalSupported",ue())}static get isOffscreenCanvasSupported(){return B(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?B(this,"platform",{isWin:!1,isMac:!1}):B(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return B(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}n.FeatureTest=re;let y=[...Array(256).keys()].map(be=>be.toString(16).padStart(2,"0"));class l{static makeHexColor(he,ce,Me){return`#${y[he]}${y[ce]}${y[Me]}`}static scaleMinMax(he,ce){let Me;he[0]?(he[0]<0&&(Me=ce[0],ce[0]=ce[1],ce[1]=Me),ce[0]*=he[0],ce[1]*=he[0],he[3]<0&&(Me=ce[2],ce[2]=ce[3],ce[3]=Me),ce[2]*=he[3],ce[3]*=he[3]):(Me=ce[0],ce[0]=ce[2],ce[2]=Me,Me=ce[1],ce[1]=ce[3],ce[3]=Me,he[1]<0&&(Me=ce[2],ce[2]=ce[3],ce[3]=Me),ce[2]*=he[1],ce[3]*=he[1],he[2]<0&&(Me=ce[0],ce[0]=ce[1],ce[1]=Me),ce[0]*=he[2],ce[1]*=he[2]),ce[0]+=he[4],ce[1]+=he[4],ce[2]+=he[5],ce[3]+=he[5]}static transform(he,ce){return[he[0]*ce[0]+he[2]*ce[1],he[1]*ce[0]+he[3]*ce[1],he[0]*ce[2]+he[2]*ce[3],he[1]*ce[2]+he[3]*ce[3],he[0]*ce[4]+he[2]*ce[5]+he[4],he[1]*ce[4]+he[3]*ce[5]+he[5]]}static applyTransform(he,ce){let Me=he[0]*ce[0]+he[1]*ce[2]+ce[4],et=he[0]*ce[1]+he[1]*ce[3]+ce[5];return[Me,et]}static applyInverseTransform(he,ce){let Me=ce[0]*ce[3]-ce[1]*ce[2],et=(he[0]*ce[3]-he[1]*ce[2]+ce[2]*ce[5]-ce[4]*ce[3])/Me,te=(-he[0]*ce[1]+he[1]*ce[0]+ce[4]*ce[1]-ce[5]*ce[0])/Me;return[et,te]}static getAxialAlignedBoundingBox(he,ce){let Me=this.applyTransform(he,ce),et=this.applyTransform(he.slice(2,4),ce),te=this.applyTransform([he[0],he[3]],ce),Pe=this.applyTransform([he[2],he[1]],ce);return[Math.min(Me[0],et[0],te[0],Pe[0]),Math.min(Me[1],et[1],te[1],Pe[1]),Math.max(Me[0],et[0],te[0],Pe[0]),Math.max(Me[1],et[1],te[1],Pe[1])]}static inverseTransform(he){let ce=he[0]*he[3]-he[1]*he[2];return[he[3]/ce,-he[1]/ce,-he[2]/ce,he[0]/ce,(he[2]*he[5]-he[4]*he[3])/ce,(he[4]*he[1]-he[5]*he[0])/ce]}static singularValueDecompose2dScale(he){let ce=[he[0],he[2],he[1],he[3]],Me=he[0]*ce[0]+he[1]*ce[2],et=he[0]*ce[1]+he[1]*ce[3],te=he[2]*ce[0]+he[3]*ce[2],Pe=he[2]*ce[1]+he[3]*ce[3],Ye=(Me+Pe)/2,Oe=Math.sqrt((Me+Pe)**2-4*(Me*Pe-te*et))/2,j=Ye+Oe||1,H=Ye-Oe||1;return[Math.sqrt(j),Math.sqrt(H)]}static normalizeRect(he){let ce=he.slice(0);return he[0]>he[2]&&(ce[0]=he[2],ce[2]=he[0]),he[1]>he[3]&&(ce[1]=he[3],ce[3]=he[1]),ce}static intersect(he,ce){let Me=Math.max(Math.min(he[0],he[2]),Math.min(ce[0],ce[2])),et=Math.min(Math.max(he[0],he[2]),Math.max(ce[0],ce[2]));if(Me>et)return null;let te=Math.max(Math.min(he[1],he[3]),Math.min(ce[1],ce[3])),Pe=Math.min(Math.max(he[1],he[3]),Math.max(ce[1],ce[3]));return te>Pe?null:[Me,te,et,Pe]}static bezierBoundingBox(he,ce,Me,et,te,Pe,Ye,Oe){let j=[],H=[[],[]],ae,fe,ye,ve,Le,Fe,ot,He;for(let dt=0;dt<2;++dt){if(dt===0?(fe=6*he-12*Me+6*te,ae=-3*he+9*Me-9*te+3*Ye,ye=3*Me-3*he):(fe=6*ce-12*et+6*Pe,ae=-3*ce+9*et-9*Pe+3*Oe,ye=3*et-3*ce),Math.abs(ae)<1e-12){if(Math.abs(fe)<1e-12)continue;ve=-ye/fe,0<ve&&ve<1&&j.push(ve);continue}ot=fe*fe-4*ye*ae,He=Math.sqrt(ot),!(ot<0)&&(Le=(-fe+He)/(2*ae),0<Le&&Le<1&&j.push(Le),Fe=(-fe-He)/(2*ae),0<Fe&&Fe<1&&j.push(Fe))}let $e=j.length,Ve,Ze=$e;for(;$e--;)ve=j[$e],Ve=1-ve,H[0][$e]=Ve*Ve*Ve*he+3*Ve*Ve*ve*Me+3*Ve*ve*ve*te+ve*ve*ve*Ye,H[1][$e]=Ve*Ve*Ve*ce+3*Ve*Ve*ve*et+3*Ve*ve*ve*Pe+ve*ve*ve*Oe;return H[0][Ze]=he,H[1][Ze]=ce,H[0][Ze+1]=Ye,H[1][Ze+1]=Oe,H[0].length=H[1].length=Ze+2,[Math.min(...H[0]),Math.min(...H[1]),Math.max(...H[0]),Math.max(...H[1])]}}n.Util=l;let I=[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 z(be){if(be[0]>="\xEF"){let ce;if(be[0]==="\xFE"&&be[1]==="\xFF"?ce="utf-16be":be[0]==="\xFF"&&be[1]==="\xFE"?ce="utf-16le":be[0]==="\xEF"&&be[1]==="\xBB"&&be[2]==="\xBF"&&(ce="utf-8"),ce)try{let Me=new TextDecoder(ce,{fatal:!0}),et=Se(be);return Me.decode(et)}catch(Me){$(`stringToPDFString: "${Me}".`)}}let he=[];for(let ce=0,Me=be.length;ce<Me;ce++){let et=I[be.charCodeAt(ce)];he.push(et?String.fromCharCode(et):be.charAt(ce))}return he.join("")}function Q(be){return decodeURIComponent(escape(be))}function K(be){return unescape(encodeURIComponent(be))}function le(be){return typeof be=="object"&&be?.byteLength!==void 0}function se(be,he){if(be.length!==he.length)return!1;for(let ce=0,Me=be.length;ce<Me;ce++)if(be[ce]!==he[ce])return!1;return!0}function oe(be=new Date){return[be.getUTCFullYear().toString(),(be.getUTCMonth()+1).toString().padStart(2,"0"),be.getUTCDate().toString().padStart(2,"0"),be.getUTCHours().toString().padStart(2,"0"),be.getUTCMinutes().toString().padStart(2,"0"),be.getUTCSeconds().toString().padStart(2,"0")].join("")}class we{constructor(){ee(this,at,!1);this.promise=new Promise((he,ce)=>{this.resolve=Me=>{J(this,at,!0),he(Me)},this.reject=Me=>{J(this,at,!0),ce(Me)}})}get settled(){return s(this,at)}}at=new WeakMap,n.PromiseCapability=we;let Ie=null,Qe=null;function ze(be){return Ie||(Ie=/([\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,Qe=new Map([["\uFB05","\u017Ft"]])),be.replaceAll(Ie,(he,ce,Me)=>ce?ce.normalize("NFKC"):Qe.get(Me))}function We(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();let be=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(be);else for(let he=0;he<32;he++)be[he]=Math.floor(Math.random()*255);return xe(be)}let rt="pdfjs_internal_id_";n.AnnotationPrefix=rt},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var h,_,e,t,Ui,Gn,m,o,u,d,v,T,A,M,Xn,S,b,Ts,L,g;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(p){if(typeof p=="string"||p instanceof URL?p={url:p}:(0,_util.isArrayBuffer)(p)&&(p={data:p}),typeof p!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!p.url&&!p.data&&!p.range)throw new Error("Invalid parameter object: need either .data, .range or .url");let C=new PDFDocumentLoadingTask,{docId:P}=C,k=p.url?getUrlProp(p.url):null,R=p.data?getDataProp(p.data):null,W=p.httpHeaders||null,w=p.withCredentials===!0,D=p.password??null,V=p.range instanceof PDFDataRangeTransport?p.range:null,U=Number.isInteger(p.rangeChunkSize)&&p.rangeChunkSize>0?p.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE,q=p.worker instanceof PDFWorker?p.worker:null,$=p.verbosity,x=typeof p.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(p.docBaseUrl)?p.docBaseUrl:null,a=typeof p.cMapUrl=="string"?p.cMapUrl:null,c=p.cMapPacked!==!1,E=p.CMapReaderFactory||DefaultCMapReaderFactory,B=typeof p.standardFontDataUrl=="string"?p.standardFontDataUrl:null,O=p.StandardFontDataFactory||DefaultStandardFontDataFactory,Y=p.stopAtErrors!==!0,Z=Number.isInteger(p.maxImageSize)&&p.maxImageSize>-1?p.maxImageSize:-1,X=p.isEvalSupported!==!1,ie=typeof p.isOffscreenCanvasSupported=="boolean"?p.isOffscreenCanvasSupported:!_util.isNodeJS,ne=Number.isInteger(p.canvasMaxAreaInBytes)?p.canvasMaxAreaInBytes:-1,de=typeof p.disableFontFace=="boolean"?p.disableFontFace:_util.isNodeJS,me=p.fontExtraProperties===!0,xe=p.enableXfa===!0,Se=p.ownerDocument||globalThis.document,ke=p.disableRange===!0,Xe=p.disableStream===!0,Ee=p.disableAutoFetch===!0,_e=p.pdfBug===!0,ue=V?V.length:p.length??NaN,re=typeof p.useSystemFonts=="boolean"?p.useSystemFonts:!_util.isNodeJS&&!de,y=typeof p.useWorkerFetch=="boolean"?p.useWorkerFetch:E===_display_utils.DOMCMapReaderFactory&&O===_display_utils.DOMStandardFontDataFactory&&a&&B&&(0,_display_utils.isValidFetchUrl)(a,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(B,document.baseURI),l=p.canvasFactory||new DefaultCanvasFactory({ownerDocument:Se}),I=p.filterFactory||new DefaultFilterFactory({docId:P,ownerDocument:Se}),z=null;(0,_util.setVerbosityLevel)($);let Q={canvasFactory:l,filterFactory:I};if(y||(Q.cMapReaderFactory=new E({baseUrl:a,isCompressed:c}),Q.standardFontDataFactory=new O({baseUrl:B})),!q){let se={verbosity:$,port:_worker_options.GlobalWorkerOptions.workerPort};q=se.port?PDFWorker.fromPort(se):new PDFWorker(se),C._worker=q}let K={docId:P,apiVersion:"3.11.174",data:R,password:D,disableAutoFetch:Ee,rangeChunkSize:U,length:ue,docBaseUrl:x,enableXfa:xe,evaluatorOptions:{maxImageSize:Z,disableFontFace:de,ignoreErrors:Y,isEvalSupported:X,isOffscreenCanvasSupported:ie,canvasMaxAreaInBytes:ne,fontExtraProperties:me,useSystemFonts:re,cMapUrl:y?a:null,standardFontDataUrl:y?B:null}},le={ignoreErrors:Y,isEvalSupported:X,disableFontFace:de,fontExtraProperties:me,enableXfa:xe,ownerDocument:Se,disableAutoFetch:Ee,pdfBug:_e,styleElement:z};return q.promise.then(function(){if(C.destroyed)throw new Error("Loading aborted");let se=_fetchDocument(q,K),oe=new Promise(function(we){let Ie;V?Ie=new _transport_stream.PDFDataTransportStream({length:ue,initialData:V.initialData,progressiveDone:V.progressiveDone,contentDispositionFilename:V.contentDispositionFilename,disableRange:ke,disableStream:Xe},V):R||(Ie=(ze=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(ze):(0,_display_utils.isValidFetchUrl)(ze.url)?new _displayFetch_stream.PDFFetchStream(ze):new _displayNetwork.PDFNetworkStream(ze))({url:k,length:ue,httpHeaders:W,withCredentials:w,rangeChunkSize:U,disableRange:ke,disableStream:Xe})),we(Ie)});return Promise.all([se,oe]).then(function([we,Ie]){if(C.destroyed)throw new Error("Loading aborted");let Qe=new _message_handler.MessageHandler(P,we,q.port),ze=new WorkerTransport(Qe,C,Ie,le,Q);C._transport=ze,Qe.send("Ready",null)})}).catch(C._capability.reject),C}function _fetchDocument(p,C){return Ue(this,null,function*(){if(p.destroyed)throw new Error("Worker was destroyed");let P=yield p.messageHandler.sendWithPromise("GetDocRequest",C,C.data?[C.data.buffer]:null);if(p.destroyed)throw new Error("Worker was destroyed");return P})}function getUrlProp(p){if(p instanceof URL)return p.href;try{return new URL(p,window.location).href}catch{if(_util.isNodeJS&&typeof p=="string")return p}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(p){if(_util.isNodeJS&&typeof Buffer<"u"&&p instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(p instanceof Uint8Array&&p.byteLength===p.buffer.byteLength)return p;if(typeof p=="string")return(0,_util.stringToBytes)(p);if(typeof p=="object"&&!isNaN(p?.length)||(0,_util.isArrayBuffer)(p))return new Uint8Array(p);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}let n=class n{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Pi(n,h)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}destroy(){return Ue(this,null,function*(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),yield this._transport?.destroy()}catch(C){throw this._worker?.port&&delete this._worker._pendingDestroy,C}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}};h=new WeakMap,ee(n,h,0);let PDFDocumentLoadingTask=n;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(C,P,k=!1,R=null){this.length=C,this.initialData=P,this.progressiveDone=k,this.contentDispositionFilename=R,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(C){this._rangeListeners.push(C)}addProgressListener(C){this._progressListeners.push(C)}addProgressiveReadListener(C){this._progressiveReadListeners.push(C)}addProgressiveDoneListener(C){this._progressiveDoneListeners.push(C)}onDataRange(C,P){for(let k of this._rangeListeners)k(C,P)}onDataProgress(C,P){this._readyCapability.promise.then(()=>{for(let k of this._progressListeners)k(C,P)})}onDataProgressiveRead(C){this._readyCapability.promise.then(()=>{for(let P of this._progressiveReadListeners)P(C)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let C of this._progressiveDoneListeners)C()})}transportReady(){this._readyCapability.resolve()}requestDataRange(C,P){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(C,P){this._pdfInfo=C,this._transport=P,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(k=>{if(!k)return k;let R=[];for(let W in k)R.push(...k[W]);return R}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(C){return this._transport.getPage(C)}getPageIndex(C){return this._transport.getPageIndex(C)}getDestinations(){return this._transport.getDestinations()}getDestination(C){return this._transport.getDestination(C)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(C=!1){return this._transport.startCleanup(C||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(C,P,k,R=!1){ee(this,t);ee(this,_,null);ee(this,e,!1);this._pageIndex=C,this._pageInfo=P,this._transport=k,this._stats=R?new _display_utils.StatTimer:null,this._pdfBug=R,this.commonObjs=k.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:C,rotation:P=this.rotate,offsetX:k=0,offsetY:R=0,dontFlip:W=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:C,rotation:P,offsetX:k,offsetY:R,dontFlip:W})}getAnnotations({intent:C="display"}={}){let P=this._transport.getRenderingIntent(C);return this._transport.getAnnotations(this._pageIndex,P.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}getXfa(){return Ue(this,null,function*(){return this._transport._htmlForXfa?.children[this._pageIndex]||null})}render({canvasContext:C,viewport:P,intent:k="display",annotationMode:R=_util.AnnotationMode.ENABLE,transform:W=null,background:w=null,optionalContentConfigPromise:D=null,annotationCanvasMap:V=null,pageColors:U=null,printAnnotationStorage:q=null}){this._stats?.time("Overall");let $=this._transport.getRenderingIntent(k,R,q);J(this,e,!1),G(this,t,Gn).call(this),D||(D=this._transport.getOptionalContentConfig());let x=this._intentStates.get($.cacheKey);x||(x=Object.create(null),this._intentStates.set($.cacheKey,x)),x.streamReaderCancelTimeout&&(clearTimeout(x.streamReaderCancelTimeout),x.streamReaderCancelTimeout=null);let a=!!($.renderingIntent&_util.RenderingIntentFlag.PRINT);x.displayReadyCapability||(x.displayReadyCapability=new _util.PromiseCapability,x.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList($));let c=O=>{x.renderTasks.delete(E),(this._maybeCleanupAfterRender||a)&&J(this,e,!0),G(this,t,Ui).call(this,!a),O?(E.capability.reject(O),this._abortOperatorList({intentState:x,reason:O instanceof Error?O:new Error(O)})):E.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},E=new InternalRenderTask({callback:c,params:{canvasContext:C,viewport:P,transform:W,background:w},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:V,operatorList:x.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!a,pdfBug:this._pdfBug,pageColors:U});(x.renderTasks||=new Set).add(E);let B=E.task;return Promise.all([x.displayReadyCapability.promise,D]).then(([O,Y])=>{if(this.destroyed){c();return}this._stats?.time("Rendering"),E.initializeGraphics({transparency:O,optionalContentConfig:Y}),E.operatorListChanged()}).catch(c),B}getOperatorList({intent:C="display",annotationMode:P=_util.AnnotationMode.ENABLE,printAnnotationStorage:k=null}={}){function R(){w.operatorList.lastChunk&&(w.opListReadCapability.resolve(w.operatorList),w.renderTasks.delete(D))}let W=this._transport.getRenderingIntent(C,P,k,!0),w=this._intentStates.get(W.cacheKey);w||(w=Object.create(null),this._intentStates.set(W.cacheKey,w));let D;return w.opListReadCapability||(D=Object.create(null),D.operatorListChanged=R,w.opListReadCapability=new _util.PromiseCapability,(w.renderTasks||=new Set).add(D),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(W)),w.opListReadCapability.promise}streamTextContent({includeMarkedContent:C=!1,disableNormalization:P=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:C===!0,disableNormalization:P===!0},{highWaterMark:100,size(R){return R.items.length}})}getTextContent(C={}){if(this._transport._htmlForXfa)return this.getXfa().then(k=>_xfa_text.XfaText.textContent(k));let P=this.streamTextContent(C);return new Promise(function(k,R){function W(){w.read().then(function({value:V,done:U}){if(U){k(D);return}Object.assign(D.styles,V.styles),D.items.push(...V.items),W()},R)}let w=P.getReader(),D={items:[],styles:Object.create(null)};W()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let C=[];for(let P of this._intentStates.values())if(this._abortOperatorList({intentState:P,reason:new Error("Page was destroyed."),force:!0}),!P.opListReadCapability)for(let k of P.renderTasks)C.push(k.completed),k.cancel();return this.objs.clear(),J(this,e,!1),G(this,t,Gn).call(this),Promise.all(C)}cleanup(C=!1){J(this,e,!0);let P=G(this,t,Ui).call(this,!1);return C&&P&&(this._stats&&=new _display_utils.StatTimer),P}_startRenderPage(C,P){let k=this._intentStates.get(P);k&&(this._stats?.timeEnd("Page Request"),k.displayReadyCapability?.resolve(C))}_renderPageChunk(C,P){for(let k=0,R=C.length;k<R;k++)P.operatorList.fnArray.push(C.fnArray[k]),P.operatorList.argsArray.push(C.argsArray[k]);P.operatorList.lastChunk=C.lastChunk,P.operatorList.separateAnnots=C.separateAnnots;for(let k of P.renderTasks)k.operatorListChanged();C.lastChunk&&G(this,t,Ui).call(this,!0)}_pumpOperatorList({renderingIntent:C,cacheKey:P,annotationStorageSerializable:k}){let{map:R,transfers:W}=k,D=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:C,cacheKey:P,annotationStorage:R},W).getReader(),V=this._intentStates.get(P);V.streamReader=D;let U=()=>{D.read().then(({value:q,done:$})=>{if($){V.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(q,V),U())},q=>{if(V.streamReader=null,!this._transport.destroyed){if(V.operatorList){V.operatorList.lastChunk=!0;for(let $ of V.renderTasks)$.operatorListChanged();G(this,t,Ui).call(this,!0)}if(V.displayReadyCapability)V.displayReadyCapability.reject(q);else if(V.opListReadCapability)V.opListReadCapability.reject(q);else throw q}})};U()}_abortOperatorList({intentState:C,reason:P,force:k=!1}){if(C.streamReader){if(C.streamReaderCancelTimeout&&(clearTimeout(C.streamReaderCancelTimeout),C.streamReaderCancelTimeout=null),!k){if(C.renderTasks.size>0)return;if(P instanceof _display_utils.RenderingCancelledException){let R=RENDERING_CANCELLED_TIMEOUT;P.extraDelay>0&&P.extraDelay<1e3&&(R+=P.extraDelay),C.streamReaderCancelTimeout=setTimeout(()=>{C.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:C,reason:P,force:!0})},R);return}}if(C.streamReader.cancel(new _util.AbortException(P.message)).catch(()=>{}),C.streamReader=null,!this._transport.destroyed){for(let[R,W]of this._intentStates)if(W===C){this._intentStates.delete(R);break}this.cleanup()}}}get stats(){return this._stats}}_=new WeakMap,e=new WeakMap,t=new WeakSet,Ui=function(C=!1){if(G(this,t,Gn).call(this),!s(this,e)||this.destroyed)return!1;if(C)return J(this,_,setTimeout(()=>{J(this,_,null),G(this,t,Ui).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(let{renderTasks:P,operatorList:k}of this._intentStates.values())if(P.size>0||!k.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),J(this,e,!1),!0},Gn=function(){s(this,_)&&(clearTimeout(s(this,_)),J(this,_,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ee(this,m,new Set);ee(this,o,Promise.resolve())}postMessage(C,P){let k={data:structuredClone(C,P?{transfer:P}:null)};s(this,o).then(()=>{for(let R of s(this,m))R.call(this,k)})}addEventListener(C,P){s(this,m).add(P)}removeEventListener(C,P){s(this,m).delete(P)}terminate(){s(this,m).clear()}}m=new WeakMap,o=new WeakMap,exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof us=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){let p=document?.currentScript?.src;p&&(PDFWorkerUtil.fallbackWorkerSrc=p.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(p,C){let P;try{if(P=new URL(p),!P.origin||P.origin==="null")return!1}catch{return!1}let k=new URL(C,P);return P.origin===k.origin},PDFWorkerUtil.createCDNWrapper=function(p){let C=`importScripts("${p}");`;return URL.createObjectURL(new Blob([C]))}}let _PDFWorker=class _PDFWorker{constructor({name:p=null,port:C=null,verbosity:P=(0,_util.getVerbosityLevel)()}={}){if(this.name=p,this.destroyed=!1,this.verbosity=P,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,C){if(s(_PDFWorker,u)?.has(C))throw new Error("Cannot use more than one PDFWorker per port.");(s(_PDFWorker,u)||J(_PDFWorker,u,new WeakMap)).set(C,this),this._initializeFromPort(C);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(p){this._port=p,this._messageHandler=new _message_handler.MessageHandler("main","worker",p),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:p}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,p)||(p=PDFWorkerUtil.createCDNWrapper(new URL(p,window.location).href));let C=new Worker(p),P=new _message_handler.MessageHandler("main","worker",C),k=()=>{C.removeEventListener("error",R),P.destroy(),C.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},R=()=>{this._webWorker||k()};C.addEventListener("error",R),P.on("test",w=>{if(C.removeEventListener("error",R),this.destroyed){k();return}w?(this._messageHandler=P,this._port=C,this._webWorker=C,this._readyCapability.resolve(),P.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),P.destroy(),C.terminate())}),P.on("ready",w=>{if(C.removeEventListener("error",R),this.destroyed){k();return}try{W()}catch{this._setupFakeWorker()}});let W=()=>{let w=new Uint8Array;P.send("test",w,[w.buffer])};W();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(p=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}let C=new LoopbackPort;this._port=C;let P=`fake${PDFWorkerUtil.fakeWorkerId++}`,k=new _message_handler.MessageHandler(P+"_worker",P,C);p.setup(k,C);let R=new _message_handler.MessageHandler(P,P+"_worker",C);this._messageHandler=R,this._readyCapability.resolve(),R.send("configure",{verbosity:this.verbosity})}).catch(p=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${p.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),s(_PDFWorker,u)?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(p){if(!p?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");let C=s(this,u)?.get(p.port);if(C){if(C._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return C}return new _PDFWorker(p)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let loader=()=>Ue(this,null,function*(){let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof us=="function"){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return yield(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler});return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};u=new WeakMap,ee(_PDFWorker,u);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(C,P,k,R,W){ee(this,M);ee(this,d,new Map);ee(this,v,new Map);ee(this,T,new Map);ee(this,A,null);this.messageHandler=C,this.loadingTask=P,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:R.ownerDocument,styleElement:R.styleElement}),this._params=R,this.canvasFactory=W.canvasFactory,this.filterFactory=W.filterFactory,this.cMapReaderFactory=W.cMapReaderFactory,this.standardFontDataFactory=W.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=k,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(C,P=_util.AnnotationMode.ENABLE,k=null,R=!1){let W=_util.RenderingIntentFlag.DISPLAY,w=_annotation_storage.SerializableEmpty;switch(C){case"any":W=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":W=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${C}`)}switch(P){case _util.AnnotationMode.DISABLE:W+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:W+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:W+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,w=(W&_util.RenderingIntentFlag.PRINT&&k instanceof _annotation_storage.PrintAnnotationStorage?k:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${P}`)}return R&&(W+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:W,cacheKey:`${W}_${w.hash}`,annotationStorageSerializable:w}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,s(this,A)?.reject(new Error("Worker was destroyed during onPassword callback"));let C=[];for(let k of s(this,v).values())C.push(k._destroy());s(this,v).clear(),s(this,T).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let P=this.messageHandler.sendWithPromise("Terminate",null);return C.push(P),Promise.all(C).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),s(this,d).clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:C,loadingTask:P}=this;C.on("GetReader",(k,R)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=W=>{this._lastProgress={loaded:W.loaded,total:W.total}},R.onPull=()=>{this._fullReader.read().then(function({value:W,done:w}){if(w){R.close();return}(0,_util.assert)(W instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),R.enqueue(new Uint8Array(W),1,[W])}).catch(W=>{R.error(W)})},R.onCancel=W=>{this._fullReader.cancel(W),R.ready.catch(w=>{if(!this.destroyed)throw w})}}),C.on("ReaderHeadersReady",k=>{let R=new _util.PromiseCapability,W=this._fullReader;return W.headersReady.then(()=>{(!W.isStreamingSupported||!W.isRangeSupported)&&(this._lastProgress&&P.onProgress?.(this._lastProgress),W.onProgress=w=>{P.onProgress?.({loaded:w.loaded,total:w.total})}),R.resolve({isStreamingSupported:W.isStreamingSupported,isRangeSupported:W.isRangeSupported,contentLength:W.contentLength})},R.reject),R.promise}),C.on("GetRangeReader",(k,R)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let W=this._networkStream.getRangeReader(k.begin,k.end);if(!W){R.close();return}R.onPull=()=>{W.read().then(function({value:w,done:D}){if(D){R.close();return}(0,_util.assert)(w instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),R.enqueue(new Uint8Array(w),1,[w])}).catch(w=>{R.error(w)})},R.onCancel=w=>{W.cancel(w),R.ready.catch(D=>{if(!this.destroyed)throw D})}}),C.on("GetDoc",({pdfInfo:k})=>{this._numPages=k.numPages,this._htmlForXfa=k.htmlForXfa,delete k.htmlForXfa,P._capability.resolve(new PDFDocumentProxy(k,this))}),C.on("DocException",function(k){let R;switch(k.name){case"PasswordException":R=new _util.PasswordException(k.message,k.code);break;case"InvalidPDFException":R=new _util.InvalidPDFException(k.message);break;case"MissingPDFException":R=new _util.MissingPDFException(k.message);break;case"UnexpectedResponseException":R=new _util.UnexpectedResponseException(k.message,k.status);break;case"UnknownErrorException":R=new _util.UnknownErrorException(k.message,k.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}P._capability.reject(R)}),C.on("PasswordRequest",k=>{if(J(this,A,new _util.PromiseCapability),P.onPassword){let R=W=>{W instanceof Error?s(this,A).reject(W):s(this,A).resolve({password:W})};try{P.onPassword(R,k.code)}catch(W){s(this,A).reject(W)}}else s(this,A).reject(new _util.PasswordException(k.message,k.code));return s(this,A).promise}),C.on("DataLoaded",k=>{P.onProgress?.({loaded:k.length,total:k.length}),this.downloadInfoCapability.resolve(k)}),C.on("StartRenderPage",k=>{if(this.destroyed)return;s(this,v).get(k.pageIndex)._startRenderPage(k.transparency,k.cacheKey)}),C.on("commonobj",([k,R,W])=>{if(!this.destroyed&&!this.commonObjs.has(k))switch(R){case"Font":let w=this._params;if("error"in W){let U=W.error;(0,_util.warn)(`Error during font loading: ${U}`),this.commonObjs.resolve(k,U);break}let D=w.pdfBug&&globalThis.FontInspector?.enabled?(U,q)=>globalThis.FontInspector.fontAdded(U,q):null,V=new _font_loader.FontFaceObject(W,{isEvalSupported:w.isEvalSupported,disableFontFace:w.disableFontFace,ignoreErrors:w.ignoreErrors,inspectFont:D});this.fontLoader.bind(V).catch(U=>C.sendWithPromise("FontFallback",{id:k})).finally(()=>{!w.fontExtraProperties&&V.data&&(V.data=null),this.commonObjs.resolve(k,V)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(k,W);break;default:throw new Error(`Got unknown common object type ${R}`)}}),C.on("obj",([k,R,W,w])=>{if(this.destroyed)return;let D=s(this,v).get(R);if(!D.objs.has(k))switch(W){case"Image":if(D.objs.resolve(k,w),w){let V;if(w.bitmap){let{width:U,height:q}=w;V=U*q*4}else V=w.data?.length||0;V>_util.MAX_IMAGE_SIZE_TO_CACHE&&(D._maybeCleanupAfterRender=!0)}break;case"Pattern":D.objs.resolve(k,w);break;default:throw new Error(`Got unknown object type ${W}`)}}),C.on("DocProgress",k=>{this.destroyed||P.onProgress?.({loaded:k.loaded,total:k.total})}),C.on("FetchBuiltInCMap",k=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(k):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),C.on("FetchStandardFontData",k=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(k):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:C,transfers:P}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:C,filename:this._fullReader?.filename??null},P).finally(()=>{this.annotationStorage.resetModified()})}getPage(C){if(!Number.isInteger(C)||C<=0||C>this._numPages)return Promise.reject(new Error("Invalid page request."));let P=C-1,k=s(this,T).get(P);if(k)return k;let R=this.messageHandler.sendWithPromise("GetPage",{pageIndex:P}).then(W=>{if(this.destroyed)throw new Error("Transport destroyed");let w=new PDFPageProxy(P,W,this,this._params.pdfBug);return s(this,v).set(P,w),w});return s(this,T).set(P,R),R}getPageIndex(C){return typeof C!="object"||C===null||!Number.isInteger(C.num)||C.num<0||!Number.isInteger(C.gen)||C.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:C.num,gen:C.gen})}getAnnotations(C,P){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:C,intent:P})}getFieldObjects(){return G(this,M,Xn).call(this,"GetFieldObjects")}hasJSActions(){return G(this,M,Xn).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(C){return typeof C!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:C})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return G(this,M,Xn).call(this,"GetDocJSActions")}getPageJSActions(C){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:C})}getStructTree(C){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:C})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(C=>new _optional_content_config.OptionalContentConfig(C))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let C="GetMetadata",P=s(this,d).get(C);if(P)return P;let k=this.messageHandler.sendWithPromise(C,null).then(R=>({info:R[0],metadata:R[1]?new _metadata.Metadata(R[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return s(this,d).set(C,k),k}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(C=!1){return Ue(this,null,function*(){if(!this.destroyed){yield this.messageHandler.sendWithPromise("Cleanup",null);for(let P of s(this,v).values())if(!P.cleanup())throw new Error(`startCleanup: Page ${P.pageNumber} is currently rendering.`);this.commonObjs.clear(),C||this.fontLoader.clear(),s(this,d).clear(),this.filterFactory.destroy(!0)}})}get loadingParams(){let{disableAutoFetch:C,enableXfa:P}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:C,enableXfa:P})}}d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakSet,Xn=function(C,P=null){let k=s(this,d).get(C);if(k)return k;let R=this.messageHandler.sendWithPromise(C,P);return s(this,d).set(C,R),R};class PDFObjects{constructor(){ee(this,b);ee(this,S,Object.create(null))}get(C,P=null){if(P){let R=G(this,b,Ts).call(this,C);return R.capability.promise.then(()=>P(R.data)),null}let k=s(this,S)[C];if(!k?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${C}.`);return k.data}has(C){return s(this,S)[C]?.capability.settled||!1}resolve(C,P=null){let k=G(this,b,Ts).call(this,C);k.data=P,k.capability.resolve()}clear(){for(let C in s(this,S)){let{data:P}=s(this,S)[C];P?.bitmap?.close()}J(this,S,Object.create(null))}}S=new WeakMap,b=new WeakSet,Ts=function(C){return s(this,S)[C]||={capability:new _util.PromiseCapability,data:null}};class RenderTask{constructor(C){ee(this,L,null);J(this,L,C),this.onContinue=null}get promise(){return s(this,L).capability.promise}cancel(C=0){s(this,L).cancel(null,C)}get separateAnnots(){let{separateAnnots:C}=s(this,L).operatorList;if(!C)return!1;let{annotationCanvasMap:P}=s(this,L);return C.form||C.canvas&&P?.size>0}}L=new WeakMap,exports.RenderTask=RenderTask;let f=class f{constructor({callback:C,params:P,objs:k,commonObjs:R,annotationCanvasMap:W,operatorList:w,pageIndex:D,canvasFactory:V,filterFactory:U,useRequestAnimationFrame:q=!1,pdfBug:$=!1,pageColors:x=null}){this.callback=C,this.params=P,this.objs=k,this.commonObjs=R,this.annotationCanvasMap=W,this.operatorListIdx=null,this.operatorList=w,this._pageIndex=D,this.canvasFactory=V,this.filterFactory=U,this._pdfBug=$,this.pageColors=x,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=q===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=P.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:C=!1,optionalContentConfig:P}){if(this.cancelled)return;if(this._canvas){if(s(f,g).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");s(f,g).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());let{canvasContext:k,viewport:R,transform:W,background:w}=this.params;this.gfx=new _canvas.CanvasGraphics(k,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:P},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:W,viewport:R,transparency:C,background:w}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(C=null,P=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),s(f,g).delete(this._canvas),this.callback(C||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,P))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}_next(){return Ue(this,null,function*(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),s(f,g).delete(this._canvas),this.callback())))})}};g=new WeakMap,ee(f,g,new WeakSet);let InternalRenderTask=f,version="3.11.174";exports.version=version;let build="ce8716743";exports.build=build},(h,n,_)=>{var u,d,v,nl,A;Object.defineProperty(n,"__esModule",{value:!0}),n.SerializableEmpty=n.PrintAnnotationStorage=n.AnnotationStorage=void 0;var e=_(1),t=_(4),i=_(8);let r=Object.freeze({map:null,hash:"",transfers:void 0});n.SerializableEmpty=r;class m{constructor(){ee(this,v);ee(this,u,!1);ee(this,d,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(F,S){let b=s(this,d).get(F);return b===void 0?S:Object.assign(S,b)}getRawValue(F){return s(this,d).get(F)}remove(F){if(s(this,d).delete(F),s(this,d).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(let S of s(this,d).values())if(S instanceof t.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(F,S){let b=s(this,d).get(F),N=!1;if(b!==void 0)for(let[L,g]of Object.entries(S))b[L]!==g&&(N=!0,b[L]=g);else N=!0,s(this,d).set(F,S);N&&G(this,v,nl).call(this),S instanceof t.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(S.constructor._type)}has(F){return s(this,d).has(F)}getAll(){return s(this,d).size>0?(0,e.objectFromMap)(s(this,d)):null}setAll(F){for(let[S,b]of Object.entries(F))this.setValue(S,b)}get size(){return s(this,d).size}resetModified(){s(this,u)&&(J(this,u,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new o(this)}get serializable(){if(s(this,d).size===0)return r;let F=new Map,S=new i.MurmurHash3_64,b=[],N=Object.create(null),L=!1;for(let[g,f]of s(this,d)){let p=f instanceof t.AnnotationEditor?f.serialize(!1,N):f;p&&(F.set(g,p),S.update(`${g}:${JSON.stringify(p)}`),L||=!!p.bitmap)}if(L)for(let g of F.values())g.bitmap&&b.push(g.bitmap);return F.size>0?{map:F,hash:S.hexdigest(),transfers:b}:r}}u=new WeakMap,d=new WeakMap,v=new WeakSet,nl=function(){s(this,u)||(J(this,u,!0),typeof this.onSetModified=="function"&&this.onSetModified())},n.AnnotationStorage=m;class o extends m{constructor(S){super();ee(this,A);let{map:b,hash:N,transfers:L}=S.serializable,g=structuredClone(b,L?{transfer:L}:null);J(this,A,{map:g,hash:N,transfers:L})}get print(){(0,e.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return s(this,A)}}A=new WeakMap,n.PrintAnnotationStorage=o},(h,n,_)=>{var o,u,d,v,T,A,M,F,S,b,N,L,g,f,p,Ms,ks,k,Ls,Is,sl,rl,ol,Os,al;Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationEditor=void 0;var e=_(5),t=_(1),i=_(6);let $=class ${constructor(a){ee(this,p);ee(this,o,"");ee(this,u,!1);ee(this,d,null);ee(this,v,null);ee(this,T,null);ee(this,A,!1);ee(this,M,null);ee(this,F,this.focusin.bind(this));ee(this,S,this.focusout.bind(this));ee(this,b,!1);ee(this,N,!1);ee(this,L,!1);qe(this,"_initialOptions",Object.create(null));qe(this,"_uiManager",null);qe(this,"_focusEventsAllowed",!0);qe(this,"_l10nPromise",null);ee(this,g,!1);ee(this,f,$._zIndex++);this.constructor===$&&(0,t.unreachable)("Cannot initialize AnnotationEditor."),this.parent=a.parent,this.id=a.id,this.width=this.height=null,this.pageIndex=a.parent.pageIndex,this.name=a.name,this.div=null,this._uiManager=a.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=a.isCentered,this._structTreeParentId=null;let{rotation:c,rawDims:{pageWidth:E,pageHeight:B,pageX:O,pageY:Y}}=this.parent.viewport;this.rotation=c,this.pageRotation=(360+c-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[E,B],this.pageTranslation=[O,Y];let[Z,X]=this.parentDimensions;this.x=a.x/Z,this.y=a.y/X,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,t.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(a){let c=new m({id:a.parent.getNextId(),parent:a.parent,uiManager:a._uiManager});c.annotationElementId=a.annotationElementId,c.deleted=!0,c._uiManager.addToAnnotationStorage(c)}static initialize(a,c=null){if($._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(B=>[B,a.get(B)])),c?.strings)for(let B of c.strings)$._l10nPromise.set(B,a.get(B));if($._borderLineWidth!==-1)return;let E=getComputedStyle(document.documentElement);$._borderLineWidth=parseFloat(E.getPropertyValue("--outline-width"))||0}static updateDefaultParams(a,c){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(a){return!1}static paste(a,c){(0,t.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return s(this,g)}set _isDraggable(a){J(this,g,a),this.div?.classList.toggle("draggable",a)}center(){let[a,c]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*c/(a*2),this.y+=this.width*a/(c*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*c/(a*2),this.y-=this.width*a/(c*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(a){this._uiManager.addCommands(a)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=s(this,f)}setParent(a){a!==null&&(this.pageIndex=a.pageIndex,this.pageDimensions=a.pageDimensions),this.parent=a}focusin(a){this._focusEventsAllowed&&(s(this,b)?J(this,b,!1):this.parent.setSelected(this))}focusout(a){!this._focusEventsAllowed||!this.isAttachedToDOM||a.relatedTarget?.closest(`#${this.id}`)||(a.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(a,c,E,B){let[O,Y]=this.parentDimensions;[E,B]=this.screenToPageTranslation(E,B),this.x=(a+E)/O,this.y=(c+B)/Y,this.fixAndSetPosition()}translate(a,c){G(this,p,Ms).call(this,this.parentDimensions,a,c)}translateInPage(a,c){G(this,p,Ms).call(this,this.pageDimensions,a,c),this.div.scrollIntoView({block:"nearest"})}drag(a,c){let[E,B]=this.parentDimensions;if(this.x+=a/E,this.y+=c/B,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:ie,y:ne}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ie,ne)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:O,y:Y}=this,[Z,X]=G(this,p,ks).call(this);O+=Z,Y+=X,this.div.style.left=`${(100*O).toFixed(2)}%`,this.div.style.top=`${(100*Y).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){let[a,c]=this.pageDimensions,{x:E,y:B,width:O,height:Y}=this;switch(O*=a,Y*=c,E*=a,B*=c,this.rotation){case 0:E=Math.max(0,Math.min(a-O,E)),B=Math.max(0,Math.min(c-Y,B));break;case 90:E=Math.max(0,Math.min(a-Y,E)),B=Math.min(c,Math.max(O,B));break;case 180:E=Math.min(a,Math.max(O,E)),B=Math.min(c,Math.max(Y,B));break;case 270:E=Math.min(a,Math.max(Y,E)),B=Math.max(0,Math.min(c-O,B));break}this.x=E/=a,this.y=B/=c;let[Z,X]=G(this,p,ks).call(this);E+=Z,B+=X;let{style:ie}=this.div;ie.left=`${(100*E).toFixed(2)}%`,ie.top=`${(100*B).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(a,c){var E;return G(E=$,k,Ls).call(E,a,c,this.parentRotation)}pageTranslationToScreen(a,c){var E;return G(E=$,k,Ls).call(E,a,c,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:a,pageDimensions:[c,E]}=this,B=c*a,O=E*a;return t.FeatureTest.isCSSRoundSupported?[Math.round(B),Math.round(O)]:[B,O]}setDims(a,c){let[E,B]=this.parentDimensions;this.div.style.width=`${(100*a/E).toFixed(2)}%`,s(this,A)||(this.div.style.height=`${(100*c/B).toFixed(2)}%`),s(this,d)?.classList.toggle("small",a<$.SMALL_EDITOR_SIZE||c<$.SMALL_EDITOR_SIZE)}fixDims(){let{style:a}=this.div,{height:c,width:E}=a,B=E.endsWith("%"),O=!s(this,A)&&c.endsWith("%");if(B&&O)return;let[Y,Z]=this.parentDimensions;B||(a.width=`${(100*parseFloat(E)/Y).toFixed(2)}%`),!s(this,A)&&!O&&(a.height=`${(100*parseFloat(c)/Z).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}addAltTextButton(){return Ue(this,null,function*(){if(s(this,d))return;let a=J(this,d,document.createElement("button"));a.className="altText";let c=yield $._l10nPromise.get("editor_alt_text_button_label");a.textContent=c,a.setAttribute("aria-label",c),a.tabIndex="0",a.addEventListener("contextmenu",i.noContextMenu),a.addEventListener("pointerdown",E=>E.stopPropagation()),a.addEventListener("click",E=>{E.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),a.addEventListener("keydown",E=>{E.target===a&&E.key==="Enter"&&(E.preventDefault(),this._uiManager.editAltText(this))}),G(this,p,Os).call(this),this.div.append(a),$.SMALL_EDITOR_SIZE||($.SMALL_EDITOR_SIZE=Math.min(128,Math.round(a.getBoundingClientRect().width*1.4)))})}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:s(this,o),decorative:s(this,u)}}set altTextData({altText:a,decorative:c}){s(this,o)===a&&s(this,u)===c||(J(this,o,a),J(this,u,c),G(this,p,Os).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",s(this,F)),this.div.addEventListener("focusout",s(this,S));let[a,c]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*c/a).toFixed(2)}%`,this.div.style.maxHeight=`${(100*a/c).toFixed(2)}%`);let[E,B]=this.getInitialTranslation();return this.translate(E,B),(0,e.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(a){let{isMac:c}=t.FeatureTest.platform;if(a.button!==0||a.ctrlKey&&c){a.preventDefault();return}J(this,b,!0),G(this,p,al).call(this,a)}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(a,c,E){a.changeParent(this),this.x=c,this.y=E,this.fixAndSetPosition()}getRect(a,c){let E=this.parentScale,[B,O]=this.pageDimensions,[Y,Z]=this.pageTranslation,X=a/E,ie=c/E,ne=this.x*B,de=this.y*O,me=this.width*B,xe=this.height*O;switch(this.rotation){case 0:return[ne+X+Y,O-de-ie-xe+Z,ne+X+me+Y,O-de-ie+Z];case 90:return[ne+ie+Y,O-de+X+Z,ne+ie+xe+Y,O-de+X+me+Z];case 180:return[ne-X-me+Y,O-de+ie+Z,ne-X+Y,O-de+ie+xe+Z];case 270:return[ne-ie-xe+Y,O-de-X-me+Z,ne-ie+Y,O-de-X+Z];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(a,c){let[E,B,O,Y]=a,Z=O-E,X=Y-B;switch(this.rotation){case 0:return[E,c-Y,Z,X];case 90:return[E,c-B,X,Z];case 180:return[O,c-B,Z,X];case 270:return[O,c-Y,X,Z];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){J(this,L,!0)}disableEditMode(){J(this,L,!1)}isInEditMode(){return s(this,L)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",s(this,F)),this.div?.addEventListener("focusout",s(this,S))}serialize(a=!1,c=null){(0,t.unreachable)("An editor must be serializable")}static deserialize(a,c,E){let B=new this.prototype.constructor({parent:c,id:c.getNextId(),uiManager:E});B.rotation=a.rotation;let[O,Y]=B.pageDimensions,[Z,X,ie,ne]=B.getRectInCurrentCoords(a.rect,Y);return B.x=Z/O,B.y=X/Y,B.width=ie/O,B.height=ne/Y,B}remove(){this.div.removeEventListener("focusin",s(this,F)),this.div.removeEventListener("focusout",s(this,S)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),s(this,d)?.remove(),J(this,d,null),J(this,v,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(G(this,p,sl).call(this),s(this,M).classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){s(this,M)?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(a,c){}disableEditing(){s(this,d)&&(s(this,d).hidden=!0)}enableEditing(){s(this,d)&&(s(this,d).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return s(this,N)}set isEditing(a){J(this,N,a),this.parent&&(a?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(a,c){J(this,A,!0);let E=a/c,{style:B}=this.div;B.aspectRatio=E,B.height="auto"}static get MIN_SIZE(){return 16}};o=new WeakMap,u=new WeakMap,d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakMap,N=new WeakMap,L=new WeakMap,g=new WeakMap,f=new WeakMap,p=new WeakSet,Ms=function([a,c],E,B){[E,B]=this.screenToPageTranslation(E,B),this.x+=E/a,this.y+=B/c,this.fixAndSetPosition()},ks=function(){let[a,c]=this.parentDimensions,{_borderLineWidth:E}=$,B=E/a,O=E/c;switch(this.rotation){case 90:return[-B,O];case 180:return[B,O];case 270:return[B,-O];default:return[-B,-O]}},k=new WeakSet,Ls=function(a,c,E){switch(E){case 90:return[c,-a];case 180:return[-a,-c];case 270:return[-c,a];default:return[a,c]}},Is=function(a){switch(a){case 90:{let[c,E]=this.pageDimensions;return[0,-c/E,E/c,0]}case 180:return[-1,0,0,-1];case 270:{let[c,E]=this.pageDimensions;return[0,c/E,-E/c,0]}default:return[1,0,0,1]}},sl=function(){if(s(this,M))return;J(this,M,document.createElement("div")),s(this,M).classList.add("resizers");let a=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||a.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(let c of a){let E=document.createElement("div");s(this,M).append(E),E.classList.add("resizer",c),E.addEventListener("pointerdown",G(this,p,rl).bind(this,c)),E.addEventListener("contextmenu",i.noContextMenu)}this.div.prepend(s(this,M))},rl=function(a,c){c.preventDefault();let{isMac:E}=t.FeatureTest.platform;if(c.button!==0||c.ctrlKey&&E)return;let B=G(this,p,ol).bind(this,a),O=this._isDraggable;this._isDraggable=!1;let Y={passive:!0,capture:!0};window.addEventListener("pointermove",B,Y);let Z=this.x,X=this.y,ie=this.width,ne=this.height,de=this.parent.div.style.cursor,me=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(c.target).cursor;let xe=()=>{this._isDraggable=O,window.removeEventListener("pointerup",xe),window.removeEventListener("blur",xe),window.removeEventListener("pointermove",B,Y),this.parent.div.style.cursor=de,this.div.style.cursor=me;let Se=this.x,ke=this.y,Xe=this.width,Ee=this.height;Se===Z&&ke===X&&Xe===ie&&Ee===ne||this.addCommands({cmd:()=>{this.width=Xe,this.height=Ee,this.x=Se,this.y=ke;let[_e,ue]=this.parentDimensions;this.setDims(_e*Xe,ue*Ee),this.fixAndSetPosition()},undo:()=>{this.width=ie,this.height=ne,this.x=Z,this.y=X;let[_e,ue]=this.parentDimensions;this.setDims(_e*ie,ue*ne),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",xe),window.addEventListener("blur",xe)},ol=function(a,c){let[E,B]=this.parentDimensions,O=this.x,Y=this.y,Z=this.width,X=this.height,ie=$.MIN_SIZE/E,ne=$.MIN_SIZE/B,de=ze=>Math.round(ze*1e4)/1e4,me=G(this,p,Is).call(this,this.rotation),xe=(ze,We)=>[me[0]*ze+me[2]*We,me[1]*ze+me[3]*We],Se=G(this,p,Is).call(this,360-this.rotation),ke=(ze,We)=>[Se[0]*ze+Se[2]*We,Se[1]*ze+Se[3]*We],Xe,Ee,_e=!1,ue=!1;switch(a){case"topLeft":_e=!0,Xe=(ze,We)=>[0,0],Ee=(ze,We)=>[ze,We];break;case"topMiddle":Xe=(ze,We)=>[ze/2,0],Ee=(ze,We)=>[ze/2,We];break;case"topRight":_e=!0,Xe=(ze,We)=>[ze,0],Ee=(ze,We)=>[0,We];break;case"middleRight":ue=!0,Xe=(ze,We)=>[ze,We/2],Ee=(ze,We)=>[0,We/2];break;case"bottomRight":_e=!0,Xe=(ze,We)=>[ze,We],Ee=(ze,We)=>[0,0];break;case"bottomMiddle":Xe=(ze,We)=>[ze/2,We],Ee=(ze,We)=>[ze/2,0];break;case"bottomLeft":_e=!0,Xe=(ze,We)=>[0,We],Ee=(ze,We)=>[ze,0];break;case"middleLeft":ue=!0,Xe=(ze,We)=>[0,We/2],Ee=(ze,We)=>[ze,We/2];break}let re=Xe(Z,X),y=Ee(Z,X),l=xe(...y),I=de(O+l[0]),z=de(Y+l[1]),Q=1,K=1,[le,se]=this.screenToPageTranslation(c.movementX,c.movementY);if([le,se]=ke(le/E,se/B),_e){let ze=Math.hypot(Z,X);Q=K=Math.max(Math.min(Math.hypot(y[0]-re[0]-le,y[1]-re[1]-se)/ze,1/Z,1/X),ie/Z,ne/X)}else ue?Q=Math.max(ie,Math.min(1,Math.abs(y[0]-re[0]-le)))/Z:K=Math.max(ne,Math.min(1,Math.abs(y[1]-re[1]-se)))/X;let oe=de(Z*Q),we=de(X*K);l=xe(...Ee(oe,we));let Ie=I-l[0],Qe=z-l[1];this.width=oe,this.height=we,this.x=Ie,this.y=Qe,this.setDims(E*oe,B*we),this.fixAndSetPosition()},Os=function(){return Ue(this,null,function*(){let a=s(this,d);if(!a)return;if(!s(this,o)&&!s(this,u)){a.classList.remove("done"),s(this,v)?.remove();return}$._l10nPromise.get("editor_alt_text_edit_button_label").then(E=>{a.setAttribute("aria-label",E)});let c=s(this,v);if(!c){J(this,v,c=document.createElement("span")),c.className="tooltip",c.setAttribute("role","tooltip");let E=c.id=`alt-text-tooltip-${this.id}`;a.setAttribute("aria-describedby",E);let B=100;a.addEventListener("mouseenter",()=>{J(this,T,setTimeout(()=>{J(this,T,null),s(this,v).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},B))}),a.addEventListener("mouseleave",()=>{clearTimeout(s(this,T)),J(this,T,null),s(this,v)?.classList.remove("show")})}a.classList.add("done"),c.innerText=s(this,u)?yield $._l10nPromise.get("editor_alt_text_decorative_tooltip"):s(this,o),c.parentNode||a.append(c)})},al=function(a){if(!this._isDraggable)return;let c=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let E,B;c&&(E={passive:!0,capture:!0},B=Y=>{let[Z,X]=this.screenToPageTranslation(Y.movementX,Y.movementY);this._uiManager.dragSelectedEditors(Z,X)},window.addEventListener("pointermove",B,E));let O=()=>{if(window.removeEventListener("pointerup",O),window.removeEventListener("blur",O),c&&window.removeEventListener("pointermove",B,E),J(this,b,!1),!this._uiManager.endDragSession()){let{isMac:Y}=t.FeatureTest.platform;a.ctrlKey&&!Y||a.shiftKey||a.metaKey&&Y?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",O),window.addEventListener("blur",O)},ee($,k),qe($,"_borderLineWidth",-1),qe($,"_colorManager",new e.ColorManager),qe($,"_zIndex",1),qe($,"SMALL_EDITOR_SIZE",0);let r=$;n.AnnotationEditor=r;class m extends r{constructor(a){super(a),this.annotationElementId=a.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(h,n,_)=>{var A,M,F,S,b,Fs,g,f,p,C;Object.defineProperty(n,"__esModule",{value:!0}),n.KeyboardManager=n.CommandManager=n.ColorManager=n.AnnotationEditorUIManager=void 0,n.bindEvents=i,n.opacityToHex=r;var e=_(1),t=_(6);function i(k,R,W){for(let w of W)R.addEventListener(w,k[w].bind(k))}function r(k){return Math.round(Math.min(255,Math.max(1,255*k))).toString(16).padStart(2,"0")}class m{constructor(){ee(this,A,0)}getId(){return`${e.AnnotationEditorPrefix}${Pi(this,A)._++}`}}A=new WeakMap;let L=class L{constructor(){ee(this,b);ee(this,M,(0,e.getUuid)());ee(this,F,0);ee(this,S,null)}static get _isSVGFittingCanvas(){let R='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>',w=new OffscreenCanvas(1,3).getContext("2d"),D=new Image;D.src=R;let V=D.decode().then(()=>(w.drawImage(D,0,0,1,1,0,0,1,3),new Uint32Array(w.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,e.shadow)(this,"_isSVGFittingCanvas",V)}getFromFile(R){return Ue(this,null,function*(){let{lastModified:W,name:w,size:D,type:V}=R;return G(this,b,Fs).call(this,`${W}_${w}_${D}_${V}`,R)})}getFromUrl(R){return Ue(this,null,function*(){return G(this,b,Fs).call(this,R,R)})}getFromId(R){return Ue(this,null,function*(){s(this,S)||J(this,S,new Map);let W=s(this,S).get(R);return W?W.bitmap?(W.refCounter+=1,W):W.file?this.getFromFile(W.file):this.getFromUrl(W.url):null})}getSvgUrl(R){let W=s(this,S).get(R);return W?.isSvg?W.svgUrl:null}deleteId(R){s(this,S)||J(this,S,new Map);let W=s(this,S).get(R);W&&(W.refCounter-=1,W.refCounter===0&&(W.bitmap=null))}isValidId(R){return R.startsWith(`image_${s(this,M)}_`)}};M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakSet,Fs=function(R,W){return Ue(this,null,function*(){s(this,S)||J(this,S,new Map);let w=s(this,S).get(R);if(w===null)return null;if(w?.bitmap)return w.refCounter+=1,w;try{w||={bitmap:null,id:`image_${s(this,M)}_${Pi(this,F)._++}`,refCounter:0,isSvg:!1};let D;if(typeof W=="string"){w.url=W;let V=yield fetch(W);if(!V.ok)throw new Error(V.statusText);D=yield V.blob()}else D=w.file=W;if(D.type==="image/svg+xml"){let V=L._isSVGFittingCanvas,U=new FileReader,q=new Image,$=new Promise((x,a)=>{q.onload=()=>{w.bitmap=q,w.isSvg=!0,x()},U.onload=()=>Ue(this,null,function*(){let c=w.svgUrl=U.result;q.src=(yield V)?`${c}#svgView(preserveAspectRatio(none))`:c}),q.onerror=U.onerror=a});U.readAsDataURL(D),yield $}else w.bitmap=yield createImageBitmap(D);w.refCounter=1}catch(D){console.error(D),w=null}return s(this,S).set(R,w),w&&s(this,S).set(w.id,w),w})};let o=L;class u{constructor(R=128){ee(this,g,[]);ee(this,f,!1);ee(this,p);ee(this,C,-1);J(this,p,R)}add({cmd:R,undo:W,mustExec:w,type:D=NaN,overwriteIfSameType:V=!1,keepUndo:U=!1}){if(w&&R(),s(this,f))return;let q={cmd:R,undo:W,type:D};if(s(this,C)===-1){s(this,g).length>0&&(s(this,g).length=0),J(this,C,0),s(this,g).push(q);return}if(V&&s(this,g)[s(this,C)].type===D){U&&(q.undo=s(this,g)[s(this,C)].undo),s(this,g)[s(this,C)]=q;return}let $=s(this,C)+1;$===s(this,p)?s(this,g).splice(0,1):(J(this,C,$),$<s(this,g).length&&s(this,g).splice($)),s(this,g).push(q)}undo(){s(this,C)!==-1&&(J(this,f,!0),s(this,g)[s(this,C)].undo(),J(this,f,!1),J(this,C,s(this,C)-1))}redo(){s(this,C)<s(this,g).length-1&&(J(this,C,s(this,C)+1),J(this,f,!0),s(this,g)[s(this,C)].cmd(),J(this,f,!1))}hasSomethingToUndo(){return s(this,C)!==-1}hasSomethingToRedo(){return s(this,C)<s(this,g).length-1}destroy(){J(this,g,null)}}g=new WeakMap,f=new WeakMap,p=new WeakMap,C=new WeakMap,n.CommandManager=u;class d{constructor(R){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:W}=e.FeatureTest.platform;for(let[w,D,V={}]of R)for(let U of w){let q=U.startsWith("mac+");W&&q?(this.callbacks.set(U.slice(4),{callback:D,options:V}),this.allKeys.add(U.split("+").at(-1))):!W&&!q&&(this.callbacks.set(U,{callback:D,options:V}),this.allKeys.add(U.split("+").at(-1)))}}#e(R){R.altKey&&this.buffer.push("alt"),R.ctrlKey&&this.buffer.push("ctrl"),R.metaKey&&this.buffer.push("meta"),R.shiftKey&&this.buffer.push("shift"),this.buffer.push(R.key);let W=this.buffer.join("+");return this.buffer.length=0,W}exec(R,W){if(!this.allKeys.has(W.key))return;let w=this.callbacks.get(this.#e(W));if(!w)return;let{callback:D,options:{bubbles:V=!1,args:U=[],checker:q=null}}=w;q&&!q(R,W)||(D.bind(R,...U)(),V||(W.stopPropagation(),W.preventDefault()))}}n.KeyboardManager=d;let P=class P{get _colors(){let R=new Map([["CanvasText",null],["Canvas",null]]);return(0,t.getColorValues)(R),(0,e.shadow)(this,"_colors",R)}convert(R){let W=(0,t.getRGB)(R);if(!window.matchMedia("(forced-colors: active)").matches)return W;for(let[w,D]of this._colors)if(D.every((V,U)=>V===W[U]))return P._colorsMapping.get(w);return W}getHexCode(R){let W=this._colors.get(R);return W?e.Util.makeHexColor(...W):R}};qe(P,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let v=P;n.ColorManager=v;let T=(()=>{var R,W,w,D,V,U,q,$,x,a,c,E,B,O,Y,Z,X,ie,ne,de,me,xe,Se,ke,Xe,Ee,_e,ue,re,y,l,I,z,Q,K,ll,Rs,Ds,qn,Ns,Bs,si,sn,cl,hl,$s,rn,Vs;let Me=class Me{constructor(te,Pe,Ye,Oe,j,H){ee(this,K);ee(this,R,null);ee(this,W,new Map);ee(this,w,new Map);ee(this,D,null);ee(this,V,null);ee(this,U,new u);ee(this,q,0);ee(this,$,new Set);ee(this,x,null);ee(this,a,null);ee(this,c,new Set);ee(this,E,null);ee(this,B,new m);ee(this,O,!1);ee(this,Y,!1);ee(this,Z,null);ee(this,X,e.AnnotationEditorType.NONE);ee(this,ie,new Set);ee(this,ne,null);ee(this,de,this.blur.bind(this));ee(this,me,this.focus.bind(this));ee(this,xe,this.copy.bind(this));ee(this,Se,this.cut.bind(this));ee(this,ke,this.paste.bind(this));ee(this,Xe,this.keydown.bind(this));ee(this,Ee,this.onEditingAction.bind(this));ee(this,_e,this.onPageChanging.bind(this));ee(this,ue,this.onScaleChanging.bind(this));ee(this,re,this.onRotationChanging.bind(this));ee(this,y,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ee(this,l,[0,0]);ee(this,I,null);ee(this,z,null);ee(this,Q,null);J(this,z,te),J(this,Q,Pe),J(this,D,Ye),this._eventBus=Oe,this._eventBus._on("editingaction",s(this,Ee)),this._eventBus._on("pagechanging",s(this,_e)),this._eventBus._on("scalechanging",s(this,ue)),this._eventBus._on("rotationchanging",s(this,re)),J(this,V,j.annotationStorage),J(this,E,j.filterFactory),J(this,ne,H),this.viewParameters={realScale:t.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){let te=Me.prototype,Pe=j=>{let{activeElement:H}=document;return H&&s(j,z).contains(H)&&j.hasSomethingToControl()},Ye=this.TRANSLATE_SMALL,Oe=this.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new d([[["ctrl+a","mac+meta+a"],te.selectAll],[["ctrl+z","mac+meta+z"],te.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],te.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],te.delete],[["Escape","mac+Escape"],te.unselectAll],[["ArrowLeft","mac+ArrowLeft"],te.translateSelectedEditors,{args:[-Ye,0],checker:Pe}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],te.translateSelectedEditors,{args:[-Oe,0],checker:Pe}],[["ArrowRight","mac+ArrowRight"],te.translateSelectedEditors,{args:[Ye,0],checker:Pe}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],te.translateSelectedEditors,{args:[Oe,0],checker:Pe}],[["ArrowUp","mac+ArrowUp"],te.translateSelectedEditors,{args:[0,-Ye],checker:Pe}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],te.translateSelectedEditors,{args:[0,-Oe],checker:Pe}],[["ArrowDown","mac+ArrowDown"],te.translateSelectedEditors,{args:[0,Ye],checker:Pe}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],te.translateSelectedEditors,{args:[0,Oe],checker:Pe}]]))}destroy(){G(this,K,qn).call(this),G(this,K,Rs).call(this),this._eventBus._off("editingaction",s(this,Ee)),this._eventBus._off("pagechanging",s(this,_e)),this._eventBus._off("scalechanging",s(this,ue)),this._eventBus._off("rotationchanging",s(this,re));for(let te of s(this,w).values())te.destroy();s(this,w).clear(),s(this,W).clear(),s(this,c).clear(),J(this,R,null),s(this,ie).clear(),s(this,U).destroy(),s(this,D).destroy()}get hcmFilter(){return(0,e.shadow)(this,"hcmFilter",s(this,ne)?s(this,E).addHCMFilter(s(this,ne).foreground,s(this,ne).background):"none")}get direction(){return(0,e.shadow)(this,"direction",getComputedStyle(s(this,z)).direction)}editAltText(te){s(this,D)?.editAltText(this,te)}onPageChanging({pageNumber:te}){J(this,q,te-1)}focusMainContainer(){s(this,z).focus()}findParent(te,Pe){for(let Ye of s(this,w).values()){let{x:Oe,y:j,width:H,height:ae}=Ye.div.getBoundingClientRect();if(te>=Oe&&te<=Oe+H&&Pe>=j&&Pe<=j+ae)return Ye}return null}disableUserSelect(te=!1){s(this,Q).classList.toggle("noUserSelect",te)}addShouldRescale(te){s(this,c).add(te)}removeShouldRescale(te){s(this,c).delete(te)}onScaleChanging({scale:te}){this.commitOrRemove(),this.viewParameters.realScale=te*t.PixelsPerInch.PDF_TO_CSS_UNITS;for(let Pe of s(this,c))Pe.onScaleChanging()}onRotationChanging({pagesRotation:te}){this.commitOrRemove(),this.viewParameters.rotation=te}addToAnnotationStorage(te){!te.isEmpty()&&s(this,V)&&!s(this,V).has(te.id)&&s(this,V).setValue(te.id,te)}blur(){if(!this.hasSelection)return;let{activeElement:te}=document;for(let Pe of s(this,ie))if(Pe.div.contains(te)){J(this,Z,[Pe,te]),Pe._focusEventsAllowed=!1;break}}focus(){if(!s(this,Z))return;let[te,Pe]=s(this,Z);J(this,Z,null),Pe.addEventListener("focusin",()=>{te._focusEventsAllowed=!0},{once:!0}),Pe.focus()}addEditListeners(){G(this,K,Ds).call(this),G(this,K,Ns).call(this)}removeEditListeners(){G(this,K,qn).call(this),G(this,K,Bs).call(this)}copy(te){if(te.preventDefault(),s(this,R)?.commitOrRemove(),!this.hasSelection)return;let Pe=[];for(let Ye of s(this,ie)){let Oe=Ye.serialize(!0);Oe&&Pe.push(Oe)}Pe.length!==0&&te.clipboardData.setData("application/pdfjs",JSON.stringify(Pe))}cut(te){this.copy(te),this.delete()}paste(te){te.preventDefault();let{clipboardData:Pe}=te;for(let j of Pe.items)for(let H of s(this,a))if(H.isHandlingMimeForPasting(j.type)){H.paste(j,this.currentLayer);return}let Ye=Pe.getData("application/pdfjs");if(!Ye)return;try{Ye=JSON.parse(Ye)}catch(j){(0,e.warn)(`paste: "${j.message}".`);return}if(!Array.isArray(Ye))return;this.unselectAll();let Oe=this.currentLayer;try{let j=[];for(let fe of Ye){let ye=Oe.deserialize(fe);if(!ye)return;j.push(ye)}let H=()=>{for(let fe of j)G(this,K,$s).call(this,fe);G(this,K,Vs).call(this,j)},ae=()=>{for(let fe of j)fe.remove()};this.addCommands({cmd:H,undo:ae,mustExec:!0})}catch(j){(0,e.warn)(`paste: "${j.message}".`)}}keydown(te){this.getActive()?.shouldGetKeyboardEvents()||Me._keyboardManager.exec(this,te)}onEditingAction(te){["undo","redo","delete","selectAll"].includes(te.name)&&this[te.name]()}setEditingState(te){te?(G(this,K,ll).call(this),G(this,K,Ds).call(this),G(this,K,Ns).call(this),G(this,K,si).call(this,{isEditing:s(this,X)!==e.AnnotationEditorType.NONE,isEmpty:G(this,K,rn).call(this),hasSomethingToUndo:s(this,U).hasSomethingToUndo(),hasSomethingToRedo:s(this,U).hasSomethingToRedo(),hasSelectedEditor:!1})):(G(this,K,Rs).call(this),G(this,K,qn).call(this),G(this,K,Bs).call(this),G(this,K,si).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(te){if(!s(this,a)){J(this,a,te);for(let Pe of s(this,a))G(this,K,sn).call(this,Pe.defaultPropertiesToUpdate)}}getId(){return s(this,B).getId()}get currentLayer(){return s(this,w).get(s(this,q))}getLayer(te){return s(this,w).get(te)}get currentPageIndex(){return s(this,q)}addLayer(te){s(this,w).set(te.pageIndex,te),s(this,O)?te.enable():te.disable()}removeLayer(te){s(this,w).delete(te.pageIndex)}updateMode(te,Pe=null){if(s(this,X)!==te){if(J(this,X,te),te===e.AnnotationEditorType.NONE){this.setEditingState(!1),G(this,K,hl).call(this);return}this.setEditingState(!0),G(this,K,cl).call(this),this.unselectAll();for(let Ye of s(this,w).values())Ye.updateMode(te);if(Pe){for(let Ye of s(this,W).values())if(Ye.annotationElementId===Pe){this.setSelected(Ye),Ye.enterInEditMode();break}}}}updateToolbar(te){te!==s(this,X)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:te})}updateParams(te,Pe){if(s(this,a)){if(te===e.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(te);return}for(let Ye of s(this,ie))Ye.updateParams(te,Pe);for(let Ye of s(this,a))Ye.updateDefaultParams(te,Pe)}}enableWaiting(te=!1){if(s(this,Y)!==te){J(this,Y,te);for(let Pe of s(this,w).values())te?Pe.disableClick():Pe.enableClick(),Pe.div.classList.toggle("waiting",te)}}getEditors(te){let Pe=[];for(let Ye of s(this,W).values())Ye.pageIndex===te&&Pe.push(Ye);return Pe}getEditor(te){return s(this,W).get(te)}addEditor(te){s(this,W).set(te.id,te)}removeEditor(te){s(this,W).delete(te.id),this.unselect(te),(!te.annotationElementId||!s(this,$).has(te.annotationElementId))&&s(this,V)?.remove(te.id)}addDeletedAnnotationElement(te){s(this,$).add(te.annotationElementId),te.deleted=!0}isDeletedAnnotationElement(te){return s(this,$).has(te)}removeDeletedAnnotationElement(te){s(this,$).delete(te.annotationElementId),te.deleted=!1}setActiveEditor(te){s(this,R)!==te&&(J(this,R,te),te&&G(this,K,sn).call(this,te.propertiesToUpdate))}toggleSelected(te){if(s(this,ie).has(te)){s(this,ie).delete(te),te.unselect(),G(this,K,si).call(this,{hasSelectedEditor:this.hasSelection});return}s(this,ie).add(te),te.select(),G(this,K,sn).call(this,te.propertiesToUpdate),G(this,K,si).call(this,{hasSelectedEditor:!0})}setSelected(te){for(let Pe of s(this,ie))Pe!==te&&Pe.unselect();s(this,ie).clear(),s(this,ie).add(te),te.select(),G(this,K,sn).call(this,te.propertiesToUpdate),G(this,K,si).call(this,{hasSelectedEditor:!0})}isSelected(te){return s(this,ie).has(te)}unselect(te){te.unselect(),s(this,ie).delete(te),G(this,K,si).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return s(this,ie).size!==0}undo(){s(this,U).undo(),G(this,K,si).call(this,{hasSomethingToUndo:s(this,U).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:G(this,K,rn).call(this)})}redo(){s(this,U).redo(),G(this,K,si).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:s(this,U).hasSomethingToRedo(),isEmpty:G(this,K,rn).call(this)})}addCommands(te){s(this,U).add(te),G(this,K,si).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:G(this,K,rn).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let te=[...s(this,ie)],Pe=()=>{for(let Oe of te)Oe.remove()},Ye=()=>{for(let Oe of te)G(this,K,$s).call(this,Oe)};this.addCommands({cmd:Pe,undo:Ye,mustExec:!0})}commitOrRemove(){s(this,R)?.commitOrRemove()}hasSomethingToControl(){return s(this,R)||this.hasSelection}selectAll(){for(let te of s(this,ie))te.commit();G(this,K,Vs).call(this,s(this,W).values())}unselectAll(){if(s(this,R)){s(this,R).commitOrRemove();return}if(this.hasSelection){for(let te of s(this,ie))te.unselect();s(this,ie).clear(),G(this,K,si).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(te,Pe,Ye=!1){if(Ye||this.commitOrRemove(),!this.hasSelection)return;s(this,l)[0]+=te,s(this,l)[1]+=Pe;let[Oe,j]=s(this,l),H=[...s(this,ie)],ae=1e3;s(this,I)&&clearTimeout(s(this,I)),J(this,I,setTimeout(()=>{J(this,I,null),s(this,l)[0]=s(this,l)[1]=0,this.addCommands({cmd:()=>{for(let fe of H)s(this,W).has(fe.id)&&fe.translateInPage(Oe,j)},undo:()=>{for(let fe of H)s(this,W).has(fe.id)&&fe.translateInPage(-Oe,-j)},mustExec:!1})},ae));for(let fe of H)fe.translateInPage(te,Pe)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),J(this,x,new Map);for(let te of s(this,ie))s(this,x).set(te,{savedX:te.x,savedY:te.y,savedPageIndex:te.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!s(this,x))return!1;this.disableUserSelect(!1);let te=s(this,x);J(this,x,null);let Pe=!1;for(let[{x:Oe,y:j,pageIndex:H},ae]of te)ae.newX=Oe,ae.newY=j,ae.newPageIndex=H,Pe||=Oe!==ae.savedX||j!==ae.savedY||H!==ae.savedPageIndex;if(!Pe)return!1;let Ye=(Oe,j,H,ae)=>{if(s(this,W).has(Oe.id)){let fe=s(this,w).get(ae);fe?Oe._setParentAndPosition(fe,j,H):(Oe.pageIndex=ae,Oe.x=j,Oe.y=H)}};return this.addCommands({cmd:()=>{for(let[Oe,{newX:j,newY:H,newPageIndex:ae}]of te)Ye(Oe,j,H,ae)},undo:()=>{for(let[Oe,{savedX:j,savedY:H,savedPageIndex:ae}]of te)Ye(Oe,j,H,ae)},mustExec:!0}),!0}dragSelectedEditors(te,Pe){if(s(this,x))for(let Ye of s(this,x).keys())Ye.drag(te,Pe)}rebuild(te){if(te.parent===null){let Pe=this.getLayer(te.pageIndex);Pe?(Pe.changeParent(te),Pe.addOrRebuild(te)):(this.addEditor(te),this.addToAnnotationStorage(te),te.rebuild())}else te.parent.addOrRebuild(te)}isActive(te){return s(this,R)===te}getActive(){return s(this,R)}getMode(){return s(this,X)}get imageManager(){return(0,e.shadow)(this,"imageManager",new o)}};R=new WeakMap,W=new WeakMap,w=new WeakMap,D=new WeakMap,V=new WeakMap,U=new WeakMap,q=new WeakMap,$=new WeakMap,x=new WeakMap,a=new WeakMap,c=new WeakMap,E=new WeakMap,B=new WeakMap,O=new WeakMap,Y=new WeakMap,Z=new WeakMap,X=new WeakMap,ie=new WeakMap,ne=new WeakMap,de=new WeakMap,me=new WeakMap,xe=new WeakMap,Se=new WeakMap,ke=new WeakMap,Xe=new WeakMap,Ee=new WeakMap,_e=new WeakMap,ue=new WeakMap,re=new WeakMap,y=new WeakMap,l=new WeakMap,I=new WeakMap,z=new WeakMap,Q=new WeakMap,K=new WeakSet,ll=function(){window.addEventListener("focus",s(this,me)),window.addEventListener("blur",s(this,de))},Rs=function(){window.removeEventListener("focus",s(this,me)),window.removeEventListener("blur",s(this,de))},Ds=function(){window.addEventListener("keydown",s(this,Xe),{capture:!0})},qn=function(){window.removeEventListener("keydown",s(this,Xe),{capture:!0})},Ns=function(){document.addEventListener("copy",s(this,xe)),document.addEventListener("cut",s(this,Se)),document.addEventListener("paste",s(this,ke))},Bs=function(){document.removeEventListener("copy",s(this,xe)),document.removeEventListener("cut",s(this,Se)),document.removeEventListener("paste",s(this,ke))},si=function(te){Object.entries(te).some(([Ye,Oe])=>s(this,y)[Ye]!==Oe)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(s(this,y),te)})},sn=function(te){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:te})},cl=function(){if(!s(this,O)){J(this,O,!0);for(let te of s(this,w).values())te.enable()}},hl=function(){if(this.unselectAll(),s(this,O)){J(this,O,!1);for(let te of s(this,w).values())te.disable()}},$s=function(te){let Pe=s(this,w).get(te.pageIndex);Pe?Pe.addOrRebuild(te):this.addEditor(te)},rn=function(){if(s(this,W).size===0)return!0;if(s(this,W).size===1)for(let te of s(this,W).values())return te.isEmpty();return!1},Vs=function(te){s(this,ie).clear();for(let Pe of te)Pe.isEmpty()||(s(this,ie).add(Pe),Pe.select());G(this,K,si).call(this,{hasSelectedEditor:!0})},qe(Me,"TRANSLATE_SMALL",1),qe(Me,"TRANSLATE_BIG",10);let k=Me;return k})();n.AnnotationEditorUIManager=T},(h,n,_)=>{var $,x,a,c,E,B,O,Y,Z,X,ie,ne,Hi,Gi,zs,Kn,Yn,on,an;Object.defineProperty(n,"__esModule",{value:!0}),n.StatTimer=n.RenderingCancelledException=n.PixelsPerInch=n.PageViewport=n.PDFDateString=n.DOMStandardFontDataFactory=n.DOMSVGFactory=n.DOMFilterFactory=n.DOMCanvasFactory=n.DOMCMapReaderFactory=void 0,n.deprecated=C,n.getColorValues=w,n.getCurrentTransform=D,n.getCurrentTransformInverse=V,n.getFilenameFromUrl=b,n.getPdfFilenameFromUrl=N,n.getRGB=W,n.getXfaPageViewport=R,n.isDataScheme=F,n.isPdfFile=S,n.isValidFetchUrl=g,n.loadScript=p,n.noContextMenu=f,n.setLayerDimensions=U;var e=_(7),t=_(1);let i="http://www.w3.org/2000/svg",q=class q{};qe(q,"CSS",96),qe(q,"PDF",72),qe(q,"PDF_TO_CSS_UNITS",q.CSS/q.PDF);let r=q;n.PixelsPerInch=r;class m extends e.BaseFilterFactory{constructor({docId:re,ownerDocument:y=globalThis.document}={}){super();ee(this,ne);ee(this,$);ee(this,x);ee(this,a);ee(this,c);ee(this,E);ee(this,B);ee(this,O);ee(this,Y);ee(this,Z);ee(this,X);ee(this,ie,0);J(this,a,re),J(this,c,y)}addFilter(re){if(!re)return"none";let y=s(this,ne,Hi).get(re);if(y)return y;let l,I,z,Q;if(re.length===1){let oe=re[0],we=new Array(256);for(let Ie=0;Ie<256;Ie++)we[Ie]=oe[Ie]/255;Q=l=I=z=we.join(",")}else{let[oe,we,Ie]=re,Qe=new Array(256),ze=new Array(256),We=new Array(256);for(let rt=0;rt<256;rt++)Qe[rt]=oe[rt]/255,ze[rt]=we[rt]/255,We[rt]=Ie[rt]/255;l=Qe.join(","),I=ze.join(","),z=We.join(","),Q=`${l}${I}${z}`}if(y=s(this,ne,Hi).get(Q),y)return s(this,ne,Hi).set(re,y),y;let K=`g_${s(this,a)}_transfer_map_${Pi(this,ie)._++}`,le=`url(#${K})`;s(this,ne,Hi).set(re,le),s(this,ne,Hi).set(Q,le);let se=G(this,ne,Kn).call(this,K);return G(this,ne,on).call(this,l,I,z,se),le}addHCMFilter(re,y){let l=`${re}-${y}`;if(s(this,B)===l)return s(this,O);if(J(this,B,l),J(this,O,"none"),s(this,E)?.remove(),!re||!y)return s(this,O);let I=G(this,ne,an).call(this,re);re=t.Util.makeHexColor(...I);let z=G(this,ne,an).call(this,y);if(y=t.Util.makeHexColor(...z),s(this,ne,Gi).style.color="",re==="#000000"&&y==="#ffffff"||re===y)return s(this,O);let Q=new Array(256);for(let we=0;we<=255;we++){let Ie=we/255;Q[we]=Ie<=.03928?Ie/12.92:((Ie+.055)/1.055)**2.4}let K=Q.join(","),le=`g_${s(this,a)}_hcm_filter`,se=J(this,Y,G(this,ne,Kn).call(this,le));G(this,ne,on).call(this,K,K,K,se),G(this,ne,zs).call(this,se);let oe=(we,Ie)=>{let Qe=I[we]/255,ze=z[we]/255,We=new Array(Ie+1);for(let rt=0;rt<=Ie;rt++)We[rt]=Qe+rt/Ie*(ze-Qe);return We.join(",")};return G(this,ne,on).call(this,oe(0,5),oe(1,5),oe(2,5),se),J(this,O,`url(#${le})`),s(this,O)}addHighlightHCMFilter(re,y,l,I){let z=`${re}-${y}-${l}-${I}`;if(s(this,Z)===z)return s(this,X);if(J(this,Z,z),J(this,X,"none"),s(this,Y)?.remove(),!re||!y)return s(this,X);let[Q,K]=[re,y].map(G(this,ne,an).bind(this)),le=Math.round(.2126*Q[0]+.7152*Q[1]+.0722*Q[2]),se=Math.round(.2126*K[0]+.7152*K[1]+.0722*K[2]),[oe,we]=[l,I].map(G(this,ne,an).bind(this));se<le&&([le,se,oe,we]=[se,le,we,oe]),s(this,ne,Gi).style.color="";let Ie=(We,rt,at)=>{let be=new Array(256),he=(se-le)/at,ce=We/255,Me=(rt-We)/(255*at),et=0;for(let te=0;te<=at;te++){let Pe=Math.round(le+te*he),Ye=ce+te*Me;for(let Oe=et;Oe<=Pe;Oe++)be[Oe]=Ye;et=Pe+1}for(let te=et;te<256;te++)be[te]=be[et-1];return be.join(",")},Qe=`g_${s(this,a)}_hcm_highlight_filter`,ze=J(this,Y,G(this,ne,Kn).call(this,Qe));return G(this,ne,zs).call(this,ze),G(this,ne,on).call(this,Ie(oe[0],we[0],5),Ie(oe[1],we[1],5),Ie(oe[2],we[2],5),ze),J(this,X,`url(#${Qe})`),s(this,X)}destroy(re=!1){re&&(s(this,O)||s(this,X))||(s(this,x)&&(s(this,x).parentNode.parentNode.remove(),J(this,x,null)),s(this,$)&&(s(this,$).clear(),J(this,$,null)),J(this,ie,0))}}$=new WeakMap,x=new WeakMap,a=new WeakMap,c=new WeakMap,E=new WeakMap,B=new WeakMap,O=new WeakMap,Y=new WeakMap,Z=new WeakMap,X=new WeakMap,ie=new WeakMap,ne=new WeakSet,Hi=function(){return s(this,$)||J(this,$,new Map)},Gi=function(){if(!s(this,x)){let re=s(this,c).createElement("div"),{style:y}=re;y.visibility="hidden",y.contain="strict",y.width=y.height=0,y.position="absolute",y.top=y.left=0,y.zIndex=-1;let l=s(this,c).createElementNS(i,"svg");l.setAttribute("width",0),l.setAttribute("height",0),J(this,x,s(this,c).createElementNS(i,"defs")),re.append(l),l.append(s(this,x)),s(this,c).body.append(re)}return s(this,x)},zs=function(re){let y=s(this,c).createElementNS(i,"feColorMatrix");y.setAttribute("type","matrix"),y.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"),re.append(y)},Kn=function(re){let y=s(this,c).createElementNS(i,"filter");return y.setAttribute("color-interpolation-filters","sRGB"),y.setAttribute("id",re),s(this,ne,Gi).append(y),y},Yn=function(re,y,l){let I=s(this,c).createElementNS(i,y);I.setAttribute("type","discrete"),I.setAttribute("tableValues",l),re.append(I)},on=function(re,y,l,I){let z=s(this,c).createElementNS(i,"feComponentTransfer");I.append(z),G(this,ne,Yn).call(this,z,"feFuncR",re),G(this,ne,Yn).call(this,z,"feFuncG",y),G(this,ne,Yn).call(this,z,"feFuncB",l)},an=function(re){return s(this,ne,Gi).style.color=re,W(getComputedStyle(s(this,ne,Gi)).getPropertyValue("color"))},n.DOMFilterFactory=m;class o extends e.BaseCanvasFactory{constructor({ownerDocument:ue=globalThis.document}={}){super(),this._document=ue}_createCanvas(ue,re){let y=this._document.createElement("canvas");return y.width=ue,y.height=re,y}}n.DOMCanvasFactory=o;function u(_e,ue=!1){return Ue(this,null,function*(){if(g(_e,document.baseURI)){let re=yield fetch(_e);if(!re.ok)throw new Error(re.statusText);return ue?new Uint8Array(yield re.arrayBuffer()):(0,t.stringToBytes)(yield re.text())}return new Promise((re,y)=>{let l=new XMLHttpRequest;l.open("GET",_e,!0),ue&&(l.responseType="arraybuffer"),l.onreadystatechange=()=>{if(l.readyState===XMLHttpRequest.DONE){if(l.status===200||l.status===0){let I;if(ue&&l.response?I=new Uint8Array(l.response):!ue&&l.responseText&&(I=(0,t.stringToBytes)(l.responseText)),I){re(I);return}}y(new Error(l.statusText))}},l.send(null)})})}class d extends e.BaseCMapReaderFactory{_fetchData(ue,re){return u(ue,this.isCompressed).then(y=>({cMapData:y,compressionType:re}))}}n.DOMCMapReaderFactory=d;class v extends e.BaseStandardFontDataFactory{_fetchData(ue){return u(ue,!0)}}n.DOMStandardFontDataFactory=v;class T extends e.BaseSVGFactory{_createSVG(ue){return document.createElementNS(i,ue)}}n.DOMSVGFactory=T;class A{constructor({viewBox:ue,scale:re,rotation:y,offsetX:l=0,offsetY:I=0,dontFlip:z=!1}){this.viewBox=ue,this.scale=re,this.rotation=y,this.offsetX=l,this.offsetY=I;let Q=(ue[2]+ue[0])/2,K=(ue[3]+ue[1])/2,le,se,oe,we;switch(y%=360,y<0&&(y+=360),y){case 180:le=-1,se=0,oe=0,we=1;break;case 90:le=0,se=1,oe=1,we=0;break;case 270:le=0,se=-1,oe=-1,we=0;break;case 0:le=1,se=0,oe=0,we=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}z&&(oe=-oe,we=-we);let Ie,Qe,ze,We;le===0?(Ie=Math.abs(K-ue[1])*re+l,Qe=Math.abs(Q-ue[0])*re+I,ze=(ue[3]-ue[1])*re,We=(ue[2]-ue[0])*re):(Ie=Math.abs(Q-ue[0])*re+l,Qe=Math.abs(K-ue[1])*re+I,ze=(ue[2]-ue[0])*re,We=(ue[3]-ue[1])*re),this.transform=[le*re,se*re,oe*re,we*re,Ie-le*re*Q-oe*re*K,Qe-se*re*Q-we*re*K],this.width=ze,this.height=We}get rawDims(){let{viewBox:ue}=this;return(0,t.shadow)(this,"rawDims",{pageWidth:ue[2]-ue[0],pageHeight:ue[3]-ue[1],pageX:ue[0],pageY:ue[1]})}clone({scale:ue=this.scale,rotation:re=this.rotation,offsetX:y=this.offsetX,offsetY:l=this.offsetY,dontFlip:I=!1}={}){return new A({viewBox:this.viewBox.slice(),scale:ue,rotation:re,offsetX:y,offsetY:l,dontFlip:I})}convertToViewportPoint(ue,re){return t.Util.applyTransform([ue,re],this.transform)}convertToViewportRectangle(ue){let re=t.Util.applyTransform([ue[0],ue[1]],this.transform),y=t.Util.applyTransform([ue[2],ue[3]],this.transform);return[re[0],re[1],y[0],y[1]]}convertToPdfPoint(ue,re){return t.Util.applyInverseTransform([ue,re],this.transform)}}n.PageViewport=A;class M extends t.BaseException{constructor(ue,re=0){super(ue,"RenderingCancelledException"),this.extraDelay=re}}n.RenderingCancelledException=M;function F(_e){let ue=_e.length,re=0;for(;re<ue&&_e[re].trim()==="";)re++;return _e.substring(re,re+5).toLowerCase()==="data:"}function S(_e){return typeof _e=="string"&&/\.pdf$/i.test(_e)}function b(_e,ue=!1){return ue||([_e]=_e.split(/[#?]/,1)),_e.substring(_e.lastIndexOf("/")+1)}function N(_e,ue="document.pdf"){if(typeof _e!="string")return ue;if(F(_e))return(0,t.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),ue;let re=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,y=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,l=re.exec(_e),I=y.exec(l[1])||y.exec(l[2])||y.exec(l[3]);if(I&&(I=I[0],I.includes("%")))try{I=y.exec(decodeURIComponent(I))[0]}catch{}return I||ue}class L{constructor(){qe(this,"started",Object.create(null));qe(this,"times",[])}time(ue){ue in this.started&&(0,t.warn)(`Timer is already running for ${ue}`),this.started[ue]=Date.now()}timeEnd(ue){ue in this.started||(0,t.warn)(`Timer has not been started for ${ue}`),this.times.push({name:ue,start:this.started[ue],end:Date.now()}),delete this.started[ue]}toString(){let ue=[],re=0;for(let{name:y}of this.times)re=Math.max(y.length,re);for(let{name:y,start:l,end:I}of this.times)ue.push(`${y.padEnd(re)} ${I-l}ms
`);return ue.join("")}}n.StatTimer=L;function g(_e,ue){try{let{protocol:re}=ue?new URL(_e,ue):new URL(_e);return re==="http:"||re==="https:"}catch{return!1}}function f(_e){_e.preventDefault()}function p(_e,ue=!1){return new Promise((re,y)=>{let l=document.createElement("script");l.src=_e,l.onload=function(I){ue&&l.remove(),re(I)},l.onerror=function(){y(new Error(`Cannot load script at: ${l.src}`))},(document.head||document.documentElement).append(l)})}function C(_e){console.log("Deprecated API usage: "+_e)}let P;class k{static toDateObject(ue){if(!ue||typeof ue!="string")return null;P||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let re=P.exec(ue);if(!re)return null;let y=parseInt(re[1],10),l=parseInt(re[2],10);l=l>=1&&l<=12?l-1:0;let I=parseInt(re[3],10);I=I>=1&&I<=31?I:1;let z=parseInt(re[4],10);z=z>=0&&z<=23?z:0;let Q=parseInt(re[5],10);Q=Q>=0&&Q<=59?Q:0;let K=parseInt(re[6],10);K=K>=0&&K<=59?K:0;let le=re[7]||"Z",se=parseInt(re[8],10);se=se>=0&&se<=23?se:0;let oe=parseInt(re[9],10)||0;return oe=oe>=0&&oe<=59?oe:0,le==="-"?(z+=se,Q+=oe):le==="+"&&(z-=se,Q-=oe),new Date(Date.UTC(y,l,I,z,Q,K))}}n.PDFDateString=k;function R(_e,{scale:ue=1,rotation:re=0}){let{width:y,height:l}=_e.attributes.style,I=[0,0,parseInt(y),parseInt(l)];return new A({viewBox:I,scale:ue,rotation:re})}function W(_e){if(_e.startsWith("#")){let ue=parseInt(_e.slice(1),16);return[(ue&16711680)>>16,(ue&65280)>>8,ue&255]}return _e.startsWith("rgb(")?_e.slice(4,-1).split(",").map(ue=>parseInt(ue)):_e.startsWith("rgba(")?_e.slice(5,-1).split(",").map(ue=>parseInt(ue)).slice(0,3):((0,t.warn)(`Not a valid color format: "${_e}"`),[0,0,0])}function w(_e){let ue=document.createElement("span");ue.style.visibility="hidden",document.body.append(ue);for(let re of _e.keys()){ue.style.color=re;let y=window.getComputedStyle(ue).color;_e.set(re,W(y))}ue.remove()}function D(_e){let{a:ue,b:re,c:y,d:l,e:I,f:z}=_e.getTransform();return[ue,re,y,l,I,z]}function V(_e){let{a:ue,b:re,c:y,d:l,e:I,f:z}=_e.getTransform().invertSelf();return[ue,re,y,l,I,z]}function U(_e,ue,re=!1,y=!0){if(ue instanceof A){let{pageWidth:l,pageHeight:I}=ue.rawDims,{style:z}=_e,Q=t.FeatureTest.isCSSRoundSupported,K=`var(--scale-factor) * ${l}px`,le=`var(--scale-factor) * ${I}px`,se=Q?`round(${K}, 1px)`:`calc(${K})`,oe=Q?`round(${le}, 1px)`:`calc(${le})`;!re||ue.rotation%180===0?(z.width=se,z.height=oe):(z.width=oe,z.height=se)}y&&_e.setAttribute("data-main-rotation",ue.rotation)}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseStandardFontDataFactory=n.BaseSVGFactory=n.BaseFilterFactory=n.BaseCanvasFactory=n.BaseCMapReaderFactory=void 0;var e=_(1);class t{constructor(){this.constructor===t&&(0,e.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(d){return"none"}addHCMFilter(d,v){return"none"}addHighlightHCMFilter(d,v,T,A){return"none"}destroy(d=!1){}}n.BaseFilterFactory=t;class i{constructor(){this.constructor===i&&(0,e.unreachable)("Cannot initialize BaseCanvasFactory.")}create(d,v){if(d<=0||v<=0)throw new Error("Invalid canvas size");let T=this._createCanvas(d,v);return{canvas:T,context:T.getContext("2d")}}reset(d,v,T){if(!d.canvas)throw new Error("Canvas is not specified");if(v<=0||T<=0)throw new Error("Invalid canvas size");d.canvas.width=v,d.canvas.height=T}destroy(d){if(!d.canvas)throw new Error("Canvas is not specified");d.canvas.width=0,d.canvas.height=0,d.canvas=null,d.context=null}_createCanvas(d,v){(0,e.unreachable)("Abstract method `_createCanvas` called.")}}n.BaseCanvasFactory=i;class r{constructor({baseUrl:d=null,isCompressed:v=!0}){this.constructor===r&&(0,e.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=d,this.isCompressed=v}fetch(v){return Ue(this,arguments,function*({name:d}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!d)throw new Error("CMap name must be specified.");let T=this.baseUrl+d+(this.isCompressed?".bcmap":""),A=this.isCompressed?e.CMapCompressionType.BINARY:e.CMapCompressionType.NONE;return this._fetchData(T,A).catch(M=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${T}`)})})}_fetchData(d,v){(0,e.unreachable)("Abstract method `_fetchData` called.")}}n.BaseCMapReaderFactory=r;class m{constructor({baseUrl:d=null}){this.constructor===m&&(0,e.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=d}fetch(v){return Ue(this,arguments,function*({filename:d}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!d)throw new Error("Font filename must be specified.");let T=`${this.baseUrl}${d}`;return this._fetchData(T).catch(A=>{throw new Error(`Unable to load font data at: ${T}`)})})}_fetchData(d){(0,e.unreachable)("Abstract method `_fetchData` called.")}}n.BaseStandardFontDataFactory=m;class o{constructor(){this.constructor===o&&(0,e.unreachable)("Cannot initialize BaseSVGFactory.")}create(d,v,T=!1){if(d<=0||v<=0)throw new Error("Invalid SVG dimensions");let A=this._createSVG("svg:svg");return A.setAttribute("version","1.1"),T||(A.setAttribute("width",`${d}px`),A.setAttribute("height",`${v}px`)),A.setAttribute("preserveAspectRatio","none"),A.setAttribute("viewBox",`0 0 ${d} ${v}`),A}createElement(d){if(typeof d!="string")throw new Error("Invalid SVG element type");return this._createSVG(d)}_createSVG(d){(0,e.unreachable)("Abstract method `_createSVG` called.")}}n.BaseSVGFactory=o},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.MurmurHash3_64=void 0;var e=_(1);let t=3285377520,i=4294901760,r=65535;class m{constructor(u){this.h1=u?u&4294967295:t,this.h2=u?u&4294967295:t}update(u){let d,v;if(typeof u=="string"){d=new Uint8Array(u.length*2),v=0;for(let C=0,P=u.length;C<P;C++){let k=u.charCodeAt(C);k<=255?d[v++]=k:(d[v++]=k>>>8,d[v++]=k&255)}}else if((0,e.isArrayBuffer)(u))d=u.slice(),v=d.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");let T=v>>2,A=v-T*4,M=new Uint32Array(d.buffer,0,T),F=0,S=0,b=this.h1,N=this.h2,L=3432918353,g=461845907,f=L&r,p=g&r;for(let C=0;C<T;C++)C&1?(F=M[C],F=F*L&i|F*f&r,F=F<<15|F>>>17,F=F*g&i|F*p&r,b^=F,b=b<<13|b>>>19,b=b*5+3864292196):(S=M[C],S=S*L&i|S*f&r,S=S<<15|S>>>17,S=S*g&i|S*p&r,N^=S,N=N<<13|N>>>19,N=N*5+3864292196);switch(F=0,A){case 3:F^=d[T*4+2]<<16;case 2:F^=d[T*4+1]<<8;case 1:F^=d[T*4],F=F*L&i|F*f&r,F=F<<15|F>>>17,F=F*g&i|F*p&r,T&1?b^=F:N^=F}this.h1=b,this.h2=N}hexdigest(){let u=this.h1,d=this.h2;return u^=d>>>1,u=u*3981806797&i|u*36045&r,d=d*4283543511&i|((d<<16|u>>>16)*2950163797&i)>>>16,u^=d>>>1,u=u*444984403&i|u*60499&r,d=d*3301882366&i|((d<<16|u>>>16)*3120437893&i)>>>16,u^=d>>>1,(u>>>0).toString(16).padStart(8,"0")+(d>>>0).toString(16).padStart(8,"0")}}n.MurmurHash3_64=m},(h,n,_)=>{var r;Object.defineProperty(n,"__esModule",{value:!0}),n.FontLoader=n.FontFaceObject=void 0;var e=_(1);class t{constructor({ownerDocument:o=globalThis.document,styleElement:u=null}){ee(this,r,new Set);this._document=o,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(o){this.nativeFontFaces.add(o),this._document.fonts.add(o)}removeNativeFontFace(o){this.nativeFontFaces.delete(o),this._document.fonts.delete(o)}insertRule(o){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let u=this.styleElement.sheet;u.insertRule(o,u.cssRules.length)}clear(){for(let o of this.nativeFontFaces)this._document.fonts.delete(o);this.nativeFontFaces.clear(),s(this,r).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}loadSystemFont(o){return Ue(this,null,function*(){if(!(!o||s(this,r).has(o.loadedName))){if((0,e.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:u,src:d,style:v}=o,T=new FontFace(u,d,v);this.addNativeFontFace(T);try{yield T.load(),s(this,r).add(u)}catch{(0,e.warn)(`Cannot load system font: ${o.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(T)}return}(0,e.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}})}bind(o){return Ue(this,null,function*(){if(o.attached||o.missingFile&&!o.systemFontInfo)return;if(o.attached=!0,o.systemFontInfo){yield this.loadSystemFont(o.systemFontInfo);return}if(this.isFontLoadingAPISupported){let d=o.createNativeFontFace();if(d){this.addNativeFontFace(d);try{yield d.loaded}catch(v){throw(0,e.warn)(`Failed to load font '${d.family}': '${v}'.`),o.disableFontFace=!0,v}}return}let u=o.createFontFaceRule();if(u){if(this.insertRule(u),this.isSyncFontLoadingSupported)return;yield new Promise(d=>{let v=this._queueLoadingCallback(d);this._prepareFontLoadEvent(o,v)})}})}get isFontLoadingAPISupported(){let o=!!this._document?.fonts;return(0,e.shadow)(this,"isFontLoadingAPISupported",o)}get isSyncFontLoadingSupported(){let o=!1;return(e.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(o=!0),(0,e.shadow)(this,"isSyncFontLoadingSupported",o)}_queueLoadingCallback(o){function u(){for((0,e.assert)(!v.done,"completeRequest() cannot be called twice."),v.done=!0;d.length>0&&d[0].done;){let T=d.shift();setTimeout(T.callback,0)}}let{loadingRequests:d}=this,v={done:!1,complete:u,callback:o};return d.push(v),v}get _loadTestFont(){let o=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,e.shadow)(this,"_loadTestFont",o)}_prepareFontLoadEvent(o,u){function d(W,w){return W.charCodeAt(w)<<24|W.charCodeAt(w+1)<<16|W.charCodeAt(w+2)<<8|W.charCodeAt(w+3)&255}function v(W,w,D,V){let U=W.substring(0,w),q=W.substring(w+D);return U+V+q}let T,A,M=this._document.createElement("canvas");M.width=1,M.height=1;let F=M.getContext("2d"),S=0;function b(W,w){if(++S>30){(0,e.warn)("Load test font never loaded."),w();return}if(F.font="30px "+W,F.fillText(".",0,20),F.getImageData(0,0,1,1).data[3]>0){w();return}setTimeout(b.bind(null,W,w))}let N=`lt${Date.now()}${this.loadTestFontId++}`,L=this._loadTestFont;L=v(L,976,N.length,N);let f=16,p=1482184792,C=d(L,f);for(T=0,A=N.length-3;T<A;T+=4)C=C-p+d(N,T)|0;T<N.length&&(C=C-p+d(N+"XXX",T)|0),L=v(L,f,4,(0,e.string32)(C));let P=`url(data:font/opentype;base64,${btoa(L)});`,k=`@font-face {font-family:"${N}";src:${P}}`;this.insertRule(k);let R=this._document.createElement("div");R.style.visibility="hidden",R.style.width=R.style.height="10px",R.style.position="absolute",R.style.top=R.style.left="0px";for(let W of[o.loadedName,N]){let w=this._document.createElement("span");w.textContent="Hi",w.style.fontFamily=W,R.append(w)}this._document.body.append(R),b(N,()=>{R.remove(),u.complete()})}}r=new WeakMap,n.FontLoader=t;class i{constructor(o,{isEvalSupported:u=!0,disableFontFace:d=!1,ignoreErrors:v=!1,inspectFont:T=null}){this.compiledGlyphs=Object.create(null);for(let A in o)this[A]=o[A];this.isEvalSupported=u!==!1,this.disableFontFace=d===!0,this.ignoreErrors=v===!0,this._inspectFont=T}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let o;if(!this.cssFontInfo)o=new FontFace(this.loadedName,this.data,{});else{let u={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(u.style=`oblique ${this.cssFontInfo.italicAngle}deg`),o=new FontFace(this.cssFontInfo.fontFamily,this.data,u)}return this._inspectFont?.(this),o}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let o=(0,e.bytesToString)(this.data),u=`url(data:${this.mimetype};base64,${btoa(o)});`,d;if(!this.cssFontInfo)d=`@font-face {font-family:"${this.loadedName}";src:${u}}`;else{let v=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(v+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),d=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${v}src:${u}}`}return this._inspectFont?.(this,u),d}getPathGenerator(o,u){if(this.compiledGlyphs[u]!==void 0)return this.compiledGlyphs[u];let d;try{d=o.get(this.loadedName+"_path_"+u)}catch(v){if(!this.ignoreErrors)throw v;return(0,e.warn)(`getPathGenerator - ignoring character: "${v}".`),this.compiledGlyphs[u]=function(T,A){}}if(this.isEvalSupported&&e.FeatureTest.isEvalSupported){let v=[];for(let T of d){let A=T.args!==void 0?T.args.join(","):"";v.push("c.",T.cmd,"(",A,`);
`)}return this.compiledGlyphs[u]=new Function("c","size",v.join(""))}return this.compiledGlyphs[u]=function(v,T){for(let A of d)A.cmd==="scale"&&(A.args=[T,-T]),v[A.cmd].apply(v,A.args)}}}n.FontFaceObject=i},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.NodeStandardFontDataFactory=n.NodeFilterFactory=n.NodeCanvasFactory=n.NodeCMapReaderFactory=void 0;var e=_(7),t=_(1);let i=function(d){return new Promise((v,T)=>{Hn().readFile(d,(M,F)=>{if(M||!F){T(new Error(M));return}v(new Uint8Array(F))})})};class r extends e.BaseFilterFactory{}n.NodeFilterFactory=r;class m extends e.BaseCanvasFactory{_createCanvas(v,T){return el().createCanvas(v,T)}}n.NodeCanvasFactory=m;class o extends e.BaseCMapReaderFactory{_fetchData(v,T){return i(v).then(A=>({cMapData:A,compressionType:T}))}}n.NodeCMapReaderFactory=o;class u extends e.BaseStandardFontDataFactory{_fetchData(v){return i(v)}}n.NodeStandardFontDataFactory=u},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasGraphics=void 0;var e=_(1),t=_(6),i=_(12),r=_(13);let m=16,o=100,u=4096,d=15,v=10,T=1e3,A=16;function M(x,a){if(x._removeMirroring)throw new Error("Context is already forwarding operations.");x.__originalSave=x.save,x.__originalRestore=x.restore,x.__originalRotate=x.rotate,x.__originalScale=x.scale,x.__originalTranslate=x.translate,x.__originalTransform=x.transform,x.__originalSetTransform=x.setTransform,x.__originalResetTransform=x.resetTransform,x.__originalClip=x.clip,x.__originalMoveTo=x.moveTo,x.__originalLineTo=x.lineTo,x.__originalBezierCurveTo=x.bezierCurveTo,x.__originalRect=x.rect,x.__originalClosePath=x.closePath,x.__originalBeginPath=x.beginPath,x._removeMirroring=()=>{x.save=x.__originalSave,x.restore=x.__originalRestore,x.rotate=x.__originalRotate,x.scale=x.__originalScale,x.translate=x.__originalTranslate,x.transform=x.__originalTransform,x.setTransform=x.__originalSetTransform,x.resetTransform=x.__originalResetTransform,x.clip=x.__originalClip,x.moveTo=x.__originalMoveTo,x.lineTo=x.__originalLineTo,x.bezierCurveTo=x.__originalBezierCurveTo,x.rect=x.__originalRect,x.closePath=x.__originalClosePath,x.beginPath=x.__originalBeginPath,delete x._removeMirroring},x.save=function(){a.save(),this.__originalSave()},x.restore=function(){a.restore(),this.__originalRestore()},x.translate=function(E,B){a.translate(E,B),this.__originalTranslate(E,B)},x.scale=function(E,B){a.scale(E,B),this.__originalScale(E,B)},x.transform=function(E,B,O,Y,Z,X){a.transform(E,B,O,Y,Z,X),this.__originalTransform(E,B,O,Y,Z,X)},x.setTransform=function(E,B,O,Y,Z,X){a.setTransform(E,B,O,Y,Z,X),this.__originalSetTransform(E,B,O,Y,Z,X)},x.resetTransform=function(){a.resetTransform(),this.__originalResetTransform()},x.rotate=function(E){a.rotate(E),this.__originalRotate(E)},x.clip=function(E){a.clip(E),this.__originalClip(E)},x.moveTo=function(c,E){a.moveTo(c,E),this.__originalMoveTo(c,E)},x.lineTo=function(c,E){a.lineTo(c,E),this.__originalLineTo(c,E)},x.bezierCurveTo=function(c,E,B,O,Y,Z){a.bezierCurveTo(c,E,B,O,Y,Z),this.__originalBezierCurveTo(c,E,B,O,Y,Z)},x.rect=function(c,E,B,O){a.rect(c,E,B,O),this.__originalRect(c,E,B,O)},x.closePath=function(){a.closePath(),this.__originalClosePath()},x.beginPath=function(){a.beginPath(),this.__originalBeginPath()}}class F{constructor(a){this.canvasFactory=a,this.cache=Object.create(null)}getCanvas(a,c,E){let B;return this.cache[a]!==void 0?(B=this.cache[a],this.canvasFactory.reset(B,c,E)):(B=this.canvasFactory.create(c,E),this.cache[a]=B),B}delete(a){delete this.cache[a]}clear(){for(let a in this.cache){let c=this.cache[a];this.canvasFactory.destroy(c),delete this.cache[a]}}}function S(x,a,c,E,B,O,Y,Z,X,ie){let[ne,de,me,xe,Se,ke]=(0,t.getCurrentTransform)(x);if(de===0&&me===0){let _e=Y*ne+Se,ue=Math.round(_e),re=Z*xe+ke,y=Math.round(re),l=(Y+X)*ne+Se,I=Math.abs(Math.round(l)-ue)||1,z=(Z+ie)*xe+ke,Q=Math.abs(Math.round(z)-y)||1;return x.setTransform(Math.sign(ne),0,0,Math.sign(xe),ue,y),x.drawImage(a,c,E,B,O,0,0,I,Q),x.setTransform(ne,de,me,xe,Se,ke),[I,Q]}if(ne===0&&xe===0){let _e=Z*me+Se,ue=Math.round(_e),re=Y*de+ke,y=Math.round(re),l=(Z+ie)*me+Se,I=Math.abs(Math.round(l)-ue)||1,z=(Y+X)*de+ke,Q=Math.abs(Math.round(z)-y)||1;return x.setTransform(0,Math.sign(de),Math.sign(me),0,ue,y),x.drawImage(a,c,E,B,O,0,0,Q,I),x.setTransform(ne,de,me,xe,Se,ke),[Q,I]}x.drawImage(a,c,E,B,O,Y,Z,X,ie);let Xe=Math.hypot(ne,de),Ee=Math.hypot(me,xe);return[Xe*X,Ee*ie]}function b(x){let{width:a,height:c}=x;if(a>T||c>T)return null;let E=1e3,B=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),O=a+1,Y=new Uint8Array(O*(c+1)),Z,X,ie,ne=a+7&-8,de=new Uint8Array(ne*c),me=0;for(let Ee of x.data){let _e=128;for(;_e>0;)de[me++]=Ee&_e?0:255,_e>>=1}let xe=0;for(me=0,de[me]!==0&&(Y[0]=1,++xe),X=1;X<a;X++)de[me]!==de[me+1]&&(Y[X]=de[me]?2:1,++xe),me++;for(de[me]!==0&&(Y[X]=2,++xe),Z=1;Z<c;Z++){me=Z*ne,ie=Z*O,de[me-ne]!==de[me]&&(Y[ie]=de[me]?1:8,++xe);let Ee=(de[me]?4:0)+(de[me-ne]?8:0);for(X=1;X<a;X++)Ee=(Ee>>2)+(de[me+1]?4:0)+(de[me-ne+1]?8:0),B[Ee]&&(Y[ie+X]=B[Ee],++xe),me++;if(de[me-ne]!==de[me]&&(Y[ie+X]=de[me]?2:4,++xe),xe>E)return null}for(me=ne*(c-1),ie=Z*O,de[me]!==0&&(Y[ie]=8,++xe),X=1;X<a;X++)de[me]!==de[me+1]&&(Y[ie+X]=de[me]?4:8,++xe),me++;if(de[me]!==0&&(Y[ie+X]=4,++xe),xe>E)return null;let Se=new Int32Array([0,O,-1,0,-O,0,0,0,1]),ke=new Path2D;for(Z=0;xe&&Z<=c;Z++){let Ee=Z*O,_e=Ee+a;for(;Ee<_e&&!Y[Ee];)Ee++;if(Ee===_e)continue;ke.moveTo(Ee%O,Z);let ue=Ee,re=Y[Ee];do{let y=Se[re];do Ee+=y;while(!Y[Ee]);let l=Y[Ee];l!==5&&l!==10?(re=l,Y[Ee]=0):(re=l&51*re>>4,Y[Ee]&=re>>2|re<<2),ke.lineTo(Ee%O,Ee/O|0),Y[Ee]||--xe}while(ue!==Ee);--Z}return de=null,Y=null,function(Ee){Ee.save(),Ee.scale(1/a,-1/c),Ee.translate(0,-c),Ee.fill(ke),Ee.beginPath(),Ee.restore()}}class N{constructor(a,c){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=e.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=e.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=e.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,a,c])}clone(){let a=Object.create(this);return a.clipBox=this.clipBox.slice(),a}setCurrentPoint(a,c){this.x=a,this.y=c}updatePathMinMax(a,c,E){[c,E]=e.Util.applyTransform([c,E],a),this.minX=Math.min(this.minX,c),this.minY=Math.min(this.minY,E),this.maxX=Math.max(this.maxX,c),this.maxY=Math.max(this.maxY,E)}updateRectMinMax(a,c){let E=e.Util.applyTransform(c,a),B=e.Util.applyTransform(c.slice(2),a);this.minX=Math.min(this.minX,E[0],B[0]),this.minY=Math.min(this.minY,E[1],B[1]),this.maxX=Math.max(this.maxX,E[0],B[0]),this.maxY=Math.max(this.maxY,E[1],B[1])}updateScalingPathMinMax(a,c){e.Util.scaleMinMax(a,c),this.minX=Math.min(this.minX,c[0]),this.maxX=Math.max(this.maxX,c[1]),this.minY=Math.min(this.minY,c[2]),this.maxY=Math.max(this.maxY,c[3])}updateCurvePathMinMax(a,c,E,B,O,Y,Z,X,ie,ne){let de=e.Util.bezierBoundingBox(c,E,B,O,Y,Z,X,ie);if(ne){ne[0]=Math.min(ne[0],de[0],de[2]),ne[1]=Math.max(ne[1],de[0],de[2]),ne[2]=Math.min(ne[2],de[1],de[3]),ne[3]=Math.max(ne[3],de[1],de[3]);return}this.updateRectMinMax(a,de)}getPathBoundingBox(a=i.PathType.FILL,c=null){let E=[this.minX,this.minY,this.maxX,this.maxY];if(a===i.PathType.STROKE){c||(0,e.unreachable)("Stroke bounding box must include transform.");let B=e.Util.singularValueDecompose2dScale(c),O=B[0]*this.lineWidth/2,Y=B[1]*this.lineWidth/2;E[0]-=O,E[1]-=Y,E[2]+=O,E[3]+=Y}return E}updateClipFromPath(){let a=e.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(a||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(a){this.clipBox=a,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(a=i.PathType.FILL,c=null){return e.Util.intersect(this.clipBox,this.getPathBoundingBox(a,c))}}function L(x,a){if(typeof ImageData<"u"&&a instanceof ImageData){x.putImageData(a,0,0);return}let c=a.height,E=a.width,B=c%A,O=(c-B)/A,Y=B===0?O:O+1,Z=x.createImageData(E,A),X=0,ie,ne=a.data,de=Z.data,me,xe,Se,ke;if(a.kind===e.ImageKind.GRAYSCALE_1BPP){let Xe=ne.byteLength,Ee=new Uint32Array(de.buffer,0,de.byteLength>>2),_e=Ee.length,ue=E+7>>3,re=4294967295,y=e.FeatureTest.isLittleEndian?4278190080:255;for(me=0;me<Y;me++){for(Se=me<O?A:B,ie=0,xe=0;xe<Se;xe++){let l=Xe-X,I=0,z=l>ue?E:l*8-7,Q=z&-8,K=0,le=0;for(;I<Q;I+=8)le=ne[X++],Ee[ie++]=le&128?re:y,Ee[ie++]=le&64?re:y,Ee[ie++]=le&32?re:y,Ee[ie++]=le&16?re:y,Ee[ie++]=le&8?re:y,Ee[ie++]=le&4?re:y,Ee[ie++]=le&2?re:y,Ee[ie++]=le&1?re:y;for(;I<z;I++)K===0&&(le=ne[X++],K=128),Ee[ie++]=le&K?re:y,K>>=1}for(;ie<_e;)Ee[ie++]=0;x.putImageData(Z,0,me*A)}}else if(a.kind===e.ImageKind.RGBA_32BPP){for(xe=0,ke=E*A*4,me=0;me<O;me++)de.set(ne.subarray(X,X+ke)),X+=ke,x.putImageData(Z,0,xe),xe+=A;me<Y&&(ke=E*B*4,de.set(ne.subarray(X,X+ke)),x.putImageData(Z,0,xe))}else if(a.kind===e.ImageKind.RGB_24BPP)for(Se=A,ke=E*Se,me=0;me<Y;me++){for(me>=O&&(Se=B,ke=E*Se),ie=0,xe=ke;xe--;)de[ie++]=ne[X++],de[ie++]=ne[X++],de[ie++]=ne[X++],de[ie++]=255;x.putImageData(Z,0,me*A)}else throw new Error(`bad image kind: ${a.kind}`)}function g(x,a){if(a.bitmap){x.drawImage(a.bitmap,0,0);return}let c=a.height,E=a.width,B=c%A,O=(c-B)/A,Y=B===0?O:O+1,Z=x.createImageData(E,A),X=0,ie=a.data,ne=Z.data;for(let de=0;de<Y;de++){let me=de<O?A:B;({srcPos:X}=(0,r.convertBlackAndWhiteToRGBA)({src:ie,srcPos:X,dest:ne,width:E,height:me,nonBlackColor:0})),x.putImageData(Z,0,de*A)}}function f(x,a){let c=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let E of c)x[E]!==void 0&&(a[E]=x[E]);x.setLineDash!==void 0&&(a.setLineDash(x.getLineDash()),a.lineDashOffset=x.lineDashOffset)}function p(x){if(x.strokeStyle=x.fillStyle="#000000",x.fillRule="nonzero",x.globalAlpha=1,x.lineWidth=1,x.lineCap="butt",x.lineJoin="miter",x.miterLimit=10,x.globalCompositeOperation="source-over",x.font="10px sans-serif",x.setLineDash!==void 0&&(x.setLineDash([]),x.lineDashOffset=0),!e.isNodeJS){let{filter:a}=x;a!=="none"&&a!==""&&(x.filter="none")}}function C(x,a,c,E){let B=x.length;for(let O=3;O<B;O+=4){let Y=x[O];if(Y===0)x[O-3]=a,x[O-2]=c,x[O-1]=E;else if(Y<255){let Z=255-Y;x[O-3]=x[O-3]*Y+a*Z>>8,x[O-2]=x[O-2]*Y+c*Z>>8,x[O-1]=x[O-1]*Y+E*Z>>8}}}function P(x,a,c){let E=x.length,B=1/255;for(let O=3;O<E;O+=4){let Y=c?c[x[O]]:x[O];a[O]=a[O]*Y*B|0}}function k(x,a,c){let E=x.length;for(let B=3;B<E;B+=4){let O=x[B-3]*77+x[B-2]*152+x[B-1]*28;a[B]=c?a[B]*c[O>>8]>>8:a[B]*O>>16}}function R(x,a,c,E,B,O,Y,Z,X,ie,ne){let de=!!O,me=de?O[0]:0,xe=de?O[1]:0,Se=de?O[2]:0,ke=B==="Luminosity"?k:P,Ee=Math.min(E,Math.ceil(1048576/c));for(let _e=0;_e<E;_e+=Ee){let ue=Math.min(Ee,E-_e),re=x.getImageData(Z-ie,_e+(X-ne),c,ue),y=a.getImageData(Z,_e+X,c,ue);de&&C(re.data,me,xe,Se),ke(re.data,y.data,Y),a.putImageData(y,Z,_e+X)}}function W(x,a,c,E){let B=E[0],O=E[1],Y=E[2]-B,Z=E[3]-O;Y===0||Z===0||(R(a.context,c,Y,Z,a.subtype,a.backdrop,a.transferMap,B,O,a.offsetX,a.offsetY),x.save(),x.globalAlpha=1,x.globalCompositeOperation="source-over",x.setTransform(1,0,0,1,0,0),x.drawImage(c.canvas,0,0),x.restore())}function w(x,a){let c=e.Util.singularValueDecompose2dScale(x);c[0]=Math.fround(c[0]),c[1]=Math.fround(c[1]);let E=Math.fround((globalThis.devicePixelRatio||1)*t.PixelsPerInch.PDF_TO_CSS_UNITS);return a!==void 0?a:c[0]<=E||c[1]<=E}let D=["butt","round","square"],V=["miter","round","bevel"],U={},q={};class ${constructor(a,c,E,B,O,{optionalContentConfig:Y,markedContentStack:Z=null},X,ie){this.ctx=a,this.current=new N(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=c,this.objs=E,this.canvasFactory=B,this.filterFactory=O,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=Z||[],this.optionalContentConfig=Y,this.cachedCanvases=new F(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=X,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=ie,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(a,c=null){return typeof a=="string"?a.startsWith("g_")?this.commonObjs.get(a):this.objs.get(a):c}beginDrawing({transform:a,viewport:c,transparency:E=!1,background:B=null}){let O=this.ctx.canvas.width,Y=this.ctx.canvas.height,Z=this.ctx.fillStyle;if(this.ctx.fillStyle=B||"#ffffff",this.ctx.fillRect(0,0,O,Y),this.ctx.fillStyle=Z,E){let X=this.cachedCanvases.getCanvas("transparent",O,Y);this.compositeCtx=this.ctx,this.transparentCanvas=X.canvas,this.ctx=X.context,this.ctx.save(),this.ctx.transform(...(0,t.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),p(this.ctx),a&&(this.ctx.transform(...a),this.outputScaleX=a[0],this.outputScaleY=a[0]),this.ctx.transform(...c.transform),this.viewportScale=c.scale,this.baseTransform=(0,t.getCurrentTransform)(this.ctx)}executeOperatorList(a,c,E,B){let O=a.argsArray,Y=a.fnArray,Z=c||0,X=O.length;if(X===Z)return Z;let ie=X-Z>v&&typeof E=="function",ne=ie?Date.now()+d:0,de=0,me=this.commonObjs,xe=this.objs,Se;for(;;){if(B!==void 0&&Z===B.nextBreakPoint)return B.breakIt(Z,E),Z;if(Se=Y[Z],Se!==e.OPS.dependency)this[Se].apply(this,O[Z]);else for(let ke of O[Z]){let Xe=ke.startsWith("g_")?me:xe;if(!Xe.has(ke))return Xe.get(ke,E),Z}if(Z++,Z===X)return Z;if(ie&&++de>v){if(Date.now()>ne)return E(),Z;de=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let a of this._cachedBitmapsMap.values()){for(let c of a.values())typeof HTMLCanvasElement<"u"&&c instanceof HTMLCanvasElement&&(c.width=c.height=0);a.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){let a=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(a!=="none"){let c=this.ctx.filter;this.ctx.filter=a,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=c}}}_scaleImage(a,c){let E=a.width,B=a.height,O=Math.max(Math.hypot(c[0],c[1]),1),Y=Math.max(Math.hypot(c[2],c[3]),1),Z=E,X=B,ie="prescale1",ne,de;for(;O>2&&Z>1||Y>2&&X>1;){let me=Z,xe=X;O>2&&Z>1&&(me=Z>=16384?Math.floor(Z/2)-1||1:Math.ceil(Z/2),O/=Z/me),Y>2&&X>1&&(xe=X>=16384?Math.floor(X/2)-1||1:Math.ceil(X)/2,Y/=X/xe),ne=this.cachedCanvases.getCanvas(ie,me,xe),de=ne.context,de.clearRect(0,0,me,xe),de.drawImage(a,0,0,Z,X,0,0,me,xe),a=ne.canvas,Z=me,X=xe,ie=ie==="prescale1"?"prescale2":"prescale1"}return{img:a,paintWidth:Z,paintHeight:X}}_createMaskCanvas(a){let c=this.ctx,{width:E,height:B}=a,O=this.current.fillColor,Y=this.current.patternFill,Z=(0,t.getCurrentTransform)(c),X,ie,ne,de;if((a.bitmap||a.data)&&a.count>1){let I=a.bitmap||a.data.buffer;ie=JSON.stringify(Y?Z:[Z.slice(0,4),O]),X=this._cachedBitmapsMap.get(I),X||(X=new Map,this._cachedBitmapsMap.set(I,X));let z=X.get(ie);if(z&&!Y){let Q=Math.round(Math.min(Z[0],Z[2])+Z[4]),K=Math.round(Math.min(Z[1],Z[3])+Z[5]);return{canvas:z,offsetX:Q,offsetY:K}}ne=z}ne||(de=this.cachedCanvases.getCanvas("maskCanvas",E,B),g(de.context,a));let me=e.Util.transform(Z,[1/E,0,0,-1/B,0,0]);me=e.Util.transform(me,[1,0,0,1,0,-B]);let xe=e.Util.applyTransform([0,0],me),Se=e.Util.applyTransform([E,B],me),ke=e.Util.normalizeRect([xe[0],xe[1],Se[0],Se[1]]),Xe=Math.round(ke[2]-ke[0])||1,Ee=Math.round(ke[3]-ke[1])||1,_e=this.cachedCanvases.getCanvas("fillCanvas",Xe,Ee),ue=_e.context,re=Math.min(xe[0],Se[0]),y=Math.min(xe[1],Se[1]);ue.translate(-re,-y),ue.transform(...me),ne||(ne=this._scaleImage(de.canvas,(0,t.getCurrentTransformInverse)(ue)),ne=ne.img,X&&Y&&X.set(ie,ne)),ue.imageSmoothingEnabled=w((0,t.getCurrentTransform)(ue),a.interpolate),S(ue,ne,0,0,ne.width,ne.height,0,0,E,B),ue.globalCompositeOperation="source-in";let l=e.Util.transform((0,t.getCurrentTransformInverse)(ue),[1,0,0,1,-re,-y]);return ue.fillStyle=Y?O.getPattern(c,this,l,i.PathType.FILL):O,ue.fillRect(0,0,E,B),X&&!Y&&(this.cachedCanvases.delete("fillCanvas"),X.set(ie,_e.canvas)),{canvas:_e.canvas,offsetX:Math.round(re),offsetY:Math.round(y)}}setLineWidth(a){a!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=a,this.ctx.lineWidth=a}setLineCap(a){this.ctx.lineCap=D[a]}setLineJoin(a){this.ctx.lineJoin=V[a]}setMiterLimit(a){this.ctx.miterLimit=a}setDash(a,c){let E=this.ctx;E.setLineDash!==void 0&&(E.setLineDash(a),E.lineDashOffset=c)}setRenderingIntent(a){}setFlatness(a){}setGState(a){for(let[c,E]of a)switch(c){case"LW":this.setLineWidth(E);break;case"LC":this.setLineCap(E);break;case"LJ":this.setLineJoin(E);break;case"ML":this.setMiterLimit(E);break;case"D":this.setDash(E[0],E[1]);break;case"RI":this.setRenderingIntent(E);break;case"FL":this.setFlatness(E);break;case"Font":this.setFont(E[0],E[1]);break;case"CA":this.current.strokeAlpha=E;break;case"ca":this.current.fillAlpha=E,this.ctx.globalAlpha=E;break;case"BM":this.ctx.globalCompositeOperation=E;break;case"SMask":this.current.activeSMask=E?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(E);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let a=this.inSMaskMode;this.current.activeSMask&&!a?this.beginSMaskMode():!this.current.activeSMask&&a&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let a=this.ctx.canvas.width,c=this.ctx.canvas.height,E="smaskGroupAt"+this.groupLevel,B=this.cachedCanvases.getCanvas(E,a,c);this.suspendedCtx=this.ctx,this.ctx=B.context;let O=this.ctx;O.setTransform(...(0,t.getCurrentTransform)(this.suspendedCtx)),f(this.suspendedCtx,O),M(O,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),f(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(a){if(!this.current.activeSMask)return;a?(a[0]=Math.floor(a[0]),a[1]=Math.floor(a[1]),a[2]=Math.ceil(a[2]),a[3]=Math.ceil(a[3])):a=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let c=this.current.activeSMask,E=this.suspendedCtx;W(E,c,this.ctx,a),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(f(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let a=this.current;this.stateStack.push(a),this.current=a.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),f(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(a,c,E,B,O,Y){this.ctx.transform(a,c,E,B,O,Y),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(a,c,E){let B=this.ctx,O=this.current,Y=O.x,Z=O.y,X,ie,ne=(0,t.getCurrentTransform)(B),de=ne[0]===0&&ne[3]===0||ne[1]===0&&ne[2]===0,me=de?E.slice(0):null;for(let xe=0,Se=0,ke=a.length;xe<ke;xe++)switch(a[xe]|0){case e.OPS.rectangle:Y=c[Se++],Z=c[Se++];let Xe=c[Se++],Ee=c[Se++],_e=Y+Xe,ue=Z+Ee;B.moveTo(Y,Z),Xe===0||Ee===0?B.lineTo(_e,ue):(B.lineTo(_e,Z),B.lineTo(_e,ue),B.lineTo(Y,ue)),de||O.updateRectMinMax(ne,[Y,Z,_e,ue]),B.closePath();break;case e.OPS.moveTo:Y=c[Se++],Z=c[Se++],B.moveTo(Y,Z),de||O.updatePathMinMax(ne,Y,Z);break;case e.OPS.lineTo:Y=c[Se++],Z=c[Se++],B.lineTo(Y,Z),de||O.updatePathMinMax(ne,Y,Z);break;case e.OPS.curveTo:X=Y,ie=Z,Y=c[Se+4],Z=c[Se+5],B.bezierCurveTo(c[Se],c[Se+1],c[Se+2],c[Se+3],Y,Z),O.updateCurvePathMinMax(ne,X,ie,c[Se],c[Se+1],c[Se+2],c[Se+3],Y,Z,me),Se+=6;break;case e.OPS.curveTo2:X=Y,ie=Z,B.bezierCurveTo(Y,Z,c[Se],c[Se+1],c[Se+2],c[Se+3]),O.updateCurvePathMinMax(ne,X,ie,Y,Z,c[Se],c[Se+1],c[Se+2],c[Se+3],me),Y=c[Se+2],Z=c[Se+3],Se+=4;break;case e.OPS.curveTo3:X=Y,ie=Z,Y=c[Se+2],Z=c[Se+3],B.bezierCurveTo(c[Se],c[Se+1],Y,Z,Y,Z),O.updateCurvePathMinMax(ne,X,ie,c[Se],c[Se+1],Y,Z,Y,Z,me),Se+=4;break;case e.OPS.closePath:B.closePath();break}de&&O.updateScalingPathMinMax(ne,me),O.setCurrentPoint(Y,Z)}closePath(){this.ctx.closePath()}stroke(a=!0){let c=this.ctx,E=this.current.strokeColor;c.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof E=="object"&&E?.getPattern?(c.save(),c.strokeStyle=E.getPattern(c,this,(0,t.getCurrentTransformInverse)(c),i.PathType.STROKE),this.rescaleAndStroke(!1),c.restore()):this.rescaleAndStroke(!0)),a&&this.consumePath(this.current.getClippedPathBoundingBox()),c.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(a=!0){let c=this.ctx,E=this.current.fillColor,B=this.current.patternFill,O=!1;B&&(c.save(),c.fillStyle=E.getPattern(c,this,(0,t.getCurrentTransformInverse)(c),i.PathType.FILL),O=!0);let Y=this.current.getClippedPathBoundingBox();this.contentVisible&&Y!==null&&(this.pendingEOFill?(c.fill("evenodd"),this.pendingEOFill=!1):c.fill()),O&&c.restore(),a&&this.consumePath(Y)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=U}eoClip(){this.pendingClip=q}beginText(){this.current.textMatrix=e.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let a=this.pendingTextPaths,c=this.ctx;if(a===void 0){c.beginPath();return}c.save(),c.beginPath();for(let E of a)c.setTransform(...E.transform),c.translate(E.x,E.y),E.addToPath(c,E.fontSize);c.restore(),c.clip(),c.beginPath(),delete this.pendingTextPaths}setCharSpacing(a){this.current.charSpacing=a}setWordSpacing(a){this.current.wordSpacing=a}setHScale(a){this.current.textHScale=a/100}setLeading(a){this.current.leading=-a}setFont(a,c){let E=this.commonObjs.get(a),B=this.current;if(!E)throw new Error(`Can't find font for ${a}`);if(B.fontMatrix=E.fontMatrix||e.FONT_IDENTITY_MATRIX,(B.fontMatrix[0]===0||B.fontMatrix[3]===0)&&(0,e.warn)("Invalid font matrix for font "+a),c<0?(c=-c,B.fontDirection=-1):B.fontDirection=1,this.current.font=E,this.current.fontSize=c,E.isType3Font)return;let O=E.loadedName||"sans-serif",Y=E.systemFontInfo?.css||`"${O}", ${E.fallbackName}`,Z="normal";E.black?Z="900":E.bold&&(Z="bold");let X=E.italic?"italic":"normal",ie=c;c<m?ie=m:c>o&&(ie=o),this.current.fontSizeScale=c/ie,this.ctx.font=`${X} ${Z} ${ie}px ${Y}`}setTextRenderingMode(a){this.current.textRenderingMode=a}setTextRise(a){this.current.textRise=a}moveText(a,c){this.current.x=this.current.lineX+=a,this.current.y=this.current.lineY+=c}setLeadingMoveText(a,c){this.setLeading(-c),this.moveText(a,c)}setTextMatrix(a,c,E,B,O,Y){this.current.textMatrix=[a,c,E,B,O,Y],this.current.textMatrixScale=Math.hypot(a,c),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(a,c,E,B){let O=this.ctx,Y=this.current,Z=Y.font,X=Y.textRenderingMode,ie=Y.fontSize/Y.fontSizeScale,ne=X&e.TextRenderingMode.FILL_STROKE_MASK,de=!!(X&e.TextRenderingMode.ADD_TO_PATH_FLAG),me=Y.patternFill&&!Z.missingFile,xe;(Z.disableFontFace||de||me)&&(xe=Z.getPathGenerator(this.commonObjs,a)),Z.disableFontFace||me?(O.save(),O.translate(c,E),O.beginPath(),xe(O,ie),B&&O.setTransform(...B),(ne===e.TextRenderingMode.FILL||ne===e.TextRenderingMode.FILL_STROKE)&&O.fill(),(ne===e.TextRenderingMode.STROKE||ne===e.TextRenderingMode.FILL_STROKE)&&O.stroke(),O.restore()):((ne===e.TextRenderingMode.FILL||ne===e.TextRenderingMode.FILL_STROKE)&&O.fillText(a,c,E),(ne===e.TextRenderingMode.STROKE||ne===e.TextRenderingMode.FILL_STROKE)&&O.strokeText(a,c,E)),de&&(this.pendingTextPaths||=[]).push({transform:(0,t.getCurrentTransform)(O),x:c,y:E,fontSize:ie,addToPath:xe})}get isFontSubpixelAAEnabled(){let{context:a}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);a.scale(1.5,1),a.fillText("I",0,10);let c=a.getImageData(0,0,10,10).data,E=!1;for(let B=3;B<c.length;B+=4)if(c[B]>0&&c[B]<255){E=!0;break}return(0,e.shadow)(this,"isFontSubpixelAAEnabled",E)}showText(a){let c=this.current,E=c.font;if(E.isType3Font)return this.showType3Text(a);let B=c.fontSize;if(B===0)return;let O=this.ctx,Y=c.fontSizeScale,Z=c.charSpacing,X=c.wordSpacing,ie=c.fontDirection,ne=c.textHScale*ie,de=a.length,me=E.vertical,xe=me?1:-1,Se=E.defaultVMetrics,ke=B*c.fontMatrix[0],Xe=c.textRenderingMode===e.TextRenderingMode.FILL&&!E.disableFontFace&&!c.patternFill;O.save(),O.transform(...c.textMatrix),O.translate(c.x,c.y+c.textRise),ie>0?O.scale(ne,-1):O.scale(ne,1);let Ee;if(c.patternFill){O.save();let l=c.fillColor.getPattern(O,this,(0,t.getCurrentTransformInverse)(O),i.PathType.FILL);Ee=(0,t.getCurrentTransform)(O),O.restore(),O.fillStyle=l}let _e=c.lineWidth,ue=c.textMatrixScale;if(ue===0||_e===0){let l=c.textRenderingMode&e.TextRenderingMode.FILL_STROKE_MASK;(l===e.TextRenderingMode.STROKE||l===e.TextRenderingMode.FILL_STROKE)&&(_e=this.getSinglePixelWidth())}else _e/=ue;if(Y!==1&&(O.scale(Y,Y),_e/=Y),O.lineWidth=_e,E.isInvalidPDFjsFont){let l=[],I=0;for(let z of a)l.push(z.unicode),I+=z.width;O.fillText(l.join(""),0,0),c.x+=I*ke*ne,O.restore(),this.compose();return}let re=0,y;for(y=0;y<de;++y){let l=a[y];if(typeof l=="number"){re+=xe*l*B/1e3;continue}let I=!1,z=(l.isSpace?X:0)+Z,Q=l.fontChar,K=l.accent,le,se,oe=l.width;if(me){let Ie=l.vmetric||Se,Qe=-(l.vmetric?Ie[1]:oe*.5)*ke,ze=Ie[2]*ke;oe=Ie?-Ie[0]:oe,le=Qe/Y,se=(re+ze)/Y}else le=re/Y,se=0;if(E.remeasure&&oe>0){let Ie=O.measureText(Q).width*1e3/B*Y;if(oe<Ie&&this.isFontSubpixelAAEnabled){let Qe=oe/Ie;I=!0,O.save(),O.scale(Qe,1),le/=Qe}else oe!==Ie&&(le+=(oe-Ie)/2e3*B/Y)}if(this.contentVisible&&(l.isInFont||E.missingFile)){if(Xe&&!K)O.fillText(Q,le,se);else if(this.paintChar(Q,le,se,Ee),K){let Ie=le+B*K.offset.x/Y,Qe=se-B*K.offset.y/Y;this.paintChar(K.fontChar,Ie,Qe,Ee)}}let we=me?oe*ke-z*ie:oe*ke+z*ie;re+=we,I&&O.restore()}me?c.y-=re:c.x+=re*ne,O.restore(),this.compose()}showType3Text(a){let c=this.ctx,E=this.current,B=E.font,O=E.fontSize,Y=E.fontDirection,Z=B.vertical?1:-1,X=E.charSpacing,ie=E.wordSpacing,ne=E.textHScale*Y,de=E.fontMatrix||e.FONT_IDENTITY_MATRIX,me=a.length,xe=E.textRenderingMode===e.TextRenderingMode.INVISIBLE,Se,ke,Xe,Ee;if(!(xe||O===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,c.save(),c.transform(...E.textMatrix),c.translate(E.x,E.y),c.scale(ne,Y),Se=0;Se<me;++Se){if(ke=a[Se],typeof ke=="number"){Ee=Z*ke*O/1e3,this.ctx.translate(Ee,0),E.x+=Ee*ne;continue}let _e=(ke.isSpace?ie:0)+X,ue=B.charProcOperatorList[ke.operatorListId];if(!ue){(0,e.warn)(`Type3 character "${ke.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=ke,this.save(),c.scale(O,O),c.transform(...de),this.executeOperatorList(ue),this.restore()),Xe=e.Util.applyTransform([ke.width,0],de)[0]*O+_e,c.translate(Xe,0),E.x+=Xe*ne}c.restore(),this.processingType3=null}}setCharWidth(a,c){}setCharWidthAndBounds(a,c,E,B,O,Y){this.ctx.rect(E,B,O-E,Y-B),this.ctx.clip(),this.endPath()}getColorN_Pattern(a){let c;if(a[0]==="TilingPattern"){let E=a[1],B=this.baseTransform||(0,t.getCurrentTransform)(this.ctx),O={createCanvasGraphics:Y=>new $(Y,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};c=new i.TilingPattern(a,E,this.ctx,O,B)}else c=this._getPattern(a[1],a[2]);return c}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(a,c,E){let B=e.Util.makeHexColor(a,c,E);this.ctx.strokeStyle=B,this.current.strokeColor=B}setFillRGBColor(a,c,E){let B=e.Util.makeHexColor(a,c,E);this.ctx.fillStyle=B,this.current.fillColor=B,this.current.patternFill=!1}_getPattern(a,c=null){let E;return this.cachedPatterns.has(a)?E=this.cachedPatterns.get(a):(E=(0,i.getShadingPattern)(this.getObject(a)),this.cachedPatterns.set(a,E)),c&&(E.matrix=c),E}shadingFill(a){if(!this.contentVisible)return;let c=this.ctx;this.save();let E=this._getPattern(a);c.fillStyle=E.getPattern(c,this,(0,t.getCurrentTransformInverse)(c),i.PathType.SHADING);let B=(0,t.getCurrentTransformInverse)(c);if(B){let{width:O,height:Y}=c.canvas,[Z,X,ie,ne]=e.Util.getAxialAlignedBoundingBox([0,0,O,Y],B);this.ctx.fillRect(Z,X,ie-Z,ne-X)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,e.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,e.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(a,c){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(a)&&a.length===6&&this.transform(...a),this.baseTransform=(0,t.getCurrentTransform)(this.ctx),c)){let E=c[2]-c[0],B=c[3]-c[1];this.ctx.rect(c[0],c[1],E,B),this.current.updateRectMinMax((0,t.getCurrentTransform)(this.ctx),c),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(a){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let c=this.ctx;a.isolated||(0,e.info)("TODO: Support non-isolated groups."),a.knockout&&(0,e.warn)("Knockout groups not supported.");let E=(0,t.getCurrentTransform)(c);if(a.matrix&&c.transform(...a.matrix),!a.bbox)throw new Error("Bounding box is required.");let B=e.Util.getAxialAlignedBoundingBox(a.bbox,(0,t.getCurrentTransform)(c)),O=[0,0,c.canvas.width,c.canvas.height];B=e.Util.intersect(B,O)||[0,0,0,0];let Y=Math.floor(B[0]),Z=Math.floor(B[1]),X=Math.max(Math.ceil(B[2])-Y,1),ie=Math.max(Math.ceil(B[3])-Z,1),ne=1,de=1;X>u&&(ne=X/u,X=u),ie>u&&(de=ie/u,ie=u),this.current.startNewPathAndClipBox([0,0,X,ie]);let me="groupAt"+this.groupLevel;a.smask&&(me+="_smask_"+this.smaskCounter++%2);let xe=this.cachedCanvases.getCanvas(me,X,ie),Se=xe.context;Se.scale(1/ne,1/de),Se.translate(-Y,-Z),Se.transform(...E),a.smask?this.smaskStack.push({canvas:xe.canvas,context:Se,offsetX:Y,offsetY:Z,scaleX:ne,scaleY:de,subtype:a.smask.subtype,backdrop:a.smask.backdrop,transferMap:a.smask.transferMap||null,startTransformInverse:null}):(c.setTransform(1,0,0,1,0,0),c.translate(Y,Z),c.scale(ne,de),c.save()),f(c,Se),this.ctx=Se,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(c),this.groupLevel++}endGroup(a){if(!this.contentVisible)return;this.groupLevel--;let c=this.ctx,E=this.groupStack.pop();if(this.ctx=E,this.ctx.imageSmoothingEnabled=!1,a.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let B=(0,t.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...B);let O=e.Util.getAxialAlignedBoundingBox([0,0,c.canvas.width,c.canvas.height],B);this.ctx.drawImage(c.canvas,0,0),this.ctx.restore(),this.compose(O)}}beginAnnotation(a,c,E,B,O){if(this.#e(),p(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(c)&&c.length===4){let Y=c[2]-c[0],Z=c[3]-c[1];if(O&&this.annotationCanvasMap){E=E.slice(),E[4]-=c[0],E[5]-=c[1],c=c.slice(),c[0]=c[1]=0,c[2]=Y,c[3]=Z;let[X,ie]=e.Util.singularValueDecompose2dScale((0,t.getCurrentTransform)(this.ctx)),{viewportScale:ne}=this,de=Math.ceil(Y*this.outputScaleX*ne),me=Math.ceil(Z*this.outputScaleY*ne);this.annotationCanvas=this.canvasFactory.create(de,me);let{canvas:xe,context:Se}=this.annotationCanvas;this.annotationCanvasMap.set(a,xe),this.annotationCanvas.savedCtx=this.ctx,this.ctx=Se,this.ctx.save(),this.ctx.setTransform(X,0,0,-ie,0,Z*ie),p(this.ctx)}else p(this.ctx),this.ctx.rect(c[0],c[1],Y,Z),this.ctx.clip(),this.endPath()}this.current=new N(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...E),this.transform(...B)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(a){if(!this.contentVisible)return;let c=a.count;a=this.getObject(a.data,a),a.count=c;let E=this.ctx,B=this.processingType3;if(B&&(B.compiled===void 0&&(B.compiled=b(a)),B.compiled)){B.compiled(E);return}let O=this._createMaskCanvas(a),Y=O.canvas;E.save(),E.setTransform(1,0,0,1,0,0),E.drawImage(Y,O.offsetX,O.offsetY),E.restore(),this.compose()}paintImageMaskXObjectRepeat(a,c,E=0,B=0,O,Y){if(!this.contentVisible)return;a=this.getObject(a.data,a);let Z=this.ctx;Z.save();let X=(0,t.getCurrentTransform)(Z);Z.transform(c,E,B,O,0,0);let ie=this._createMaskCanvas(a);Z.setTransform(1,0,0,1,ie.offsetX-X[4],ie.offsetY-X[5]);for(let ne=0,de=Y.length;ne<de;ne+=2){let me=e.Util.transform(X,[c,E,B,O,Y[ne],Y[ne+1]]),[xe,Se]=e.Util.applyTransform([0,0],me);Z.drawImage(ie.canvas,xe,Se)}Z.restore(),this.compose()}paintImageMaskXObjectGroup(a){if(!this.contentVisible)return;let c=this.ctx,E=this.current.fillColor,B=this.current.patternFill;for(let O of a){let{data:Y,width:Z,height:X,transform:ie}=O,ne=this.cachedCanvases.getCanvas("maskCanvas",Z,X),de=ne.context;de.save();let me=this.getObject(Y,O);g(de,me),de.globalCompositeOperation="source-in",de.fillStyle=B?E.getPattern(de,this,(0,t.getCurrentTransformInverse)(c),i.PathType.FILL):E,de.fillRect(0,0,Z,X),de.restore(),c.save(),c.transform(...ie),c.scale(1,-1),S(c,ne.canvas,0,0,Z,X,0,-1,1,1),c.restore()}this.compose()}paintImageXObject(a){if(!this.contentVisible)return;let c=this.getObject(a);if(!c){(0,e.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(c)}paintImageXObjectRepeat(a,c,E,B){if(!this.contentVisible)return;let O=this.getObject(a);if(!O){(0,e.warn)("Dependent image isn't ready yet");return}let Y=O.width,Z=O.height,X=[];for(let ie=0,ne=B.length;ie<ne;ie+=2)X.push({transform:[c,0,0,E,B[ie],B[ie+1]],x:0,y:0,w:Y,h:Z});this.paintInlineImageXObjectGroup(O,X)}applyTransferMapsToCanvas(a){return this.current.transferMaps!=="none"&&(a.filter=this.current.transferMaps,a.drawImage(a.canvas,0,0),a.filter="none"),a.canvas}applyTransferMapsToBitmap(a){if(this.current.transferMaps==="none")return a.bitmap;let{bitmap:c,width:E,height:B}=a,O=this.cachedCanvases.getCanvas("inlineImage",E,B),Y=O.context;return Y.filter=this.current.transferMaps,Y.drawImage(c,0,0),Y.filter="none",O.canvas}paintInlineImageXObject(a){if(!this.contentVisible)return;let c=a.width,E=a.height,B=this.ctx;if(this.save(),!e.isNodeJS){let{filter:Z}=B;Z!=="none"&&Z!==""&&(B.filter="none")}B.scale(1/c,-1/E);let O;if(a.bitmap)O=this.applyTransferMapsToBitmap(a);else if(typeof HTMLElement=="function"&&a instanceof HTMLElement||!a.data)O=a;else{let X=this.cachedCanvases.getCanvas("inlineImage",c,E).context;L(X,a),O=this.applyTransferMapsToCanvas(X)}let Y=this._scaleImage(O,(0,t.getCurrentTransformInverse)(B));B.imageSmoothingEnabled=w((0,t.getCurrentTransform)(B),a.interpolate),S(B,Y.img,0,0,Y.paintWidth,Y.paintHeight,0,-E,c,E),this.compose(),this.restore()}paintInlineImageXObjectGroup(a,c){if(!this.contentVisible)return;let E=this.ctx,B;if(a.bitmap)B=a.bitmap;else{let O=a.width,Y=a.height,X=this.cachedCanvases.getCanvas("inlineImage",O,Y).context;L(X,a),B=this.applyTransferMapsToCanvas(X)}for(let O of c)E.save(),E.transform(...O.transform),E.scale(1,-1),S(E,B,O.x,O.y,O.w,O.h,0,-1,1,1),E.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(a){}markPointProps(a,c){}beginMarkedContent(a){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(a,c){a==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(c)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(a){let c=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(a);let E=this.ctx;this.pendingClip&&(c||(this.pendingClip===q?E.clip("evenodd"):E.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),E.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let a=(0,t.getCurrentTransform)(this.ctx);if(a[1]===0&&a[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(a[0]),Math.abs(a[3]));else{let c=Math.abs(a[0]*a[3]-a[2]*a[1]),E=Math.hypot(a[0],a[2]),B=Math.hypot(a[1],a[3]);this._cachedGetSinglePixelWidth=Math.max(E,B)/c}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:a}=this.current,{a:c,b:E,c:B,d:O}=this.ctx.getTransform(),Y,Z;if(E===0&&B===0){let X=Math.abs(c),ie=Math.abs(O);if(X===ie)if(a===0)Y=Z=1/X;else{let ne=X*a;Y=Z=ne<1?1/ne:1}else if(a===0)Y=1/X,Z=1/ie;else{let ne=X*a,de=ie*a;Y=ne<1?1/ne:1,Z=de<1?1/de:1}}else{let X=Math.abs(c*O-E*B),ie=Math.hypot(c,E),ne=Math.hypot(B,O);if(a===0)Y=ne/X,Z=ie/X;else{let de=a*X;Y=ne>de?ne/de:1,Z=ie>de?ie/de:1}}this._cachedScaleForStroking[0]=Y,this._cachedScaleForStroking[1]=Z}return this._cachedScaleForStroking}rescaleAndStroke(a){let{ctx:c}=this,{lineWidth:E}=this.current,[B,O]=this.getScaleForStroking();if(c.lineWidth=E||1,B===1&&O===1){c.stroke();return}let Y=c.getLineDash();if(a&&c.save(),c.scale(B,O),Y.length>0){let Z=Math.max(B,O);c.setLineDash(Y.map(X=>X/Z)),c.lineDashOffset/=Z}c.stroke(),a&&c.restore()}isContentVisible(){for(let a=this.markedContentStack.length-1;a>=0;a--)if(!this.markedContentStack[a].visible)return!1;return!0}}n.CanvasGraphics=$;for(let x in e.OPS)$.prototype[x]!==void 0&&($.prototype[e.OPS[x]]=$.prototype[x])},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TilingPattern=n.PathType=void 0,n.getShadingPattern=A;var e=_(1),t=_(6);let i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};n.PathType=i;function r(S,b){if(!b)return;let N=b[2]-b[0],L=b[3]-b[1],g=new Path2D;g.rect(b[0],b[1],N,L),S.clip(g)}class m{constructor(){this.constructor===m&&(0,e.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,e.unreachable)("Abstract method `getPattern` called.")}}class o extends m{constructor(b){super(),this._type=b[1],this._bbox=b[2],this._colorStops=b[3],this._p0=b[4],this._p1=b[5],this._r0=b[6],this._r1=b[7],this.matrix=null}_createGradient(b){let N;this._type==="axial"?N=b.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(N=b.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let L of this._colorStops)N.addColorStop(L[0],L[1]);return N}getPattern(b,N,L,g){let f;if(g===i.STROKE||g===i.FILL){let p=N.current.getClippedPathBoundingBox(g,(0,t.getCurrentTransform)(b))||[0,0,0,0],C=Math.ceil(p[2]-p[0])||1,P=Math.ceil(p[3]-p[1])||1,k=N.cachedCanvases.getCanvas("pattern",C,P,!0),R=k.context;R.clearRect(0,0,R.canvas.width,R.canvas.height),R.beginPath(),R.rect(0,0,R.canvas.width,R.canvas.height),R.translate(-p[0],-p[1]),L=e.Util.transform(L,[1,0,0,1,p[0],p[1]]),R.transform(...N.baseTransform),this.matrix&&R.transform(...this.matrix),r(R,this._bbox),R.fillStyle=this._createGradient(R),R.fill(),f=b.createPattern(k.canvas,"no-repeat");let W=new DOMMatrix(L);f.setTransform(W)}else r(b,this._bbox),f=this._createGradient(b);return f}}function u(S,b,N,L,g,f,p,C){let P=b.coords,k=b.colors,R=S.data,W=S.width*4,w;P[N+1]>P[L+1]&&(w=N,N=L,L=w,w=f,f=p,p=w),P[L+1]>P[g+1]&&(w=L,L=g,g=w,w=p,p=C,C=w),P[N+1]>P[L+1]&&(w=N,N=L,L=w,w=f,f=p,p=w);let D=(P[N]+b.offsetX)*b.scaleX,V=(P[N+1]+b.offsetY)*b.scaleY,U=(P[L]+b.offsetX)*b.scaleX,q=(P[L+1]+b.offsetY)*b.scaleY,$=(P[g]+b.offsetX)*b.scaleX,x=(P[g+1]+b.offsetY)*b.scaleY;if(V>=x)return;let a=k[f],c=k[f+1],E=k[f+2],B=k[p],O=k[p+1],Y=k[p+2],Z=k[C],X=k[C+1],ie=k[C+2],ne=Math.round(V),de=Math.round(x),me,xe,Se,ke,Xe,Ee,_e,ue;for(let re=ne;re<=de;re++){if(re<q){let Q=re<V?0:(V-re)/(V-q);me=D-(D-U)*Q,xe=a-(a-B)*Q,Se=c-(c-O)*Q,ke=E-(E-Y)*Q}else{let Q;re>x?Q=1:q===x?Q=0:Q=(q-re)/(q-x),me=U-(U-$)*Q,xe=B-(B-Z)*Q,Se=O-(O-X)*Q,ke=Y-(Y-ie)*Q}let y;re<V?y=0:re>x?y=1:y=(V-re)/(V-x),Xe=D-(D-$)*y,Ee=a-(a-Z)*y,_e=c-(c-X)*y,ue=E-(E-ie)*y;let l=Math.round(Math.min(me,Xe)),I=Math.round(Math.max(me,Xe)),z=W*re+l*4;for(let Q=l;Q<=I;Q++)y=(me-Q)/(me-Xe),y<0?y=0:y>1&&(y=1),R[z++]=xe-(xe-Ee)*y|0,R[z++]=Se-(Se-_e)*y|0,R[z++]=ke-(ke-ue)*y|0,R[z++]=255}}function d(S,b,N){let L=b.coords,g=b.colors,f,p;switch(b.type){case"lattice":let C=b.verticesPerRow,P=Math.floor(L.length/C)-1,k=C-1;for(f=0;f<P;f++){let R=f*C;for(let W=0;W<k;W++,R++)u(S,N,L[R],L[R+1],L[R+C],g[R],g[R+1],g[R+C]),u(S,N,L[R+C+1],L[R+1],L[R+C],g[R+C+1],g[R+1],g[R+C])}break;case"triangles":for(f=0,p=L.length;f<p;f+=3)u(S,N,L[f],L[f+1],L[f+2],g[f],g[f+1],g[f+2]);break;default:throw new Error("illegal figure")}}class v extends m{constructor(b){super(),this._coords=b[2],this._colors=b[3],this._figures=b[4],this._bounds=b[5],this._bbox=b[7],this._background=b[8],this.matrix=null}_createMeshCanvas(b,N,L){let C=Math.floor(this._bounds[0]),P=Math.floor(this._bounds[1]),k=Math.ceil(this._bounds[2])-C,R=Math.ceil(this._bounds[3])-P,W=Math.min(Math.ceil(Math.abs(k*b[0]*1.1)),3e3),w=Math.min(Math.ceil(Math.abs(R*b[1]*1.1)),3e3),D=k/W,V=R/w,U={coords:this._coords,colors:this._colors,offsetX:-C,offsetY:-P,scaleX:1/D,scaleY:1/V},q=W+2*2,$=w+2*2,x=L.getCanvas("mesh",q,$,!1),a=x.context,c=a.createImageData(W,w);if(N){let B=c.data;for(let O=0,Y=B.length;O<Y;O+=4)B[O]=N[0],B[O+1]=N[1],B[O+2]=N[2],B[O+3]=255}for(let B of this._figures)d(c,B,U);return a.putImageData(c,2,2),{canvas:x.canvas,offsetX:C-2*D,offsetY:P-2*V,scaleX:D,scaleY:V}}getPattern(b,N,L,g){r(b,this._bbox);let f;if(g===i.SHADING)f=e.Util.singularValueDecompose2dScale((0,t.getCurrentTransform)(b));else if(f=e.Util.singularValueDecompose2dScale(N.baseTransform),this.matrix){let C=e.Util.singularValueDecompose2dScale(this.matrix);f=[f[0]*C[0],f[1]*C[1]]}let p=this._createMeshCanvas(f,g===i.SHADING?null:this._background,N.cachedCanvases);return g!==i.SHADING&&(b.setTransform(...N.baseTransform),this.matrix&&b.transform(...this.matrix)),b.translate(p.offsetX,p.offsetY),b.scale(p.scaleX,p.scaleY),b.createPattern(p.canvas,"no-repeat")}}class T extends m{getPattern(){return"hotpink"}}function A(S){switch(S[0]){case"RadialAxial":return new o(S);case"Mesh":return new v(S);case"Dummy":return new T}throw new Error(`Unknown IR type: ${S[0]}`)}let M={COLORED:1,UNCOLORED:2},F=(()=>{let b=class b{constructor(L,g,f,p,C){this.operatorList=L[2],this.matrix=L[3]||[1,0,0,1,0,0],this.bbox=L[4],this.xstep=L[5],this.ystep=L[6],this.paintType=L[7],this.tilingType=L[8],this.color=g,this.ctx=f,this.canvasGraphicsFactory=p,this.baseTransform=C}createPatternCanvas(L){let g=this.operatorList,f=this.bbox,p=this.xstep,C=this.ystep,P=this.paintType,k=this.tilingType,R=this.color,W=this.canvasGraphicsFactory;(0,e.info)("TilingType: "+k);let w=f[0],D=f[1],V=f[2],U=f[3],q=e.Util.singularValueDecompose2dScale(this.matrix),$=e.Util.singularValueDecompose2dScale(this.baseTransform),x=[q[0]*$[0],q[1]*$[1]],a=this.getSizeAndScale(p,this.ctx.canvas.width,x[0]),c=this.getSizeAndScale(C,this.ctx.canvas.height,x[1]),E=L.cachedCanvases.getCanvas("pattern",a.size,c.size,!0),B=E.context,O=W.createCanvasGraphics(B);O.groupLevel=L.groupLevel,this.setFillAndStrokeStyleToContext(O,P,R);let Y=w,Z=D,X=V,ie=U;return w<0&&(Y=0,X+=Math.abs(w)),D<0&&(Z=0,ie+=Math.abs(D)),B.translate(-(a.scale*Y),-(c.scale*Z)),O.transform(a.scale,0,0,c.scale,0,0),B.save(),this.clipBbox(O,Y,Z,X,ie),O.baseTransform=(0,t.getCurrentTransform)(O.ctx),O.executeOperatorList(g),O.endDrawing(),{canvas:E.canvas,scaleX:a.scale,scaleY:c.scale,offsetX:Y,offsetY:Z}}getSizeAndScale(L,g,f){L=Math.abs(L);let p=Math.max(b.MAX_PATTERN_SIZE,g),C=Math.ceil(L*f);return C>=p?C=p:f=C/L,{scale:f,size:C}}clipBbox(L,g,f,p,C){let P=p-g,k=C-f;L.ctx.rect(g,f,P,k),L.current.updateRectMinMax((0,t.getCurrentTransform)(L.ctx),[g,f,p,C]),L.clip(),L.endPath()}setFillAndStrokeStyleToContext(L,g,f){let p=L.ctx,C=L.current;switch(g){case M.COLORED:let P=this.ctx;p.fillStyle=P.fillStyle,p.strokeStyle=P.strokeStyle,C.fillColor=P.fillStyle,C.strokeColor=P.strokeStyle;break;case M.UNCOLORED:let k=e.Util.makeHexColor(f[0],f[1],f[2]);p.fillStyle=k,p.strokeStyle=k,C.fillColor=k,C.strokeColor=k;break;default:throw new e.FormatError(`Unsupported paint type: ${g}`)}}getPattern(L,g,f,p){let C=f;p!==i.SHADING&&(C=e.Util.transform(C,g.baseTransform),this.matrix&&(C=e.Util.transform(C,this.matrix)));let P=this.createPatternCanvas(g),k=new DOMMatrix(C);k=k.translate(P.offsetX,P.offsetY),k=k.scale(1/P.scaleX,1/P.scaleY);let R=L.createPattern(P.canvas,"repeat");return R.setTransform(k),R}};qe(b,"MAX_PATTERN_SIZE",3e3);let S=b;return S})();n.TilingPattern=F},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.convertBlackAndWhiteToRGBA=i,n.convertToRGBA=t,n.grayToRGBA=m;var e=_(1);function t(o){switch(o.kind){case e.ImageKind.GRAYSCALE_1BPP:return i(o);case e.ImageKind.RGB_24BPP:return r(o)}return null}function i({src:o,srcPos:u=0,dest:d,width:v,height:T,nonBlackColor:A=4294967295,inverseDecode:M=!1}){let F=e.FeatureTest.isLittleEndian?4278190080:255,[S,b]=M?[A,F]:[F,A],N=v>>3,L=v&7,g=o.length;d=new Uint32Array(d.buffer);let f=0;for(let p=0;p<T;p++){for(let P=u+N;u<P;u++){let k=u<g?o[u]:255;d[f++]=k&128?b:S,d[f++]=k&64?b:S,d[f++]=k&32?b:S,d[f++]=k&16?b:S,d[f++]=k&8?b:S,d[f++]=k&4?b:S,d[f++]=k&2?b:S,d[f++]=k&1?b:S}if(L===0)continue;let C=u<g?o[u++]:255;for(let P=0;P<L;P++)d[f++]=C&1<<7-P?b:S}return{srcPos:u,destPos:f}}function r({src:o,srcPos:u=0,dest:d,destPos:v=0,width:T,height:A}){let M=0,F=o.length>>2,S=new Uint32Array(o.buffer,u,F);if(e.FeatureTest.isLittleEndian){for(;M<F-2;M+=3,v+=4){let b=S[M],N=S[M+1],L=S[M+2];d[v]=b|4278190080,d[v+1]=b>>>24|N<<8|4278190080,d[v+2]=N>>>16|L<<16|4278190080,d[v+3]=L>>>8|4278190080}for(let b=M*4,N=o.length;b<N;b+=3)d[v++]=o[b]|o[b+1]<<8|o[b+2]<<16|4278190080}else{for(;M<F-2;M+=3,v+=4){let b=S[M],N=S[M+1],L=S[M+2];d[v]=b|255,d[v+1]=b<<24|N>>>8|255,d[v+2]=N<<16|L>>>16|255,d[v+3]=L<<8|255}for(let b=M*4,N=o.length;b<N;b+=3)d[v++]=o[b]<<24|o[b+1]<<16|o[b+2]<<8|255}return{srcPos:u,destPos:v}}function m(o,u){if(e.FeatureTest.isLittleEndian)for(let d=0,v=o.length;d<v;d++)u[d]=o[d]*65793|4278190080;else for(let d=0,v=o.length;d<v;d++)u[d]=o[d]*16843008|255}},(h,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlobalWorkerOptions=void 0;let _=Object.create(null);n.GlobalWorkerOptions=_,_.workerPort=null,_.workerSrc=""},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.MessageHandler=void 0;var e=_(1);let t={UNKNOWN:0,DATA:1,ERROR:2},i={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function r(o){switch(o instanceof Error||typeof o=="object"&&o!==null||(0,e.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),o.name){case"AbortException":return new e.AbortException(o.message);case"MissingPDFException":return new e.MissingPDFException(o.message);case"PasswordException":return new e.PasswordException(o.message,o.code);case"UnexpectedResponseException":return new e.UnexpectedResponseException(o.message,o.status);case"UnknownErrorException":return new e.UnknownErrorException(o.message,o.details);default:return new e.UnknownErrorException(o.message,o.toString())}}class m{constructor(u,d,v){this.sourceName=u,this.targetName=d,this.comObj=v,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=T=>{let A=T.data;if(A.targetName!==this.sourceName)return;if(A.stream){this.#t(A);return}if(A.callback){let F=A.callbackId,S=this.callbackCapabilities[F];if(!S)throw new Error(`Cannot resolve callback ${F}`);if(delete this.callbackCapabilities[F],A.callback===t.DATA)S.resolve(A.data);else if(A.callback===t.ERROR)S.reject(r(A.reason));else throw new Error("Unexpected callback case");return}let M=this.actionHandler[A.action];if(!M)throw new Error(`Unknown action from worker: ${A.action}`);if(A.callbackId){let F=this.sourceName,S=A.sourceName;new Promise(function(b){b(M(A.data))}).then(function(b){v.postMessage({sourceName:F,targetName:S,callback:t.DATA,callbackId:A.callbackId,data:b})},function(b){v.postMessage({sourceName:F,targetName:S,callback:t.ERROR,callbackId:A.callbackId,reason:r(b)})});return}if(A.streamId){this.#e(A);return}M(A.data)},v.addEventListener("message",this._onComObjOnMessage)}on(u,d){let v=this.actionHandler;if(v[u])throw new Error(`There is already an actionName called "${u}"`);v[u]=d}send(u,d,v){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:u,data:d},v)}sendWithPromise(u,d,v){let T=this.callbackId++,A=new e.PromiseCapability;this.callbackCapabilities[T]=A;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:u,callbackId:T,data:d},v)}catch(M){A.reject(M)}return A.promise}sendWithStream(u,d,v,T){let A=this.streamId++,M=this.sourceName,F=this.targetName,S=this.comObj;return new ReadableStream({start:b=>{let N=new e.PromiseCapability;return this.streamControllers[A]={controller:b,startCall:N,pullCall:null,cancelCall:null,isClosed:!1},S.postMessage({sourceName:M,targetName:F,action:u,streamId:A,data:d,desiredSize:b.desiredSize},T),N.promise},pull:b=>{let N=new e.PromiseCapability;return this.streamControllers[A].pullCall=N,S.postMessage({sourceName:M,targetName:F,stream:i.PULL,streamId:A,desiredSize:b.desiredSize}),N.promise},cancel:b=>{(0,e.assert)(b instanceof Error,"cancel must have a valid reason");let N=new e.PromiseCapability;return this.streamControllers[A].cancelCall=N,this.streamControllers[A].isClosed=!0,S.postMessage({sourceName:M,targetName:F,stream:i.CANCEL,streamId:A,reason:r(b)}),N.promise}},v)}#e(u){let d=u.streamId,v=this.sourceName,T=u.sourceName,A=this.comObj,M=this,F=this.actionHandler[u.action],S={enqueue(b,N=1,L){if(this.isCancelled)return;let g=this.desiredSize;this.desiredSize-=N,g>0&&this.desiredSize<=0&&(this.sinkCapability=new e.PromiseCapability,this.ready=this.sinkCapability.promise),A.postMessage({sourceName:v,targetName:T,stream:i.ENQUEUE,streamId:d,chunk:b},L)},close(){this.isCancelled||(this.isCancelled=!0,A.postMessage({sourceName:v,targetName:T,stream:i.CLOSE,streamId:d}),delete M.streamSinks[d])},error(b){(0,e.assert)(b instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,A.postMessage({sourceName:v,targetName:T,stream:i.ERROR,streamId:d,reason:r(b)}))},sinkCapability:new e.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:u.desiredSize,ready:null};S.sinkCapability.resolve(),S.ready=S.sinkCapability.promise,this.streamSinks[d]=S,new Promise(function(b){b(F(u.data,S))}).then(function(){A.postMessage({sourceName:v,targetName:T,stream:i.START_COMPLETE,streamId:d,success:!0})},function(b){A.postMessage({sourceName:v,targetName:T,stream:i.START_COMPLETE,streamId:d,reason:r(b)})})}#t(u){let d=u.streamId,v=this.sourceName,T=u.sourceName,A=this.comObj,M=this.streamControllers[d],F=this.streamSinks[d];switch(u.stream){case i.START_COMPLETE:u.success?M.startCall.resolve():M.startCall.reject(r(u.reason));break;case i.PULL_COMPLETE:u.success?M.pullCall.resolve():M.pullCall.reject(r(u.reason));break;case i.PULL:if(!F){A.postMessage({sourceName:v,targetName:T,stream:i.PULL_COMPLETE,streamId:d,success:!0});break}F.desiredSize<=0&&u.desiredSize>0&&F.sinkCapability.resolve(),F.desiredSize=u.desiredSize,new Promise(function(S){S(F.onPull?.())}).then(function(){A.postMessage({sourceName:v,targetName:T,stream:i.PULL_COMPLETE,streamId:d,success:!0})},function(S){A.postMessage({sourceName:v,targetName:T,stream:i.PULL_COMPLETE,streamId:d,reason:r(S)})});break;case i.ENQUEUE:if((0,e.assert)(M,"enqueue should have stream controller"),M.isClosed)break;M.controller.enqueue(u.chunk);break;case i.CLOSE:if((0,e.assert)(M,"close should have stream controller"),M.isClosed)break;M.isClosed=!0,M.controller.close(),this.#i(M,d);break;case i.ERROR:(0,e.assert)(M,"error should have stream controller"),M.controller.error(r(u.reason)),this.#i(M,d);break;case i.CANCEL_COMPLETE:u.success?M.cancelCall.resolve():M.cancelCall.reject(r(u.reason)),this.#i(M,d);break;case i.CANCEL:if(!F)break;new Promise(function(S){S(F.onCancel?.(r(u.reason)))}).then(function(){A.postMessage({sourceName:v,targetName:T,stream:i.CANCEL_COMPLETE,streamId:d,success:!0})},function(S){A.postMessage({sourceName:v,targetName:T,stream:i.CANCEL_COMPLETE,streamId:d,reason:r(S)})}),F.sinkCapability.reject(r(u.reason)),F.isCancelled=!0,delete this.streamSinks[d];break;default:throw new Error("Unexpected stream case")}}#i(u,d){return Ue(this,null,function*(){yield Promise.allSettled([u.startCall?.promise,u.pullCall?.promise,u.cancelCall?.promise]),delete this.streamControllers[d]})}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}n.MessageHandler=m},(h,n,_)=>{var i,r;Object.defineProperty(n,"__esModule",{value:!0}),n.Metadata=void 0;var e=_(1);class t{constructor({parsedData:o,rawData:u}){ee(this,i);ee(this,r);J(this,i,o),J(this,r,u)}getRaw(){return s(this,r)}get(o){return s(this,i).get(o)??null}getAll(){return(0,e.objectFromMap)(s(this,i))}has(o){return s(this,i).has(o)}}i=new WeakMap,r=new WeakMap,n.Metadata=t},(h,n,_)=>{var o,u,d,v,T,A,js;Object.defineProperty(n,"__esModule",{value:!0}),n.OptionalContentConfig=void 0;var e=_(1),t=_(8);let i=Symbol("INTERNAL");class r{constructor(S,b){ee(this,o,!0);this.name=S,this.intent=b}get visible(){return s(this,o)}_setVisible(S,b){S!==i&&(0,e.unreachable)("Internal method `_setVisible` called."),J(this,o,b)}}o=new WeakMap;class m{constructor(S){ee(this,A);ee(this,u,null);ee(this,d,new Map);ee(this,v,null);ee(this,T,null);if(this.name=null,this.creator=null,S!==null){this.name=S.name,this.creator=S.creator,J(this,T,S.order);for(let b of S.groups)s(this,d).set(b.id,new r(b.name,b.intent));if(S.baseState==="OFF")for(let b of s(this,d).values())b._setVisible(i,!1);for(let b of S.on)s(this,d).get(b)._setVisible(i,!0);for(let b of S.off)s(this,d).get(b)._setVisible(i,!1);J(this,v,this.getHash())}}isVisible(S){if(s(this,d).size===0)return!0;if(!S)return(0,e.warn)("Optional content group not defined."),!0;if(S.type==="OCG")return s(this,d).has(S.id)?s(this,d).get(S.id).visible:((0,e.warn)(`Optional content group not found: ${S.id}`),!0);if(S.type==="OCMD"){if(S.expression)return G(this,A,js).call(this,S.expression);if(!S.policy||S.policy==="AnyOn"){for(let b of S.ids){if(!s(this,d).has(b))return(0,e.warn)(`Optional content group not found: ${b}`),!0;if(s(this,d).get(b).visible)return!0}return!1}else if(S.policy==="AllOn"){for(let b of S.ids){if(!s(this,d).has(b))return(0,e.warn)(`Optional content group not found: ${b}`),!0;if(!s(this,d).get(b).visible)return!1}return!0}else if(S.policy==="AnyOff"){for(let b of S.ids){if(!s(this,d).has(b))return(0,e.warn)(`Optional content group not found: ${b}`),!0;if(!s(this,d).get(b).visible)return!0}return!1}else if(S.policy==="AllOff"){for(let b of S.ids){if(!s(this,d).has(b))return(0,e.warn)(`Optional content group not found: ${b}`),!0;if(s(this,d).get(b).visible)return!1}return!0}return(0,e.warn)(`Unknown optional content policy ${S.policy}.`),!0}return(0,e.warn)(`Unknown group type ${S.type}.`),!0}setVisibility(S,b=!0){if(!s(this,d).has(S)){(0,e.warn)(`Optional content group not found: ${S}`);return}s(this,d).get(S)._setVisible(i,!!b),J(this,u,null)}get hasInitialVisibility(){return s(this,v)===null||this.getHash()===s(this,v)}getOrder(){return s(this,d).size?s(this,T)?s(this,T).slice():[...s(this,d).keys()]:null}getGroups(){return s(this,d).size>0?(0,e.objectFromMap)(s(this,d)):null}getGroup(S){return s(this,d).get(S)||null}getHash(){if(s(this,u)!==null)return s(this,u);let S=new t.MurmurHash3_64;for(let[b,N]of s(this,d))S.update(`${b}:${N.visible}`);return J(this,u,S.hexdigest())}}u=new WeakMap,d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakSet,js=function(S){let b=S.length;if(b<2)return!0;let N=S[0];for(let L=1;L<b;L++){let g=S[L],f;if(Array.isArray(g))f=G(this,A,js).call(this,g);else if(s(this,d).has(g))f=s(this,d).get(g).visible;else return(0,e.warn)(`Optional content group not found: ${g}`),!0;switch(N){case"And":if(!f)return!1;break;case"Or":if(f)return!0;break;case"Not":return!f;default:return!0}}return N==="And"},n.OptionalContentConfig=m},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFDataTransportStream=void 0;var e=_(1),t=_(6);class i{constructor({length:u,initialData:d,progressiveDone:v=!1,contentDispositionFilename:T=null,disableRange:A=!1,disableStream:M=!1},F){if((0,e.assert)(F,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=v,this._contentDispositionFilename=T,d?.length>0){let S=d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength?d.buffer:new Uint8Array(d).buffer;this._queuedChunks.push(S)}this._pdfDataRangeTransport=F,this._isStreamingSupported=!M,this._isRangeSupported=!A,this._contentLength=u,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((S,b)=>{this._onReceiveData({begin:S,chunk:b})}),this._pdfDataRangeTransport.addProgressListener((S,b)=>{this._onProgress({loaded:S,total:b})}),this._pdfDataRangeTransport.addProgressiveReadListener(S=>{this._onReceiveData({chunk:S})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:u,chunk:d}){let v=d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength?d.buffer:new Uint8Array(d).buffer;if(u===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(v):this._queuedChunks.push(v);else{let T=this._rangeReaders.some(function(A){return A._begin!==u?!1:(A._enqueue(v),!0)});(0,e.assert)(T,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(u){u.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:u.loaded}):this._fullRequestReader?.onProgress?.({loaded:u.loaded,total:u.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(u){let d=this._rangeReaders.indexOf(u);d>=0&&this._rangeReaders.splice(d,1)}getFullReader(){(0,e.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let u=this._queuedChunks;return this._queuedChunks=null,new r(this,u,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(u,d){if(d<=this._progressiveDataLength)return null;let v=new m(this,u,d);return this._pdfDataRangeTransport.requestDataRange(u,d),this._rangeReaders.push(v),v}cancelAllRequests(u){this._fullRequestReader?.cancel(u);for(let d of this._rangeReaders.slice(0))d.cancel(u);this._pdfDataRangeTransport.abort()}}n.PDFDataTransportStream=i;class r{constructor(u,d,v=!1,T=null){this._stream=u,this._done=v||!1,this._filename=(0,t.isPdfFile)(T)?T:null,this._queuedChunks=d||[],this._loaded=0;for(let A of this._queuedChunks)this._loaded+=A.byteLength;this._requests=[],this._headersReady=Promise.resolve(),u._fullRequestReader=this,this.onProgress=null}_enqueue(u){this._done||(this._requests.length>0?this._requests.shift().resolve({value:u,done:!1}):this._queuedChunks.push(u),this._loaded+=u.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}read(){return Ue(this,null,function*(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let u=new e.PromiseCapability;return this._requests.push(u),u.promise})}cancel(u){this._done=!0;for(let d of this._requests)d.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class m{constructor(u,d,v){this._stream=u,this._begin=d,this._end=v,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(u){if(!this._done){if(this._requests.length===0)this._queuedChunk=u;else{this._requests.shift().resolve({value:u,done:!1});for(let v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}read(){return Ue(this,null,function*(){if(this._queuedChunk){let d=this._queuedChunk;return this._queuedChunk=null,{value:d,done:!1}}if(this._done)return{value:void 0,done:!0};let u=new e.PromiseCapability;return this._requests.push(u),u.promise})}cancel(u){this._done=!0;for(let d of this._requests)d.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFFetchStream=void 0;var e=_(1),t=_(20);function i(v,T,A){return{method:"GET",headers:v,signal:A.signal,mode:"cors",credentials:T?"include":"same-origin",redirect:"follow"}}function r(v){let T=new Headers;for(let A in v){let M=v[A];M!==void 0&&T.append(A,M)}return T}function m(v){return v instanceof Uint8Array?v.buffer:v instanceof ArrayBuffer?v:((0,e.warn)(`getArrayBuffer - unexpected data format: ${v}`),new Uint8Array(v).buffer)}class o{constructor(T){this.source=T,this.isHttp=/^https?:/i.test(T.url),this.httpHeaders=this.isHttp&&T.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new u(this),this._fullRequestReader}getRangeReader(T,A){if(A<=this._progressiveDataLength)return null;let M=new d(this,T,A);return this._rangeRequestReaders.push(M),M}cancelAllRequests(T){this._fullRequestReader?.cancel(T);for(let A of this._rangeRequestReaders.slice(0))A.cancel(T)}}n.PDFFetchStream=o;class u{constructor(T){this._stream=T,this._reader=null,this._loaded=0,this._filename=null;let A=T.source;this._withCredentials=A.withCredentials||!1,this._contentLength=A.length,this._headersCapability=new e.PromiseCapability,this._disableRange=A.disableRange||!1,this._rangeChunkSize=A.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!A.disableStream,this._isRangeSupported=!A.disableRange,this._headers=r(this._stream.httpHeaders);let M=A.url;fetch(M,i(this._headers,this._withCredentials,this._abortController)).then(F=>{if(!(0,t.validateResponseStatus)(F.status))throw(0,t.createResponseStatusError)(F.status,M);this._reader=F.body.getReader(),this._headersCapability.resolve();let S=L=>F.headers.get(L),{allowRangeRequests:b,suggestedLength:N}=(0,t.validateRangeRequestCapabilities)({getResponseHeader:S,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=b,this._contentLength=N||this._contentLength,this._filename=(0,t.extractFilenameFromHeader)(S),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new e.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){return Ue(this,null,function*(){yield this._headersCapability.promise;let{value:T,done:A}=yield this._reader.read();return A?{value:T,done:A}:(this._loaded+=T.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:m(T),done:!1})})}cancel(T){this._reader?.cancel(T),this._abortController.abort()}}class d{constructor(T,A,M){this._stream=T,this._reader=null,this._loaded=0;let F=T.source;this._withCredentials=F.withCredentials||!1,this._readCapability=new e.PromiseCapability,this._isStreamingSupported=!F.disableStream,this._abortController=new AbortController,this._headers=r(this._stream.httpHeaders),this._headers.append("Range",`bytes=${A}-${M-1}`);let S=F.url;fetch(S,i(this._headers,this._withCredentials,this._abortController)).then(b=>{if(!(0,t.validateResponseStatus)(b.status))throw(0,t.createResponseStatusError)(b.status,S);this._readCapability.resolve(),this._reader=b.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}read(){return Ue(this,null,function*(){yield this._readCapability.promise;let{value:T,done:A}=yield this._reader.read();return A?{value:T,done:A}:(this._loaded+=T.byteLength,this.onProgress?.({loaded:this._loaded}),{value:m(T),done:!1})})}cancel(T){this._reader?.cancel(T),this._abortController.abort()}}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createResponseStatusError=o,n.extractFilenameFromHeader=m,n.validateRangeRequestCapabilities=r,n.validateResponseStatus=u;var e=_(1),t=_(21),i=_(6);function r({getResponseHeader:d,isHttp:v,rangeChunkSize:T,disableRange:A}){let M={allowRangeRequests:!1,suggestedLength:void 0},F=parseInt(d("Content-Length"),10);return!Number.isInteger(F)||(M.suggestedLength=F,F<=2*T)||A||!v||d("Accept-Ranges")!=="bytes"||(d("Content-Encoding")||"identity")!=="identity"||(M.allowRangeRequests=!0),M}function m(d){let v=d("Content-Disposition");if(v){let T=(0,t.getFilenameFromContentDispositionHeader)(v);if(T.includes("%"))try{T=decodeURIComponent(T)}catch{}if((0,i.isPdfFile)(T))return T}return null}function o(d,v){return d===404||d===0&&v.startsWith("file:")?new e.MissingPDFException('Missing PDF "'+v+'".'):new e.UnexpectedResponseException(`Unexpected server response (${d}) while retrieving PDF "${v}".`,d)}function u(d){return d===200||d===206}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getFilenameFromContentDispositionHeader=t;var e=_(1);function t(i){let r=!0,m=o("filename\\*","i").exec(i);if(m){m=m[1];let F=T(m);return F=unescape(F),F=A(F),F=M(F),d(F)}if(m=v(i),m){let F=M(m);return d(F)}if(m=o("filename","i").exec(i),m){m=m[1];let F=T(m);return F=M(F),d(F)}function o(F,S){return new RegExp("(?:^|;)\\s*"+F+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',S)}function u(F,S){if(F){if(!/^[\x00-\xFF]+$/.test(S))return S;try{let b=new TextDecoder(F,{fatal:!0}),N=(0,e.stringToBytes)(S);S=b.decode(N),r=!1}catch{}}return S}function d(F){return r&&/[\x80-\xff]/.test(F)&&(F=u("utf-8",F),r&&(F=u("iso-8859-1",F))),F}function v(F){let S=[],b,N=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(b=N.exec(F))!==null;){let[,g,f,p]=b;if(g=parseInt(g,10),g in S){if(g===0)break;continue}S[g]=[f,p]}let L=[];for(let g=0;g<S.length&&g in S;++g){let[f,p]=S[g];p=T(p),f&&(p=unescape(p),g===0&&(p=A(p))),L.push(p)}return L.join("")}function T(F){if(F.startsWith('"')){let S=F.slice(1).split('\\"');for(let b=0;b<S.length;++b){let N=S[b].indexOf('"');N!==-1&&(S[b]=S[b].slice(0,N),S.length=b+1),S[b]=S[b].replaceAll(/\\(.)/g,"$1")}F=S.join('"')}return F}function A(F){let S=F.indexOf("'");if(S===-1)return F;let b=F.slice(0,S),L=F.slice(S+1).replace(/^[^']*'/,"");return u(b,L)}function M(F){return!F.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(F)?F:F.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(S,b,N,L){if(N==="q"||N==="Q")return L=L.replaceAll("_"," "),L=L.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,f){return String.fromCharCode(parseInt(f,16))}),u(b,L);try{L=atob(L)}catch{}return u(b,L)})}return""}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFNetworkStream=void 0;var e=_(1),t=_(20);let i=200,r=206;function m(T){let A=T.response;return typeof A!="string"?A:(0,e.stringToBytes)(A).buffer}class o{constructor(A,M={}){this.url=A,this.isHttp=/^https?:/i.test(A),this.httpHeaders=this.isHttp&&M.httpHeaders||Object.create(null),this.withCredentials=M.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(A,M,F){let S={begin:A,end:M};for(let b in F)S[b]=F[b];return this.request(S)}requestFull(A){return this.request(A)}request(A){let M=new XMLHttpRequest,F=this.currXhrId++,S=this.pendingRequests[F]={xhr:M};M.open("GET",this.url),M.withCredentials=this.withCredentials;for(let b in this.httpHeaders){let N=this.httpHeaders[b];N!==void 0&&M.setRequestHeader(b,N)}return this.isHttp&&"begin"in A&&"end"in A?(M.setRequestHeader("Range",`bytes=${A.begin}-${A.end-1}`),S.expectedStatus=r):S.expectedStatus=i,M.responseType="arraybuffer",A.onError&&(M.onerror=function(b){A.onError(M.status)}),M.onreadystatechange=this.onStateChange.bind(this,F),M.onprogress=this.onProgress.bind(this,F),S.onHeadersReceived=A.onHeadersReceived,S.onDone=A.onDone,S.onError=A.onError,S.onProgress=A.onProgress,M.send(null),F}onProgress(A,M){let F=this.pendingRequests[A];F&&F.onProgress?.(M)}onStateChange(A,M){let F=this.pendingRequests[A];if(!F)return;let S=F.xhr;if(S.readyState>=2&&F.onHeadersReceived&&(F.onHeadersReceived(),delete F.onHeadersReceived),S.readyState!==4||!(A in this.pendingRequests))return;if(delete this.pendingRequests[A],S.status===0&&this.isHttp){F.onError?.(S.status);return}let b=S.status||i;if(!(b===i&&F.expectedStatus===r)&&b!==F.expectedStatus){F.onError?.(S.status);return}let L=m(S);if(b===r){let g=S.getResponseHeader("Content-Range"),f=/bytes (\d+)-(\d+)\/(\d+)/.exec(g);F.onDone({begin:parseInt(f[1],10),chunk:L})}else L?F.onDone({begin:0,chunk:L}):F.onError?.(S.status)}getRequestXhr(A){return this.pendingRequests[A].xhr}isPendingRequest(A){return A in this.pendingRequests}abortRequest(A){let M=this.pendingRequests[A].xhr;delete this.pendingRequests[A],M.abort()}}class u{constructor(A){this._source=A,this._manager=new o(A.url,{httpHeaders:A.httpHeaders,withCredentials:A.withCredentials}),this._rangeChunkSize=A.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(A){let M=this._rangeRequestReaders.indexOf(A);M>=0&&this._rangeRequestReaders.splice(M,1)}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new d(this._manager,this._source),this._fullRequestReader}getRangeReader(A,M){let F=new v(this._manager,A,M);return F.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(F),F}cancelAllRequests(A){this._fullRequestReader?.cancel(A);for(let M of this._rangeRequestReaders.slice(0))M.cancel(A)}}n.PDFNetworkStream=u;class d{constructor(A,M){this._manager=A;let F={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=M.url,this._fullRequestId=A.requestFull(F),this._headersReceivedCapability=new e.PromiseCapability,this._disableRange=M.disableRange||!1,this._contentLength=M.length,this._rangeChunkSize=M.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(){let A=this._fullRequestId,M=this._manager.getRequestXhr(A),F=N=>M.getResponseHeader(N),{allowRangeRequests:S,suggestedLength:b}=(0,t.validateRangeRequestCapabilities)({getResponseHeader:F,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});S&&(this._isRangeSupported=!0),this._contentLength=b||this._contentLength,this._filename=(0,t.extractFilenameFromHeader)(F),this._isRangeSupported&&this._manager.abortRequest(A),this._headersReceivedCapability.resolve()}_onDone(A){if(A&&(this._requests.length>0?this._requests.shift().resolve({value:A.chunk,done:!1}):this._cachedChunks.push(A.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let M of this._requests)M.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(A){this._storedError=(0,t.createResponseStatusError)(A,this._url),this._headersReceivedCapability.reject(this._storedError);for(let M of this._requests)M.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(A){this.onProgress?.({loaded:A.loaded,total:A.lengthComputable?A.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}read(){return Ue(this,null,function*(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let A=new e.PromiseCapability;return this._requests.push(A),A.promise})}cancel(A){this._done=!0,this._headersReceivedCapability.reject(A);for(let M of this._requests)M.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class v{constructor(A,M,F){this._manager=A;let S={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=A.url,this._requestId=A.requestRange(M,F,S),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(A){let M=A.chunk;this._requests.length>0?this._requests.shift().resolve({value:M,done:!1}):this._queuedChunk=M,this._done=!0;for(let F of this._requests)F.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(A){this._storedError=(0,t.createResponseStatusError)(A,this._url);for(let M of this._requests)M.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(A){this.isStreamingSupported||this.onProgress?.({loaded:A.loaded})}get isStreamingSupported(){return!1}read(){return Ue(this,null,function*(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let M=this._queuedChunk;return this._queuedChunk=null,{value:M,done:!1}}if(this._done)return{value:void 0,done:!0};let A=new e.PromiseCapability;return this._requests.push(A),A.promise})}cancel(A){this._done=!0;for(let M of this._requests)M.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFNodeStream=void 0;var e=_(1),t=_(20);let i=/^file:\/\/\/[a-zA-Z]:\//;function r(F){let S=tl(),b=S.parse(F);return b.protocol==="file:"||b.host?b:/^[a-z]:[/\\]/i.test(F)?S.parse(`file:///${F}`):(b.host||(b.protocol="file:"),b)}class m{constructor(S){this.source=S,this.url=r(S.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&S.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new A(this):new v(this),this._fullRequestReader}getRangeReader(S,b){if(b<=this._progressiveDataLength)return null;let N=this.isFsUrl?new M(this,S,b):new T(this,S,b);return this._rangeRequestReaders.push(N),N}cancelAllRequests(S){this._fullRequestReader?.cancel(S);for(let b of this._rangeRequestReaders.slice(0))b.cancel(S)}}n.PDFNodeStream=m;class o{constructor(S){this._url=S.url,this._done=!1,this._storedError=null,this.onProgress=null;let b=S.source;this._contentLength=b.length,this._loaded=0,this._filename=null,this._disableRange=b.disableRange||!1,this._rangeChunkSize=b.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!b.disableStream,this._isRangeSupported=!b.disableRange,this._readableStream=null,this._readCapability=new e.PromiseCapability,this._headersCapability=new e.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){return Ue(this,null,function*(){if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let S=this._readableStream.read();return S===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=S.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(S).buffer,done:!1})})}cancel(S){if(!this._readableStream){this._error(S);return}this._readableStream.destroy(S)}_error(S){this._storedError=S,this._readCapability.resolve()}_setReadableStream(S){this._readableStream=S,S.on("readable",()=>{this._readCapability.resolve()}),S.on("end",()=>{S.destroy(),this._done=!0,this._readCapability.resolve()}),S.on("error",b=>{this._error(b)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new e.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class u{constructor(S){this._url=S.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new e.PromiseCapability;let b=S.source;this._isStreamingSupported=!b.disableStream}get isStreamingSupported(){return this._isStreamingSupported}read(){return Ue(this,null,function*(){if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let S=this._readableStream.read();return S===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=S.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(S).buffer,done:!1})})}cancel(S){if(!this._readableStream){this._error(S);return}this._readableStream.destroy(S)}_error(S){this._storedError=S,this._readCapability.resolve()}_setReadableStream(S){this._readableStream=S,S.on("readable",()=>{this._readCapability.resolve()}),S.on("end",()=>{S.destroy(),this._done=!0,this._readCapability.resolve()}),S.on("error",b=>{this._error(b)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function d(F,S){return{protocol:F.protocol,auth:F.auth,host:F.hostname,port:F.port,path:F.path,method:"GET",headers:S}}class v extends o{constructor(S){super(S);let b=N=>{if(N.statusCode===404){let p=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=p,this._headersCapability.reject(p);return}this._headersCapability.resolve(),this._setReadableStream(N);let L=p=>this._readableStream.headers[p.toLowerCase()],{allowRangeRequests:g,suggestedLength:f}=(0,t.validateRangeRequestCapabilities)({getResponseHeader:L,isHttp:S.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=g,this._contentLength=f||this._contentLength,this._filename=(0,t.extractFilenameFromHeader)(L)};if(this._request=null,this._url.protocol==="http:"){let N=Ps();this._request=N.request(d(this._url,S.httpHeaders),b)}else{let N=Es();this._request=N.request(d(this._url,S.httpHeaders),b)}this._request.on("error",N=>{this._storedError=N,this._headersCapability.reject(N)}),this._request.end()}}class T extends u{constructor(S,b,N){super(S),this._httpHeaders={};for(let g in S.httpHeaders){let f=S.httpHeaders[g];f!==void 0&&(this._httpHeaders[g]=f)}this._httpHeaders.Range=`bytes=${b}-${N-1}`;let L=g=>{if(g.statusCode===404){let f=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=f;return}this._setReadableStream(g)};if(this._request=null,this._url.protocol==="http:"){let g=Ps();this._request=g.request(d(this._url,this._httpHeaders),L)}else{let g=Es();this._request=g.request(d(this._url,this._httpHeaders),L)}this._request.on("error",g=>{this._storedError=g}),this._request.end()}}class A extends o{constructor(S){super(S);let b=decodeURIComponent(this._url.path);i.test(this._url.href)&&(b=b.replace(/^\//,""));let N=Hn();N.lstat(b,(L,g)=>{if(L){L.code==="ENOENT"&&(L=new e.MissingPDFException(`Missing PDF "${b}".`)),this._storedError=L,this._headersCapability.reject(L);return}this._contentLength=g.size,this._setReadableStream(N.createReadStream(b)),this._headersCapability.resolve()})}}class M extends u{constructor(S,b,N){super(S);let L=decodeURIComponent(this._url.path);i.test(this._url.href)&&(L=L.replace(/^\//,""));let g=Hn();this._setReadableStream(g.createReadStream(L,{start:b,end:N-1}))}}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SVGGraphics=void 0;var e=_(6),t=_(1);let i={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},r="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/1999/xlink",o=["butt","round","square"],u=["miter","round","bevel"],d=function(g,f="",p=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!p)return URL.createObjectURL(new Blob([g],{type:f}));let C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",P=`data:${f};base64,`;for(let k=0,R=g.length;k<R;k+=3){let W=g[k]&255,w=g[k+1]&255,D=g[k+2]&255,V=W>>2,U=(W&3)<<4|w>>4,q=k+1<R?(w&15)<<2|D>>6:64,$=k+2<R?D&63:64;P+=C[V]+C[U]+C[q]+C[$]}return P},v=function(){let g=new Uint8Array([137,80,78,71,13,10,26,10]),f=12,p=new Int32Array(256);for(let D=0;D<256;D++){let V=D;for(let U=0;U<8;U++)V=V&1?3988292384^V>>1&2147483647:V>>1&2147483647;p[D]=V}function C(D,V,U){let q=-1;for(let $=V;$<U;$++){let x=(q^D[$])&255,a=p[x];q=q>>>8^a}return q^-1}function P(D,V,U,q){let $=q,x=V.length;U[$]=x>>24&255,U[$+1]=x>>16&255,U[$+2]=x>>8&255,U[$+3]=x&255,$+=4,U[$]=D.charCodeAt(0)&255,U[$+1]=D.charCodeAt(1)&255,U[$+2]=D.charCodeAt(2)&255,U[$+3]=D.charCodeAt(3)&255,$+=4,U.set(V,$),$+=V.length;let a=C(U,q+4,$);U[$]=a>>24&255,U[$+1]=a>>16&255,U[$+2]=a>>8&255,U[$+3]=a&255}function k(D,V,U){let q=1,$=0;for(let x=V;x<U;++x)q=(q+(D[x]&255))%65521,$=($+q)%65521;return $<<16|q}function R(D){if(!t.isNodeJS)return W(D);try{let V=parseInt(process.versions.node)>=8?D:Buffer.from(D),U=il().deflateSync(V,{level:9});return U instanceof Uint8Array?U:new Uint8Array(U)}catch(V){(0,t.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+V)}return W(D)}function W(D){let V=D.length,U=65535,q=Math.ceil(V/U),$=new Uint8Array(2+V+q*5+4),x=0;$[x++]=120,$[x++]=156;let a=0;for(;V>U;)$[x++]=0,$[x++]=255,$[x++]=255,$[x++]=0,$[x++]=0,$.set(D.subarray(a,a+U),x),x+=U,a+=U,V-=U;$[x++]=1,$[x++]=V&255,$[x++]=V>>8&255,$[x++]=~V&65535&255,$[x++]=(~V&65535)>>8&255,$.set(D.subarray(a),x),x+=D.length-a;let c=k(D,0,D.length);return $[x++]=c>>24&255,$[x++]=c>>16&255,$[x++]=c>>8&255,$[x++]=c&255,$}function w(D,V,U,q){let $=D.width,x=D.height,a,c,E,B=D.data;switch(V){case t.ImageKind.GRAYSCALE_1BPP:c=0,a=1,E=$+7>>3;break;case t.ImageKind.RGB_24BPP:c=2,a=8,E=$*3;break;case t.ImageKind.RGBA_32BPP:c=6,a=8,E=$*4;break;default:throw new Error("invalid format")}let O=new Uint8Array((1+E)*x),Y=0,Z=0;for(let xe=0;xe<x;++xe)O[Y++]=0,O.set(B.subarray(Z,Z+E),Y),Z+=E,Y+=E;if(V===t.ImageKind.GRAYSCALE_1BPP&&q){Y=0;for(let xe=0;xe<x;xe++){Y++;for(let Se=0;Se<E;Se++)O[Y++]^=255}}let X=new Uint8Array([$>>24&255,$>>16&255,$>>8&255,$&255,x>>24&255,x>>16&255,x>>8&255,x&255,a,c,0,0,0]),ie=R(O),ne=g.length+f*3+X.length+ie.length,de=new Uint8Array(ne),me=0;return de.set(g,me),me+=g.length,P("IHDR",X,de,me),me+=f+X.length,P("IDATA",ie,de,me),me+=f+ie.length,P("IEND",new Uint8Array(0),de,me),d(de,"image/png",U)}return function(V,U,q){let $=V.kind===void 0?t.ImageKind.GRAYSCALE_1BPP:V.kind;return w(V,$,U,q)}}();class T{constructor(){this.fontSizeScale=1,this.fontWeight=i.fontWeight,this.fontSize=0,this.textMatrix=t.IDENTITY_MATRIX,this.fontMatrix=t.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=t.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=i.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(f,p){this.x=f,this.y=p}}function A(g){let f=[],p=[];for(let C of g){if(C.fn==="save"){f.push({fnId:92,fn:"group",items:[]}),p.push(f),f=f.at(-1).items;continue}C.fn==="restore"?f=p.pop():f.push(C)}return f}function M(g){if(Number.isInteger(g))return g.toString();let f=g.toFixed(10),p=f.length-1;if(f[p]!=="0")return f;do p--;while(f[p]==="0");return f.substring(0,f[p]==="."?p:p+1)}function F(g){if(g[4]===0&&g[5]===0){if(g[1]===0&&g[2]===0)return g[0]===1&&g[3]===1?"":`scale(${M(g[0])} ${M(g[3])})`;if(g[0]===g[3]&&g[1]===-g[2]){let f=Math.acos(g[0])*180/Math.PI;return`rotate(${M(f)})`}}else if(g[0]===1&&g[1]===0&&g[2]===0&&g[3]===1)return`translate(${M(g[4])} ${M(g[5])})`;return`matrix(${M(g[0])} ${M(g[1])} ${M(g[2])} ${M(g[3])} ${M(g[4])} ${M(g[5])})`}let S=0,b=0,N=0;class L{constructor(f,p,C=!1){(0,e.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new e.DOMSVGFactory,this.current=new T,this.transformMatrix=t.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=f,this.objs=p,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!C,this._operatorIdMapping=[];for(let P in t.OPS)this._operatorIdMapping[t.OPS[P]]=P}getObject(f,p=null){return typeof f=="string"?f.startsWith("g_")?this.commonObjs.get(f):this.objs.get(f):p}save(){this.transformStack.push(this.transformMatrix);let f=this.current;this.extraStack.push(f),this.current=f.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(f){this.save(),this.executeOpTree(f),this.restore()}loadDependencies(f){let p=f.fnArray,C=f.argsArray;for(let P=0,k=p.length;P<k;P++)if(p[P]===t.OPS.dependency)for(let R of C[P]){let W=R.startsWith("g_")?this.commonObjs:this.objs,w=new Promise(D=>{W.get(R,D)});this.current.dependencies.push(w)}return Promise.all(this.current.dependencies)}transform(f,p,C,P,k,R){let W=[f,p,C,P,k,R];this.transformMatrix=t.Util.transform(this.transformMatrix,W),this.tgrp=null}getSVG(f,p){this.viewport=p;let C=this._initialize(p);return this.loadDependencies(f).then(()=>(this.transformMatrix=t.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(f)),C))}convertOpList(f){let p=this._operatorIdMapping,C=f.argsArray,P=f.fnArray,k=[];for(let R=0,W=P.length;R<W;R++){let w=P[R];k.push({fnId:w,fn:p[w],args:C[R]})}return A(k)}executeOpTree(f){for(let p of f){let C=p.fn,P=p.fnId,k=p.args;switch(P|0){case t.OPS.beginText:this.beginText();break;case t.OPS.dependency:break;case t.OPS.setLeading:this.setLeading(k);break;case t.OPS.setLeadingMoveText:this.setLeadingMoveText(k[0],k[1]);break;case t.OPS.setFont:this.setFont(k);break;case t.OPS.showText:this.showText(k[0]);break;case t.OPS.showSpacedText:this.showText(k[0]);break;case t.OPS.endText:this.endText();break;case t.OPS.moveText:this.moveText(k[0],k[1]);break;case t.OPS.setCharSpacing:this.setCharSpacing(k[0]);break;case t.OPS.setWordSpacing:this.setWordSpacing(k[0]);break;case t.OPS.setHScale:this.setHScale(k[0]);break;case t.OPS.setTextMatrix:this.setTextMatrix(k[0],k[1],k[2],k[3],k[4],k[5]);break;case t.OPS.setTextRise:this.setTextRise(k[0]);break;case t.OPS.setTextRenderingMode:this.setTextRenderingMode(k[0]);break;case t.OPS.setLineWidth:this.setLineWidth(k[0]);break;case t.OPS.setLineJoin:this.setLineJoin(k[0]);break;case t.OPS.setLineCap:this.setLineCap(k[0]);break;case t.OPS.setMiterLimit:this.setMiterLimit(k[0]);break;case t.OPS.setFillRGBColor:this.setFillRGBColor(k[0],k[1],k[2]);break;case t.OPS.setStrokeRGBColor:this.setStrokeRGBColor(k[0],k[1],k[2]);break;case t.OPS.setStrokeColorN:this.setStrokeColorN(k);break;case t.OPS.setFillColorN:this.setFillColorN(k);break;case t.OPS.shadingFill:this.shadingFill(k[0]);break;case t.OPS.setDash:this.setDash(k[0],k[1]);break;case t.OPS.setRenderingIntent:this.setRenderingIntent(k[0]);break;case t.OPS.setFlatness:this.setFlatness(k[0]);break;case t.OPS.setGState:this.setGState(k[0]);break;case t.OPS.fill:this.fill();break;case t.OPS.eoFill:this.eoFill();break;case t.OPS.stroke:this.stroke();break;case t.OPS.fillStroke:this.fillStroke();break;case t.OPS.eoFillStroke:this.eoFillStroke();break;case t.OPS.clip:this.clip("nonzero");break;case t.OPS.eoClip:this.clip("evenodd");break;case t.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case t.OPS.paintImageXObject:this.paintImageXObject(k[0]);break;case t.OPS.paintInlineImageXObject:this.paintInlineImageXObject(k[0]);break;case t.OPS.paintImageMaskXObject:this.paintImageMaskXObject(k[0]);break;case t.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(k[0],k[1]);break;case t.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case t.OPS.closePath:this.closePath();break;case t.OPS.closeStroke:this.closeStroke();break;case t.OPS.closeFillStroke:this.closeFillStroke();break;case t.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case t.OPS.nextLine:this.nextLine();break;case t.OPS.transform:this.transform(k[0],k[1],k[2],k[3],k[4],k[5]);break;case t.OPS.constructPath:this.constructPath(k[0],k[1]);break;case t.OPS.endPath:this.endPath();break;case 92:this.group(p.items);break;default:(0,t.warn)(`Unimplemented operator ${C}`);break}}}setWordSpacing(f){this.current.wordSpacing=f}setCharSpacing(f){this.current.charSpacing=f}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(f,p,C,P,k,R){let W=this.current;W.textMatrix=W.lineMatrix=[f,p,C,P,k,R],W.textMatrixScale=Math.hypot(f,p),W.x=W.lineX=0,W.y=W.lineY=0,W.xcoords=[],W.ycoords=[],W.tspan=this.svgFactory.createElement("svg:tspan"),W.tspan.setAttributeNS(null,"font-family",W.fontFamily),W.tspan.setAttributeNS(null,"font-size",`${M(W.fontSize)}px`),W.tspan.setAttributeNS(null,"y",M(-W.y)),W.txtElement=this.svgFactory.createElement("svg:text"),W.txtElement.append(W.tspan)}beginText(){let f=this.current;f.x=f.lineX=0,f.y=f.lineY=0,f.textMatrix=t.IDENTITY_MATRIX,f.lineMatrix=t.IDENTITY_MATRIX,f.textMatrixScale=1,f.tspan=this.svgFactory.createElement("svg:tspan"),f.txtElement=this.svgFactory.createElement("svg:text"),f.txtgrp=this.svgFactory.createElement("svg:g"),f.xcoords=[],f.ycoords=[]}moveText(f,p){let C=this.current;C.x=C.lineX+=f,C.y=C.lineY+=p,C.xcoords=[],C.ycoords=[],C.tspan=this.svgFactory.createElement("svg:tspan"),C.tspan.setAttributeNS(null,"font-family",C.fontFamily),C.tspan.setAttributeNS(null,"font-size",`${M(C.fontSize)}px`),C.tspan.setAttributeNS(null,"y",M(-C.y))}showText(f){let p=this.current,C=p.font,P=p.fontSize;if(P===0)return;let k=p.fontSizeScale,R=p.charSpacing,W=p.wordSpacing,w=p.fontDirection,D=p.textHScale*w,V=C.vertical,U=V?1:-1,q=C.defaultVMetrics,$=P*p.fontMatrix[0],x=0;for(let E of f){if(E===null){x+=w*W;continue}else if(typeof E=="number"){x+=U*E*P/1e3;continue}let B=(E.isSpace?W:0)+R,O=E.fontChar,Y,Z,X=E.width;if(V){let ne,de=E.vmetric||q;ne=E.vmetric?de[1]:X*.5,ne=-ne*$;let me=de[2]*$;X=de?-de[0]:X,Y=ne/k,Z=(x+me)/k}else Y=x/k,Z=0;(E.isInFont||C.missingFile)&&(p.xcoords.push(p.x+Y),V&&p.ycoords.push(-p.y+Z),p.tspan.textContent+=O);let ie=V?X*$-B*w:X*$+B*w;x+=ie}p.tspan.setAttributeNS(null,"x",p.xcoords.map(M).join(" ")),V?p.tspan.setAttributeNS(null,"y",p.ycoords.map(M).join(" ")):p.tspan.setAttributeNS(null,"y",M(-p.y)),V?p.y-=x:p.x+=x*D,p.tspan.setAttributeNS(null,"font-family",p.fontFamily),p.tspan.setAttributeNS(null,"font-size",`${M(p.fontSize)}px`),p.fontStyle!==i.fontStyle&&p.tspan.setAttributeNS(null,"font-style",p.fontStyle),p.fontWeight!==i.fontWeight&&p.tspan.setAttributeNS(null,"font-weight",p.fontWeight);let a=p.textRenderingMode&t.TextRenderingMode.FILL_STROKE_MASK;if(a===t.TextRenderingMode.FILL||a===t.TextRenderingMode.FILL_STROKE?(p.fillColor!==i.fillColor&&p.tspan.setAttributeNS(null,"fill",p.fillColor),p.fillAlpha<1&&p.tspan.setAttributeNS(null,"fill-opacity",p.fillAlpha)):p.textRenderingMode===t.TextRenderingMode.ADD_TO_PATH?p.tspan.setAttributeNS(null,"fill","transparent"):p.tspan.setAttributeNS(null,"fill","none"),a===t.TextRenderingMode.STROKE||a===t.TextRenderingMode.FILL_STROKE){let E=1/(p.textMatrixScale||1);this._setStrokeAttributes(p.tspan,E)}let c=p.textMatrix;p.textRise!==0&&(c=c.slice(),c[5]+=p.textRise),p.txtElement.setAttributeNS(null,"transform",`${F(c)} scale(${M(D)}, -1)`),p.txtElement.setAttributeNS(r,"xml:space","preserve"),p.txtElement.append(p.tspan),p.txtgrp.append(p.txtElement),this._ensureTransformGroup().append(p.txtElement)}setLeadingMoveText(f,p){this.setLeading(-p),this.moveText(f,p)}addFontStyle(f){if(!f.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));let p=d(f.data,f.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${f.loadedName}"; src: url(${p}); }
`}setFont(f){let p=this.current,C=this.commonObjs.get(f[0]),P=f[1];p.font=C,this.embedFonts&&!C.missingFile&&!this.embeddedFonts[C.loadedName]&&(this.addFontStyle(C),this.embeddedFonts[C.loadedName]=C),p.fontMatrix=C.fontMatrix||t.FONT_IDENTITY_MATRIX;let k="normal";C.black?k="900":C.bold&&(k="bold");let R=C.italic?"italic":"normal";P<0?(P=-P,p.fontDirection=-1):p.fontDirection=1,p.fontSize=P,p.fontFamily=C.loadedName,p.fontWeight=k,p.fontStyle=R,p.tspan=this.svgFactory.createElement("svg:tspan"),p.tspan.setAttributeNS(null,"y",M(-p.y)),p.xcoords=[],p.ycoords=[]}endText(){let f=this.current;f.textRenderingMode&t.TextRenderingMode.ADD_TO_PATH_FLAG&&f.txtElement?.hasChildNodes()&&(f.element=f.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(f){f>0&&(this.current.lineWidth=f)}setLineCap(f){this.current.lineCap=o[f]}setLineJoin(f){this.current.lineJoin=u[f]}setMiterLimit(f){this.current.miterLimit=f}setStrokeAlpha(f){this.current.strokeAlpha=f}setStrokeRGBColor(f,p,C){this.current.strokeColor=t.Util.makeHexColor(f,p,C)}setFillAlpha(f){this.current.fillAlpha=f}setFillRGBColor(f,p,C){this.current.fillColor=t.Util.makeHexColor(f,p,C),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(f){this.current.strokeColor=this._makeColorN_Pattern(f)}setFillColorN(f){this.current.fillColor=this._makeColorN_Pattern(f)}shadingFill(f){let{width:p,height:C}=this.viewport,P=t.Util.inverseTransform(this.transformMatrix),[k,R,W,w]=t.Util.getAxialAlignedBoundingBox([0,0,p,C],P),D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x",k),D.setAttributeNS(null,"y",R),D.setAttributeNS(null,"width",W-k),D.setAttributeNS(null,"height",w-R),D.setAttributeNS(null,"fill",this._makeShadingPattern(f)),this.current.fillAlpha<1&&D.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(D)}_makeColorN_Pattern(f){return f[0]==="TilingPattern"?this._makeTilingPattern(f):this._makeShadingPattern(f)}_makeTilingPattern(f){let p=f[1],C=f[2],P=f[3]||t.IDENTITY_MATRIX,[k,R,W,w]=f[4],D=f[5],V=f[6],U=f[7],q=`shading${N++}`,[$,x,a,c]=t.Util.normalizeRect([...t.Util.applyTransform([k,R],P),...t.Util.applyTransform([W,w],P)]),[E,B]=t.Util.singularValueDecompose2dScale(P),O=D*E,Y=V*B,Z=this.svgFactory.createElement("svg:pattern");Z.setAttributeNS(null,"id",q),Z.setAttributeNS(null,"patternUnits","userSpaceOnUse"),Z.setAttributeNS(null,"width",O),Z.setAttributeNS(null,"height",Y),Z.setAttributeNS(null,"x",`${$}`),Z.setAttributeNS(null,"y",`${x}`);let X=this.svg,ie=this.transformMatrix,ne=this.current.fillColor,de=this.current.strokeColor,me=this.svgFactory.create(a-$,c-x);if(this.svg=me,this.transformMatrix=P,U===2){let xe=t.Util.makeHexColor(...p);this.current.fillColor=xe,this.current.strokeColor=xe}return this.executeOpTree(this.convertOpList(C)),this.svg=X,this.transformMatrix=ie,this.current.fillColor=ne,this.current.strokeColor=de,Z.append(me.childNodes[0]),this.defs.append(Z),`url(#${q})`}_makeShadingPattern(f){switch(typeof f=="string"&&(f=this.objs.get(f)),f[0]){case"RadialAxial":let p=`shading${N++}`,C=f[3],P;switch(f[1]){case"axial":let k=f[4],R=f[5];P=this.svgFactory.createElement("svg:linearGradient"),P.setAttributeNS(null,"id",p),P.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),P.setAttributeNS(null,"x1",k[0]),P.setAttributeNS(null,"y1",k[1]),P.setAttributeNS(null,"x2",R[0]),P.setAttributeNS(null,"y2",R[1]);break;case"radial":let W=f[4],w=f[5],D=f[6],V=f[7];P=this.svgFactory.createElement("svg:radialGradient"),P.setAttributeNS(null,"id",p),P.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),P.setAttributeNS(null,"cx",w[0]),P.setAttributeNS(null,"cy",w[1]),P.setAttributeNS(null,"r",V),P.setAttributeNS(null,"fx",W[0]),P.setAttributeNS(null,"fy",W[1]),P.setAttributeNS(null,"fr",D);break;default:throw new Error(`Unknown RadialAxial type: ${f[1]}`)}for(let k of C){let R=this.svgFactory.createElement("svg:stop");R.setAttributeNS(null,"offset",k[0]),R.setAttributeNS(null,"stop-color",k[1]),P.append(R)}return this.defs.append(P),`url(#${p})`;case"Mesh":return(0,t.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${f[0]}`)}}setDash(f,p){this.current.dashArray=f,this.current.dashPhase=p}constructPath(f,p){let C=this.current,P=C.x,k=C.y,R=[],W=0;for(let w of f)switch(w|0){case t.OPS.rectangle:P=p[W++],k=p[W++];let D=p[W++],V=p[W++],U=P+D,q=k+V;R.push("M",M(P),M(k),"L",M(U),M(k),"L",M(U),M(q),"L",M(P),M(q),"Z");break;case t.OPS.moveTo:P=p[W++],k=p[W++],R.push("M",M(P),M(k));break;case t.OPS.lineTo:P=p[W++],k=p[W++],R.push("L",M(P),M(k));break;case t.OPS.curveTo:P=p[W+4],k=p[W+5],R.push("C",M(p[W]),M(p[W+1]),M(p[W+2]),M(p[W+3]),M(P),M(k)),W+=6;break;case t.OPS.curveTo2:R.push("C",M(P),M(k),M(p[W]),M(p[W+1]),M(p[W+2]),M(p[W+3])),P=p[W+2],k=p[W+3],W+=4;break;case t.OPS.curveTo3:P=p[W+2],k=p[W+3],R.push("C",M(p[W]),M(p[W+1]),M(P),M(k),M(P),M(k)),W+=4;break;case t.OPS.closePath:R.push("Z");break}R=R.join(" "),C.path&&f.length>0&&f[0]!==t.OPS.rectangle&&f[0]!==t.OPS.moveTo?R=C.path.getAttributeNS(null,"d")+R:(C.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(C.path)),C.path.setAttributeNS(null,"d",R),C.path.setAttributeNS(null,"fill","none"),C.element=C.path,C.setCurrentPoint(P,k)}endPath(){let f=this.current;if(f.path=null,!this.pendingClip)return;if(!f.element){this.pendingClip=null;return}let p=`clippath${S++}`,C=this.svgFactory.createElement("svg:clipPath");C.setAttributeNS(null,"id",p),C.setAttributeNS(null,"transform",F(this.transformMatrix));let P=f.element.cloneNode(!0);if(this.pendingClip==="evenodd"?P.setAttributeNS(null,"clip-rule","evenodd"):P.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,C.append(P),this.defs.append(C),f.activeClipUrl){f.clipGroup=null;for(let k of this.extraStack)k.clipGroup=null;C.setAttributeNS(null,"clip-path",f.activeClipUrl)}f.activeClipUrl=`url(#${p})`,this.tgrp=null}clip(f){this.pendingClip=f}closePath(){let f=this.current;if(f.path){let p=`${f.path.getAttributeNS(null,"d")}Z`;f.path.setAttributeNS(null,"d",p)}}setLeading(f){this.current.leading=-f}setTextRise(f){this.current.textRise=f}setTextRenderingMode(f){this.current.textRenderingMode=f}setHScale(f){this.current.textHScale=f/100}setRenderingIntent(f){}setFlatness(f){}setGState(f){for(let[p,C]of f)switch(p){case"LW":this.setLineWidth(C);break;case"LC":this.setLineCap(C);break;case"LJ":this.setLineJoin(C);break;case"ML":this.setMiterLimit(C);break;case"D":this.setDash(C[0],C[1]);break;case"RI":this.setRenderingIntent(C);break;case"FL":this.setFlatness(C);break;case"Font":this.setFont(C);break;case"CA":this.setStrokeAlpha(C);break;case"ca":this.setFillAlpha(C);break;default:(0,t.warn)(`Unimplemented graphic state operator ${p}`);break}}fill(){let f=this.current;f.element&&(f.element.setAttributeNS(null,"fill",f.fillColor),f.element.setAttributeNS(null,"fill-opacity",f.fillAlpha),this.endPath())}stroke(){let f=this.current;f.element&&(this._setStrokeAttributes(f.element),f.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(f,p=1){let C=this.current,P=C.dashArray;p!==1&&P.length>0&&(P=P.map(function(k){return p*k})),f.setAttributeNS(null,"stroke",C.strokeColor),f.setAttributeNS(null,"stroke-opacity",C.strokeAlpha),f.setAttributeNS(null,"stroke-miterlimit",M(C.miterLimit)),f.setAttributeNS(null,"stroke-linecap",C.lineCap),f.setAttributeNS(null,"stroke-linejoin",C.lineJoin),f.setAttributeNS(null,"stroke-width",M(p*C.lineWidth)+"px"),f.setAttributeNS(null,"stroke-dasharray",P.map(M).join(" ")),f.setAttributeNS(null,"stroke-dashoffset",M(p*C.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){let f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x","0"),f.setAttributeNS(null,"y","0"),f.setAttributeNS(null,"width","1px"),f.setAttributeNS(null,"height","1px"),f.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(f)}paintImageXObject(f){let p=this.getObject(f);if(!p){(0,t.warn)(`Dependent image with object ID ${f} is not ready yet`);return}this.paintInlineImageXObject(p)}paintInlineImageXObject(f,p){let C=f.width,P=f.height,k=v(f,this.forceDataSchema,!!p),R=this.svgFactory.createElement("svg:rect");R.setAttributeNS(null,"x","0"),R.setAttributeNS(null,"y","0"),R.setAttributeNS(null,"width",M(C)),R.setAttributeNS(null,"height",M(P)),this.current.element=R,this.clip("nonzero");let W=this.svgFactory.createElement("svg:image");W.setAttributeNS(m,"xlink:href",k),W.setAttributeNS(null,"x","0"),W.setAttributeNS(null,"y",M(-P)),W.setAttributeNS(null,"width",M(C)+"px"),W.setAttributeNS(null,"height",M(P)+"px"),W.setAttributeNS(null,"transform",`scale(${M(1/C)} ${M(-1/P)})`),p?p.append(W):this._ensureTransformGroup().append(W)}paintImageMaskXObject(f){let p=this.getObject(f.data,f);if(p.bitmap){(0,t.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}let C=this.current,P=p.width,k=p.height,R=C.fillColor;C.maskId=`mask${b++}`;let W=this.svgFactory.createElement("svg:mask");W.setAttributeNS(null,"id",C.maskId);let w=this.svgFactory.createElement("svg:rect");w.setAttributeNS(null,"x","0"),w.setAttributeNS(null,"y","0"),w.setAttributeNS(null,"width",M(P)),w.setAttributeNS(null,"height",M(k)),w.setAttributeNS(null,"fill",R),w.setAttributeNS(null,"mask",`url(#${C.maskId})`),this.defs.append(W),this._ensureTransformGroup().append(w),this.paintInlineImageXObject(p,W)}paintFormXObjectBegin(f,p){if(Array.isArray(f)&&f.length===6&&this.transform(f[0],f[1],f[2],f[3],f[4],f[5]),p){let C=p[2]-p[0],P=p[3]-p[1],k=this.svgFactory.createElement("svg:rect");k.setAttributeNS(null,"x",p[0]),k.setAttributeNS(null,"y",p[1]),k.setAttributeNS(null,"width",M(C)),k.setAttributeNS(null,"height",M(P)),this.current.element=k,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(f){let p=this.svgFactory.create(f.width,f.height),C=this.svgFactory.createElement("svg:defs");p.append(C),this.defs=C;let P=this.svgFactory.createElement("svg:g");return P.setAttributeNS(null,"transform",F(f.transform)),p.append(P),this.svg=P,p}_ensureClipGroup(){if(!this.current.clipGroup){let f=this.svgFactory.createElement("svg:g");f.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(f),this.current.clipGroup=f}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",F(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}n.SVGGraphics=L},(h,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.XfaText=void 0;class _{static textContent(t){let i=[],r={items:i,styles:Object.create(null)};function m(o){if(!o)return;let u=null,d=o.name;if(d==="#text")u=o.value;else if(_.shouldBuildText(d))o?.attributes?.textContent?u=o.attributes.textContent:o.value&&(u=o.value);else return;if(u!==null&&i.push({str:u}),!!o.children)for(let v of o.children)m(v)}return m(t),r}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}n.XfaText=_},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextLayerRenderTask=void 0,n.renderTextLayer=F,n.updateTextLayer=S;var e=_(1),t=_(6);let i=1e5,r=30,m=.8,o=new Map;function u(b,N){let L;if(N&&e.FeatureTest.isOffscreenCanvasSupported)L=new OffscreenCanvas(b,b).getContext("2d",{alpha:!1});else{let g=document.createElement("canvas");g.width=g.height=b,L=g.getContext("2d",{alpha:!1})}return L}function d(b,N){let L=o.get(b);if(L)return L;let g=u(r,N);g.font=`${r}px ${b}`;let f=g.measureText(""),p=f.fontBoundingBoxAscent,C=Math.abs(f.fontBoundingBoxDescent);if(p){let k=p/(p+C);return o.set(b,k),g.canvas.width=g.canvas.height=0,k}g.strokeStyle="red",g.clearRect(0,0,r,r),g.strokeText("g",0,0);let P=g.getImageData(0,0,r,r).data;C=0;for(let k=P.length-1-3;k>=0;k-=4)if(P[k]>0){C=Math.ceil(k/4/r);break}g.clearRect(0,0,r,r),g.strokeText("A",0,r),P=g.getImageData(0,0,r,r).data,p=0;for(let k=0,R=P.length;k<R;k+=4)if(P[k]>0){p=r-Math.floor(k/4/r);break}if(g.canvas.width=g.canvas.height=0,p){let k=p/(p+C);return o.set(b,k),k}return o.set(b,m),m}function v(b,N,L){let g=document.createElement("span"),f={angle:0,canvasWidth:0,hasText:N.str!=="",hasEOL:N.hasEOL,fontSize:0};b._textDivs.push(g);let p=e.Util.transform(b._transform,N.transform),C=Math.atan2(p[1],p[0]),P=L[N.fontName];P.vertical&&(C+=Math.PI/2);let k=Math.hypot(p[2],p[3]),R=k*d(P.fontFamily,b._isOffscreenCanvasSupported),W,w;C===0?(W=p[4],w=p[5]-R):(W=p[4]+R*Math.sin(C),w=p[5]-R*Math.cos(C));let D="calc(var(--scale-factor)*",V=g.style;b._container===b._rootContainer?(V.left=`${(100*W/b._pageWidth).toFixed(2)}%`,V.top=`${(100*w/b._pageHeight).toFixed(2)}%`):(V.left=`${D}${W.toFixed(2)}px)`,V.top=`${D}${w.toFixed(2)}px)`),V.fontSize=`${D}${k.toFixed(2)}px)`,V.fontFamily=P.fontFamily,f.fontSize=k,g.setAttribute("role","presentation"),g.textContent=N.str,g.dir=N.dir,b._fontInspectorEnabled&&(g.dataset.fontName=N.fontName),C!==0&&(f.angle=C*(180/Math.PI));let U=!1;if(N.str.length>1)U=!0;else if(N.str!==" "&&N.transform[0]!==N.transform[3]){let q=Math.abs(N.transform[0]),$=Math.abs(N.transform[3]);q!==$&&Math.max(q,$)/Math.min(q,$)>1.5&&(U=!0)}U&&(f.canvasWidth=P.vertical?N.height:N.width),b._textDivProperties.set(g,f),b._isReadableStream&&b._layoutText(g)}function T(b){let{div:N,scale:L,properties:g,ctx:f,prevFontSize:p,prevFontFamily:C}=b,{style:P}=N,k="";if(g.canvasWidth!==0&&g.hasText){let{fontFamily:R}=P,{canvasWidth:W,fontSize:w}=g;(p!==w||C!==R)&&(f.font=`${w*L}px ${R}`,b.prevFontSize=w,b.prevFontFamily=R);let{width:D}=f.measureText(N.textContent);D>0&&(k=`scaleX(${W*L/D})`)}g.angle!==0&&(k=`rotate(${g.angle}deg) ${k}`),k.length>0&&(P.transform=k)}function A(b){if(b._canceled)return;let N=b._textDivs,L=b._capability;if(N.length>i){L.resolve();return}if(!b._isReadableStream)for(let f of N)b._layoutText(f);L.resolve()}class M{constructor({textContentSource:N,container:L,viewport:g,textDivs:f,textDivProperties:p,textContentItemsStr:C,isOffscreenCanvasSupported:P}){this._textContentSource=N,this._isReadableStream=N instanceof ReadableStream,this._container=this._rootContainer=L,this._textDivs=f||[],this._textContentItemsStr=C||[],this._isOffscreenCanvasSupported=P,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=p||new WeakMap,this._canceled=!1,this._capability=new e.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:g.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:u(0,P)};let{pageWidth:k,pageHeight:R,pageX:W,pageY:w}=g.rawDims;this._transform=[1,0,0,-1,-W,w+R],this._pageWidth=k,this._pageHeight=R,(0,t.setLayerDimensions)(L,g),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new e.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new e.AbortException("TextLayer task cancelled."))}_processItems(N,L){for(let g of N){if(g.str===void 0){if(g.type==="beginMarkedContentProps"||g.type==="beginMarkedContent"){let f=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),g.id!==null&&this._container.setAttribute("id",`${g.id}`),f.append(this._container)}else g.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(g.str),v(this,g,L)}}_layoutText(N){let L=this._layoutTextParams.properties=this._textDivProperties.get(N);if(this._layoutTextParams.div=N,T(this._layoutTextParams),L.hasText&&this._container.append(N),L.hasEOL){let g=document.createElement("br");g.setAttribute("role","presentation"),this._container.append(g)}}_render(){let N=new e.PromiseCapability,L=Object.create(null);if(this._isReadableStream){let g=()=>{this._reader.read().then(({value:f,done:p})=>{if(p){N.resolve();return}Object.assign(L,f.styles),this._processItems(f.items,L),g()},N.reject)};this._reader=this._textContentSource.getReader(),g()}else if(this._textContentSource){let{items:g,styles:f}=this._textContentSource;this._processItems(g,f),N.resolve()}else throw new Error('No "textContentSource" parameter specified.');N.promise.then(()=>{L=null,A(this)},this._capability.reject)}}n.TextLayerRenderTask=M;function F(b){!b.textContentSource&&(b.textContent||b.textContentStream)&&((0,t.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),b.textContentSource=b.textContent||b.textContentStream);let{container:N,viewport:L}=b,g=getComputedStyle(N),f=g.getPropertyValue("visibility"),p=parseFloat(g.getPropertyValue("--scale-factor"));f==="visible"&&(!p||Math.abs(p-L.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");let C=new M(b);return C._render(),C}function S({container:b,viewport:N,textDivs:L,textDivProperties:g,isOffscreenCanvasSupported:f,mustRotate:p=!0,mustRescale:C=!0}){if(p&&(0,t.setLayerDimensions)(b,{rotation:N.rotation}),C){let P=u(0,f),R={prevFontSize:null,prevFontFamily:null,div:null,scale:N.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:P};for(let W of L)R.properties=g.get(W),R.div=W,T(R)}}},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationEditorLayer=void 0;var e=_(1),t=_(4),i=_(28),r=_(33),m=_(6),o=_(34);let u=(()=>{var v,T,A,M,F,S,b,N,L,g,f,Ws,Qn,Us,Hs;let R=class R{constructor({uiManager:w,pageIndex:D,div:V,accessibilityManager:U,annotationLayer:q,viewport:$,l10n:x}){ee(this,f);ee(this,v);ee(this,T,!1);ee(this,A,null);ee(this,M,this.pointerup.bind(this));ee(this,F,this.pointerdown.bind(this));ee(this,S,new Map);ee(this,b,!1);ee(this,N,!1);ee(this,L,!1);ee(this,g);let a=[i.FreeTextEditor,r.InkEditor,o.StampEditor];if(!R._initialized){R._initialized=!0;for(let c of a)c.initialize(x)}w.registerEditorTypes(a),J(this,g,w),this.pageIndex=D,this.div=V,J(this,v,U),J(this,A,q),this.viewport=$,s(this,g).addLayer(this)}get isEmpty(){return s(this,S).size===0}updateToolbar(w){s(this,g).updateToolbar(w)}updateMode(w=s(this,g).getMode()){G(this,f,Hs).call(this),w===e.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),w!==e.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",w===e.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",w===e.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",w===e.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(w){if(!w&&s(this,g).getMode()!==e.AnnotationEditorType.INK)return;if(!w){for(let V of s(this,S).values())if(V.isEmpty()){V.setInBackground();return}}G(this,f,Qn).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(w){s(this,g).setEditingState(w)}addCommands(w){s(this,g).addCommands(w)}enable(){this.div.style.pointerEvents="auto";let w=new Set;for(let V of s(this,S).values())V.enableEditing(),V.annotationElementId&&w.add(V.annotationElementId);if(!s(this,A))return;let D=s(this,A).getEditableAnnotations();for(let V of D){if(V.hide(),s(this,g).isDeletedAnnotationElement(V.data.id)||w.has(V.data.id))continue;let U=this.deserialize(V);U&&(this.addOrRebuild(U),U.enableEditing())}}disable(){J(this,L,!0),this.div.style.pointerEvents="none";let w=new Set;for(let D of s(this,S).values()){if(D.disableEditing(),!D.annotationElementId||D.serialize()!==null){w.add(D.annotationElementId);continue}this.getEditableAnnotation(D.annotationElementId)?.show(),D.remove()}if(s(this,A)){let D=s(this,A).getEditableAnnotations();for(let V of D){let{id:U}=V.data;w.has(U)||s(this,g).isDeletedAnnotationElement(U)||V.show()}}G(this,f,Hs).call(this),this.isEmpty&&(this.div.hidden=!0),J(this,L,!1)}getEditableAnnotation(w){return s(this,A)?.getEditableAnnotation(w)||null}setActiveEditor(w){s(this,g).getActive()!==w&&s(this,g).setActiveEditor(w)}enableClick(){this.div.addEventListener("pointerdown",s(this,F)),this.div.addEventListener("pointerup",s(this,M))}disableClick(){this.div.removeEventListener("pointerdown",s(this,F)),this.div.removeEventListener("pointerup",s(this,M))}attach(w){s(this,S).set(w.id,w);let{annotationElementId:D}=w;D&&s(this,g).isDeletedAnnotationElement(D)&&s(this,g).removeDeletedAnnotationElement(w)}detach(w){s(this,S).delete(w.id),s(this,v)?.removePointerInTextLayer(w.contentDiv),!s(this,L)&&w.annotationElementId&&s(this,g).addDeletedAnnotationElement(w)}remove(w){this.detach(w),s(this,g).removeEditor(w),w.div.contains(document.activeElement)&&setTimeout(()=>{s(this,g).focusMainContainer()},0),w.div.remove(),w.isAttachedToDOM=!1,s(this,N)||this.addInkEditorIfNeeded(!1)}changeParent(w){w.parent!==this&&(w.annotationElementId&&(s(this,g).addDeletedAnnotationElement(w.annotationElementId),t.AnnotationEditor.deleteAnnotationElement(w),w.annotationElementId=null),this.attach(w),w.parent?.detach(w),w.setParent(this),w.div&&w.isAttachedToDOM&&(w.div.remove(),this.div.append(w.div)))}add(w){if(this.changeParent(w),s(this,g).addEditor(w),this.attach(w),!w.isAttachedToDOM){let D=w.render();this.div.append(D),w.isAttachedToDOM=!0}w.fixAndSetPosition(),w.onceAdded(),s(this,g).addToAnnotationStorage(w)}moveEditorInDOM(w){if(!w.isAttachedToDOM)return;let{activeElement:D}=document;w.div.contains(D)&&(w._focusEventsAllowed=!1,setTimeout(()=>{w.div.contains(document.activeElement)?w._focusEventsAllowed=!0:(w.div.addEventListener("focusin",()=>{w._focusEventsAllowed=!0},{once:!0}),D.focus())},0)),w._structTreeParentId=s(this,v)?.moveElementInDOM(this.div,w.div,w.contentDiv,!0)}addOrRebuild(w){w.needsToBeRebuilt()?w.rebuild():this.add(w)}addUndoableEditor(w){let D=()=>w._uiManager.rebuild(w),V=()=>{w.remove()};this.addCommands({cmd:D,undo:V,mustExec:!1})}getNextId(){return s(this,g).getId()}pasteEditor(w,D){s(this,g).updateToolbar(w),s(this,g).updateMode(w);let{offsetX:V,offsetY:U}=G(this,f,Us).call(this),q=this.getNextId(),$=G(this,f,Ws).call(this,ft({parent:this,id:q,x:V,y:U,uiManager:s(this,g),isCentered:!0},D));$&&this.add($)}deserialize(w){switch(w.annotationType??w.annotationEditorType){case e.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(w,this,s(this,g));case e.AnnotationEditorType.INK:return r.InkEditor.deserialize(w,this,s(this,g));case e.AnnotationEditorType.STAMP:return o.StampEditor.deserialize(w,this,s(this,g))}return null}addNewEditor(){G(this,f,Qn).call(this,G(this,f,Us).call(this),!0)}setSelected(w){s(this,g).setSelected(w)}toggleSelected(w){s(this,g).toggleSelected(w)}isSelected(w){return s(this,g).isSelected(w)}unselect(w){s(this,g).unselect(w)}pointerup(w){let{isMac:D}=e.FeatureTest.platform;if(!(w.button!==0||w.ctrlKey&&D)&&w.target===this.div&&s(this,b)){if(J(this,b,!1),!s(this,T)){J(this,T,!0);return}if(s(this,g).getMode()===e.AnnotationEditorType.STAMP){s(this,g).unselectAll();return}G(this,f,Qn).call(this,w,!1)}}pointerdown(w){if(s(this,b)){J(this,b,!1);return}let{isMac:D}=e.FeatureTest.platform;if(w.button!==0||w.ctrlKey&&D||w.target!==this.div)return;J(this,b,!0);let V=s(this,g).getActive();J(this,T,!V||V.isEmpty())}findNewParent(w,D,V){let U=s(this,g).findParent(D,V);return U===null||U===this?!1:(U.changeParent(w),!0)}destroy(){s(this,g).getActive()?.parent===this&&(s(this,g).commitOrRemove(),s(this,g).setActiveEditor(null));for(let w of s(this,S).values())s(this,v)?.removePointerInTextLayer(w.contentDiv),w.setParent(null),w.isAttachedToDOM=!1,w.div.remove();this.div=null,s(this,S).clear(),s(this,g).removeLayer(this)}render({viewport:w}){this.viewport=w,(0,m.setLayerDimensions)(this.div,w);for(let D of s(this,g).getEditors(this.pageIndex))this.add(D);this.updateMode()}update({viewport:w}){s(this,g).commitOrRemove(),this.viewport=w,(0,m.setLayerDimensions)(this.div,{rotation:w.rotation}),this.updateMode()}get pageDimensions(){let{pageWidth:w,pageHeight:D}=this.viewport.rawDims;return[w,D]}};v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakMap,N=new WeakMap,L=new WeakMap,g=new WeakMap,f=new WeakSet,Ws=function(w){switch(s(this,g).getMode()){case e.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(w);case e.AnnotationEditorType.INK:return new r.InkEditor(w);case e.AnnotationEditorType.STAMP:return new o.StampEditor(w)}return null},Qn=function(w,D){let V=this.getNextId(),U=G(this,f,Ws).call(this,{parent:this,id:V,x:w.offsetX,y:w.offsetY,uiManager:s(this,g),isCentered:D});return U&&this.add(U),U},Us=function(){let{x:w,y:D,width:V,height:U}=this.div.getBoundingClientRect(),q=Math.max(0,w),$=Math.max(0,D),x=Math.min(window.innerWidth,w+V),a=Math.min(window.innerHeight,D+U),c=(q+x)/2-w,E=($+a)/2-D,[B,O]=this.viewport.rotation%180===0?[c,E]:[E,c];return{offsetX:B,offsetY:O}},Hs=function(){J(this,N,!0);for(let w of s(this,S).values())w.isEmpty()&&w.remove();J(this,N,!1)},qe(R,"_initialized",!1);let d=R;return d})();n.AnnotationEditorLayer=u},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FreeTextEditor=void 0;var e=_(1),t=_(5),i=_(4),r=_(29);let m=(()=>{var u,d,v,T,A,M,F,S,b,N,dl,ul,pl,ln,Gs,fl,Xs;let R=class R extends i.AnnotationEditor{constructor(D){super(At(ft({},D),{name:"freeTextEditor"}));ee(this,N);ee(this,u,this.editorDivBlur.bind(this));ee(this,d,this.editorDivFocus.bind(this));ee(this,v,this.editorDivInput.bind(this));ee(this,T,this.editorDivKeydown.bind(this));ee(this,A);ee(this,M,"");ee(this,F,`${this.id}-editor`);ee(this,S);ee(this,b,null);J(this,A,D.color||R._defaultColor||i.AnnotationEditor._defaultLineColor),J(this,S,D.fontSize||R._defaultFontSize)}static get _keyboardManager(){let D=R.prototype,V=$=>$.isEmpty(),U=t.AnnotationEditorUIManager.TRANSLATE_SMALL,q=t.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new t.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],D.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],D.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],D._translateEmpty,{args:[-U,0],checker:V}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],D._translateEmpty,{args:[-q,0],checker:V}],[["ArrowRight","mac+ArrowRight"],D._translateEmpty,{args:[U,0],checker:V}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],D._translateEmpty,{args:[q,0],checker:V}],[["ArrowUp","mac+ArrowUp"],D._translateEmpty,{args:[0,-U],checker:V}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],D._translateEmpty,{args:[0,-q],checker:V}],[["ArrowDown","mac+ArrowDown"],D._translateEmpty,{args:[0,U],checker:V}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],D._translateEmpty,{args:[0,q],checker:V}]]))}static initialize(D){i.AnnotationEditor.initialize(D,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});let V=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(V.getPropertyValue("--freetext-padding"))}static updateDefaultParams(D,V){switch(D){case e.AnnotationEditorParamsType.FREETEXT_SIZE:R._defaultFontSize=V;break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:R._defaultColor=V;break}}updateParams(D,V){switch(D){case e.AnnotationEditorParamsType.FREETEXT_SIZE:G(this,N,dl).call(this,V);break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:G(this,N,ul).call(this,V);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,R._defaultFontSize],[e.AnnotationEditorParamsType.FREETEXT_COLOR,R._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,s(this,S)],[e.AnnotationEditorParamsType.FREETEXT_COLOR,s(this,A)]]}_translateEmpty(D,V){this._uiManager.translateSelectedEditors(D,V,!0)}getInitialTranslation(){let D=this.parentScale;return[-R._internalPadding*D,-(R._internalPadding+s(this,S))*D]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(e.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",s(this,T)),this.editorDiv.addEventListener("focus",s(this,d)),this.editorDiv.addEventListener("blur",s(this,u)),this.editorDiv.addEventListener("input",s(this,v)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",s(this,F)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",s(this,T)),this.editorDiv.removeEventListener("focus",s(this,d)),this.editorDiv.removeEventListener("blur",s(this,u)),this.editorDiv.removeEventListener("input",s(this,v)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(D){this._focusEventsAllowed&&(super.focusin(D),D.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){if(this.width){G(this,N,Xs).call(this);return}this.enableEditMode(),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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let D=s(this,M),V=J(this,M,G(this,N,pl).call(this).trimEnd());if(D===V)return;let U=q=>{if(J(this,M,q),!q){this.remove();return}G(this,N,Gs).call(this),this._uiManager.rebuild(this),G(this,N,ln).call(this)};this.addCommands({cmd:()=>{U(V)},undo:()=>{U(D)},mustExec:!1}),G(this,N,ln).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(D){this.enterInEditMode()}keydown(D){D.target===this.div&&D.key==="Enter"&&(this.enterInEditMode(),D.preventDefault())}editorDivKeydown(D){R._keyboardManager.exec(this,D)}editorDivFocus(D){this.isEditing=!0}editorDivBlur(D){this.isEditing=!1}editorDivInput(D){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let D,V;this.width&&(D=this.x,V=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",s(this,F)),this.enableEditing(),i.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(q=>this.editorDiv?.setAttribute("aria-label",q)),i.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(q=>this.editorDiv?.setAttribute("default-content",q)),this.editorDiv.contentEditable=!0;let{style:U}=this.editorDiv;if(U.fontSize=`calc(${s(this,S)}px * var(--scale-factor))`,U.color=s(this,A),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,t.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[q,$]=this.parentDimensions;if(this.annotationElementId){let{position:x}=s(this,b),[a,c]=this.getInitialTranslation();[a,c]=this.pageTranslationToScreen(a,c);let[E,B]=this.pageDimensions,[O,Y]=this.pageTranslation,Z,X;switch(this.rotation){case 0:Z=D+(x[0]-O)/E,X=V+this.height-(x[1]-Y)/B;break;case 90:Z=D+(x[0]-O)/E,X=V-(x[1]-Y)/B,[a,c]=[c,-a];break;case 180:Z=D-this.width+(x[0]-O)/E,X=V-(x[1]-Y)/B,[a,c]=[-a,-c];break;case 270:Z=D+(x[0]-O-this.height*B)/E,X=V+(x[1]-Y-this.width*E)/B,[a,c]=[-c,a];break}this.setAt(Z*q,X*$,a,c)}else this.setAt(D*q,V*$,this.width*q,this.height*$);G(this,N,Gs).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(D,V,U){let q=null;if(D instanceof r.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:x,fontColor:a},rect:c,rotation:E,id:B},textContent:O,textPosition:Y,parent:{page:{pageNumber:Z}}}=D;if(!O||O.length===0)return null;q=D={annotationType:e.AnnotationEditorType.FREETEXT,color:Array.from(a),fontSize:x,value:O.join(`
`),position:Y,pageIndex:Z-1,rect:c,rotation:E,id:B,deleted:!1}}let $=super.deserialize(D,V,U);return J($,S,D.fontSize),J($,A,e.Util.makeHexColor(...D.color)),J($,M,D.value),$.annotationElementId=D.id||null,J($,b,q),$}serialize(D=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};let V=R._internalPadding*this.parentScale,U=this.getRect(V,V),q=i.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:s(this,A)),$={annotationType:e.AnnotationEditorType.FREETEXT,color:q,fontSize:s(this,S),value:s(this,M),pageIndex:this.pageIndex,rect:U,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return D?$:this.annotationElementId&&!G(this,N,fl).call(this,$)?null:($.id=this.annotationElementId,$)}};u=new WeakMap,d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakMap,N=new WeakSet,dl=function(D){let V=q=>{this.editorDiv.style.fontSize=`calc(${q}px * var(--scale-factor))`,this.translate(0,-(q-s(this,S))*this.parentScale),J(this,S,q),G(this,N,ln).call(this)},U=s(this,S);this.addCommands({cmd:()=>{V(D)},undo:()=>{V(U)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},ul=function(D){let V=s(this,A);this.addCommands({cmd:()=>{J(this,A,this.editorDiv.style.color=D)},undo:()=>{J(this,A,this.editorDiv.style.color=V)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},pl=function(){let D=this.editorDiv.getElementsByTagName("div");if(D.length===0)return this.editorDiv.innerText;let V=[];for(let U of D)V.push(U.innerText.replace(/\r\n?|\n/,""));return V.join(`
`)},ln=function(){let[D,V]=this.parentDimensions,U;if(this.isAttachedToDOM)U=this.div.getBoundingClientRect();else{let{currentLayer:q,div:$}=this,x=$.style.display;$.style.display="hidden",q.div.append(this.div),U=$.getBoundingClientRect(),$.remove(),$.style.display=x}this.rotation%180===this.parentRotation%180?(this.width=U.width/D,this.height=U.height/V):(this.width=U.height/D,this.height=U.width/V),this.fixAndSetPosition()},Gs=function(){if(this.editorDiv.replaceChildren(),!!s(this,M))for(let D of s(this,M).split(`
`)){let V=document.createElement("div");V.append(D?document.createTextNode(D):document.createElement("br")),this.editorDiv.append(V)}},fl=function(D){let{value:V,fontSize:U,color:q,rect:$,pageIndex:x}=s(this,b);return D.value!==V||D.fontSize!==U||D.rect.some((a,c)=>Math.abs(a-$[c])>=1)||D.color.some((a,c)=>a!==q[c])||D.pageIndex!==x},Xs=function(D=!1){if(!this.annotationElementId)return;if(G(this,N,ln).call(this),!D&&(this.width===0||this.height===0)){setTimeout(()=>G(this,N,Xs).call(this,!0),0);return}let V=R._internalPadding*this.parentScale;s(this,b).rect=this.getRect(V,V)},qe(R,"_freeTextDefaultContent",""),qe(R,"_internalPadding",0),qe(R,"_defaultColor",null),qe(R,"_defaultFontSize",10),qe(R,"_type","freetext");let o=R;return o})();n.FreeTextEditor=m},(h,n,_)=>{var Z,ie,ne,de,me,xe,Se,ke,Xe,Ee,_e,ue,re,y,l,I,z,Q,K,gl,Zn,qs,Ks,Ie,Qe,ze,We,rt,at,be,Ys,ce,Me,et,te,ml,Qs;Object.defineProperty(n,"__esModule",{value:!0}),n.StampAnnotationElement=n.InkAnnotationElement=n.FreeTextAnnotationElement=n.AnnotationLayer=void 0;var e=_(1),t=_(6),i=_(3),r=_(30),m=_(31),o=_(32);let u=1e3,d=9,v=new WeakSet;function T(Oe){return{width:Oe[2]-Oe[0],height:Oe[3]-Oe[1]}}class A{static create(j){switch(j.data.annotationType){case e.AnnotationType.LINK:return new F(j);case e.AnnotationType.TEXT:return new S(j);case e.AnnotationType.WIDGET:switch(j.data.fieldType){case"Tx":return new N(j);case"Btn":return j.data.radioButton?new f(j):j.data.checkBox?new g(j):new p(j);case"Ch":return new C(j);case"Sig":return new L(j)}return new b(j);case e.AnnotationType.POPUP:return new P(j);case e.AnnotationType.FREETEXT:return new R(j);case e.AnnotationType.LINE:return new W(j);case e.AnnotationType.SQUARE:return new w(j);case e.AnnotationType.CIRCLE:return new D(j);case e.AnnotationType.POLYLINE:return new V(j);case e.AnnotationType.CARET:return new q(j);case e.AnnotationType.INK:return new $(j);case e.AnnotationType.POLYGON:return new U(j);case e.AnnotationType.HIGHLIGHT:return new x(j);case e.AnnotationType.UNDERLINE:return new a(j);case e.AnnotationType.SQUIGGLY:return new c(j);case e.AnnotationType.STRIKEOUT:return new E(j);case e.AnnotationType.STAMP:return new B(j);case e.AnnotationType.FILEATTACHMENT:return new O(j);default:return new M(j)}}}let X=class X{constructor(j,{isRenderable:H=!1,ignoreBorder:ae=!1,createQuadrilaterals:fe=!1}={}){ee(this,Z,!1);this.isRenderable=H,this.data=j.data,this.layer=j.layer,this.linkService=j.linkService,this.downloadManager=j.downloadManager,this.imageResourcesPath=j.imageResourcesPath,this.renderForms=j.renderForms,this.svgFactory=j.svgFactory,this.annotationStorage=j.annotationStorage,this.enableScripting=j.enableScripting,this.hasJSActions=j.hasJSActions,this._fieldObjects=j.fieldObjects,this.parent=j.parent,H&&(this.container=this._createContainer(ae)),fe&&this._createQuadrilaterals()}static _hasPopupData({titleObj:j,contentsObj:H,richText:ae}){return!!(j?.str||H?.str||ae?.str)}get hasPopupData(){return X._hasPopupData(this.data)}_createContainer(j){let{data:H,parent:{page:ae,viewport:fe}}=this,ye=document.createElement("section");ye.setAttribute("data-annotation-id",H.id),this instanceof b||(ye.tabIndex=u),ye.style.zIndex=this.parent.zIndex++,this.data.popupRef&&ye.setAttribute("aria-haspopup","dialog"),H.noRotate&&ye.classList.add("norotate");let{pageWidth:ve,pageHeight:Le,pageX:Fe,pageY:ot}=fe.rawDims;if(!H.rect||this instanceof P){let{rotation:dt}=H;return!H.hasOwnCanvas&&dt!==0&&this.setRotation(dt,ye),ye}let{width:He,height:$e}=T(H.rect),Ve=e.Util.normalizeRect([H.rect[0],ae.view[3]-H.rect[1]+ae.view[1],H.rect[2],ae.view[3]-H.rect[3]+ae.view[1]]);if(!j&&H.borderStyle.width>0){ye.style.borderWidth=`${H.borderStyle.width}px`;let dt=H.borderStyle.horizontalCornerRadius,bt=H.borderStyle.verticalCornerRadius;if(dt>0||bt>0){let Et=`calc(${dt}px * var(--scale-factor)) / calc(${bt}px * var(--scale-factor))`;ye.style.borderRadius=Et}else if(this instanceof f){let Et=`calc(${He}px * var(--scale-factor)) / calc(${$e}px * var(--scale-factor))`;ye.style.borderRadius=Et}switch(H.borderStyle.style){case e.AnnotationBorderStyleType.SOLID:ye.style.borderStyle="solid";break;case e.AnnotationBorderStyleType.DASHED:ye.style.borderStyle="dashed";break;case e.AnnotationBorderStyleType.BEVELED:(0,e.warn)("Unimplemented border style: beveled");break;case e.AnnotationBorderStyleType.INSET:(0,e.warn)("Unimplemented border style: inset");break;case e.AnnotationBorderStyleType.UNDERLINE:ye.style.borderBottomStyle="solid";break;default:break}let gt=H.borderColor||null;gt?(J(this,Z,!0),ye.style.borderColor=e.Util.makeHexColor(gt[0]|0,gt[1]|0,gt[2]|0)):ye.style.borderWidth=0}ye.style.left=`${100*(Ve[0]-Fe)/ve}%`,ye.style.top=`${100*(Ve[1]-ot)/Le}%`;let{rotation:Ze}=H;return H.hasOwnCanvas||Ze===0?(ye.style.width=`${100*He/ve}%`,ye.style.height=`${100*$e/Le}%`):this.setRotation(Ze,ye),ye}setRotation(j,H=this.container){if(!this.data.rect)return;let{pageWidth:ae,pageHeight:fe}=this.parent.viewport.rawDims,{width:ye,height:ve}=T(this.data.rect),Le,Fe;j%180===0?(Le=100*ye/ae,Fe=100*ve/fe):(Le=100*ve/ae,Fe=100*ye/fe),H.style.width=`${Le}%`,H.style.height=`${Fe}%`,H.setAttribute("data-main-rotation",(360-j)%360)}get _commonActions(){let j=(H,ae,fe)=>{let ye=fe.detail[H],ve=ye[0],Le=ye.slice(1);fe.target.style[ae]=r.ColorConverters[`${ve}_HTML`](Le),this.annotationStorage.setValue(this.data.id,{[ae]:r.ColorConverters[`${ve}_rgb`](Le)})};return(0,e.shadow)(this,"_commonActions",{display:H=>{let{display:ae}=H.detail,fe=ae%2===1;this.container.style.visibility=fe?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:fe,noPrint:ae===1||ae===2})},print:H=>{this.annotationStorage.setValue(this.data.id,{noPrint:!H.detail.print})},hidden:H=>{let{hidden:ae}=H.detail;this.container.style.visibility=ae?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:ae,noView:ae})},focus:H=>{setTimeout(()=>H.target.focus({preventScroll:!1}),0)},userName:H=>{H.target.title=H.detail.userName},readonly:H=>{H.target.disabled=H.detail.readonly},required:H=>{this._setRequired(H.target,H.detail.required)},bgColor:H=>{j("bgColor","backgroundColor",H)},fillColor:H=>{j("fillColor","backgroundColor",H)},fgColor:H=>{j("fgColor","color",H)},textColor:H=>{j("textColor","color",H)},borderColor:H=>{j("borderColor","borderColor",H)},strokeColor:H=>{j("strokeColor","borderColor",H)},rotation:H=>{let ae=H.detail.rotation;this.setRotation(ae),this.annotationStorage.setValue(this.data.id,{rotation:ae})}})}_dispatchEventFromSandbox(j,H){let ae=this._commonActions;for(let fe of Object.keys(H.detail))(j[fe]||ae[fe])?.(H)}_setDefaultPropertiesFromJS(j){if(!this.enableScripting)return;let H=this.annotationStorage.getRawValue(this.data.id);if(!H)return;let ae=this._commonActions;for(let[fe,ye]of Object.entries(H)){let ve=ae[fe];if(ve){let Le={detail:{[fe]:ye},target:j};ve(Le),delete H[fe]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:j}=this.data;if(!j)return;let[H,ae,fe,ye]=this.data.rect;if(j.length===1){let[,{x:bt,y:gt},{x:Et,y:ai}]=j[0];if(fe===bt&&ye===gt&&H===Et&&ae===ai)return}let{style:ve}=this.container,Le;if(s(this,Z)){let{borderColor:bt,borderWidth:gt}=ve;ve.borderWidth=0,Le=["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="${bt}" stroke-width="${gt}">`],this.container.classList.add("hasBorder")}let Fe=fe-H,ot=ye-ae,{svgFactory:He}=this,$e=He.createElement("svg");$e.classList.add("quadrilateralsContainer"),$e.setAttribute("width",0),$e.setAttribute("height",0);let Ve=He.createElement("defs");$e.append(Ve);let Ze=He.createElement("clipPath"),dt=`clippath_${this.data.id}`;Ze.setAttribute("id",dt),Ze.setAttribute("clipPathUnits","objectBoundingBox"),Ve.append(Ze);for(let[,{x:bt,y:gt},{x:Et,y:ai}]of j){let Lt=He.createElement("rect"),Yi=(Et-H)/Fe,Qi=(ye-gt)/ot,Lr=(bt-Et)/Fe,Ir=(gt-ai)/ot;Lt.setAttribute("x",Yi),Lt.setAttribute("y",Qi),Lt.setAttribute("width",Lr),Lt.setAttribute("height",Ir),Ze.append(Lt),Le?.push(`<rect vector-effect="non-scaling-stroke" x="${Yi}" y="${Qi}" width="${Lr}" height="${Ir}"/>`)}s(this,Z)&&(Le.push("</g></svg>')"),ve.backgroundImage=Le.join("")),this.container.append($e),this.container.style.clipPath=`url(#${dt})`}_createPopup(){let{container:j,data:H}=this;j.setAttribute("aria-haspopup","dialog");let ae=new P({data:{color:H.color,titleObj:H.titleObj,modificationDate:H.modificationDate,contentsObj:H.contentsObj,richText:H.richText,parentRect:H.rect,borderStyle:0,id:`popup_${H.id}`,rotation:H.rotation},parent:this.parent,elements:[this]});this.parent.div.append(ae.render())}render(){(0,e.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(j,H=null){let ae=[];if(this._fieldObjects){let fe=this._fieldObjects[j];if(fe)for(let{page:ye,id:ve,exportValues:Le}of fe){if(ye===-1||ve===H)continue;let Fe=typeof Le=="string"?Le:null,ot=document.querySelector(`[data-element-id="${ve}"]`);if(ot&&!v.has(ot)){(0,e.warn)(`_getElementsByName - element not allowed: ${ve}`);continue}ae.push({id:ve,exportValue:Fe,domElement:ot})}return ae}for(let fe of document.getElementsByName(j)){let{exportValue:ye}=fe,ve=fe.getAttribute("data-element-id");ve!==H&&v.has(fe)&&ae.push({id:ve,exportValue:ye,domElement:fe})}return ae}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(){let j=this.getElementsToTriggerPopup();if(Array.isArray(j))for(let H of j)H.classList.add("highlightArea");else j.classList.add("highlightArea")}_editOnDoubleClick(){let{annotationEditorType:j,data:{id:H}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:j,editId:H})})}};Z=new WeakMap;let M=X;class F extends M{constructor(j,H=null){super(j,{isRenderable:!0,ignoreBorder:!!H?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=j.data.isTooltipOnly}render(){let{data:j,linkService:H}=this,ae=document.createElement("a");ae.setAttribute("data-element-id",j.id);let fe=!1;return j.url?(H.addLinkAttributes(ae,j.url,j.newWindow),fe=!0):j.action?(this._bindNamedAction(ae,j.action),fe=!0):j.attachment?(this._bindAttachment(ae,j.attachment),fe=!0):j.setOCGState?(this.#t(ae,j.setOCGState),fe=!0):j.dest?(this._bindLink(ae,j.dest),fe=!0):(j.actions&&(j.actions.Action||j.actions["Mouse Up"]||j.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(ae,j),fe=!0),j.resetForm?(this._bindResetFormAction(ae,j.resetForm),fe=!0):this.isTooltipOnly&&!fe&&(this._bindLink(ae,""),fe=!0)),this.container.classList.add("linkAnnotation"),fe&&this.container.append(ae),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(j,H){j.href=this.linkService.getDestinationHash(H),j.onclick=()=>(H&&this.linkService.goToDestination(H),!1),(H||H==="")&&this.#e()}_bindNamedAction(j,H){j.href=this.linkService.getAnchorUrl(""),j.onclick=()=>(this.linkService.executeNamedAction(H),!1),this.#e()}_bindAttachment(j,H){j.href=this.linkService.getAnchorUrl(""),j.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,H.content,H.filename),!1),this.#e()}#t(j,H){j.href=this.linkService.getAnchorUrl(""),j.onclick=()=>(this.linkService.executeSetOCGState(H),!1),this.#e()}_bindJSAction(j,H){j.href=this.linkService.getAnchorUrl("");let ae=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let fe of Object.keys(H.actions)){let ye=ae.get(fe);ye&&(j[ye]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:H.id,name:fe}}),!1))}j.onclick||(j.onclick=()=>!1),this.#e()}_bindResetFormAction(j,H){let ae=j.onclick;if(ae||(j.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){(0,e.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),ae||(j.onclick=()=>!1);return}j.onclick=()=>{ae?.();let{fields:fe,refs:ye,include:ve}=H,Le=[];if(fe.length!==0||ye.length!==0){let He=new Set(ye);for(let $e of fe){let Ve=this._fieldObjects[$e]||[];for(let{id:Ze}of Ve)He.add(Ze)}for(let $e of Object.values(this._fieldObjects))for(let Ve of $e)He.has(Ve.id)===ve&&Le.push(Ve)}else for(let He of Object.values(this._fieldObjects))Le.push(...He);let Fe=this.annotationStorage,ot=[];for(let He of Le){let{id:$e}=He;switch(ot.push($e),He.type){case"text":{let Ze=He.defaultValue||"";Fe.setValue($e,{value:Ze});break}case"checkbox":case"radiobutton":{let Ze=He.defaultValue===He.exportValues;Fe.setValue($e,{value:Ze});break}case"combobox":case"listbox":{let Ze=He.defaultValue||"";Fe.setValue($e,{value:Ze});break}default:continue}let Ve=document.querySelector(`[data-element-id="${$e}"]`);if(Ve){if(!v.has(Ve)){(0,e.warn)(`_bindResetFormAction - element not allowed: ${$e}`);continue}}else continue;Ve.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:ot,name:"ResetForm"}}),!1}}}class S extends M{constructor(j){super(j,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let j=document.createElement("img");return j.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",j.alt="[{{type}} Annotation]",j.dataset.l10nId="text_annotation_type",j.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(j),this.container}}class b extends M{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(j){this.data.hasOwnCanvas&&(j.previousSibling?.nodeName==="CANVAS"&&(j.previousSibling.hidden=!0),j.hidden=!1)}_getKeyModifier(j){let{isWin:H,isMac:ae}=e.FeatureTest.platform;return H&&j.ctrlKey||ae&&j.metaKey}_setEventListener(j,H,ae,fe,ye){ae.includes("mouse")?j.addEventListener(ae,ve=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:fe,value:ye(ve),shift:ve.shiftKey,modifier:this._getKeyModifier(ve)}})}):j.addEventListener(ae,ve=>{if(ae==="blur"){if(!H.focused||!ve.relatedTarget)return;H.focused=!1}else if(ae==="focus"){if(H.focused)return;H.focused=!0}ye&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:fe,value:ye(ve)}})})}_setEventListeners(j,H,ae,fe){for(let[ye,ve]of ae)(ve==="Action"||this.data.actions?.[ve])&&((ve==="Focus"||ve==="Blur")&&(H||={focused:!1}),this._setEventListener(j,H,ye,ve,fe),ve==="Focus"&&!this.data.actions?.Blur?this._setEventListener(j,H,"blur","Blur",null):ve==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(j,H,"focus","Focus",null))}_setBackgroundColor(j){let H=this.data.backgroundColor||null;j.style.backgroundColor=H===null?"transparent":e.Util.makeHexColor(H[0],H[1],H[2])}_setTextStyle(j){let H=["left","center","right"],{fontColor:ae}=this.data.defaultAppearanceData,fe=this.data.defaultAppearanceData.fontSize||d,ye=j.style,ve,Le=2,Fe=ot=>Math.round(10*ot)/10;if(this.data.multiLine){let ot=Math.abs(this.data.rect[3]-this.data.rect[1]-Le),He=Math.round(ot/(e.LINE_FACTOR*fe))||1,$e=ot/He;ve=Math.min(fe,Fe($e/e.LINE_FACTOR))}else{let ot=Math.abs(this.data.rect[3]-this.data.rect[1]-Le);ve=Math.min(fe,Fe(ot/e.LINE_FACTOR))}ye.fontSize=`calc(${ve}px * var(--scale-factor))`,ye.color=e.Util.makeHexColor(ae[0],ae[1],ae[2]),this.data.textAlignment!==null&&(ye.textAlign=H[this.data.textAlignment])}_setRequired(j,H){H?j.setAttribute("required",!0):j.removeAttribute("required"),j.setAttribute("aria-required",H)}}class N extends b{constructor(j){let H=j.renderForms||!j.data.hasAppearance&&!!j.data.fieldValue;super(j,{isRenderable:H})}setPropertyOnSiblings(j,H,ae,fe){let ye=this.annotationStorage;for(let ve of this._getElementsByName(j.name,j.id))ve.domElement&&(ve.domElement[H]=ae),ye.setValue(ve.id,{[fe]:ae})}render(){let j=this.annotationStorage,H=this.data.id;this.container.classList.add("textWidgetAnnotation");let ae=null;if(this.renderForms){let fe=j.getValue(H,{value:this.data.fieldValue}),ye=fe.value||"",ve=j.getValue(H,{charLimit:this.data.maxLen}).charLimit;ve&&ye.length>ve&&(ye=ye.slice(0,ve));let Le=fe.formattedValue||this.data.textContent?.join(`
`)||null;Le&&this.data.comb&&(Le=Le.replaceAll(/\s+/g,""));let Fe={userValue:ye,formattedValue:Le,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(ae=document.createElement("textarea"),ae.textContent=Le??ye,this.data.doNotScroll&&(ae.style.overflowY="hidden")):(ae=document.createElement("input"),ae.type="text",ae.setAttribute("value",Le??ye),this.data.doNotScroll&&(ae.style.overflowX="hidden")),this.data.hasOwnCanvas&&(ae.hidden=!0),v.add(ae),ae.setAttribute("data-element-id",H),ae.disabled=this.data.readOnly,ae.name=this.data.fieldName,ae.tabIndex=u,this._setRequired(ae,this.data.required),ve&&(ae.maxLength=ve),ae.addEventListener("input",He=>{j.setValue(H,{value:He.target.value}),this.setPropertyOnSiblings(ae,"value",He.target.value,"value"),Fe.formattedValue=null}),ae.addEventListener("resetform",He=>{let $e=this.data.defaultFieldValue??"";ae.value=Fe.userValue=$e,Fe.formattedValue=null});let ot=He=>{let{formattedValue:$e}=Fe;$e!=null&&(He.target.value=$e),He.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ae.addEventListener("focus",$e=>{if(Fe.focused)return;let{target:Ve}=$e;Fe.userValue&&(Ve.value=Fe.userValue),Fe.lastCommittedValue=Ve.value,Fe.commitKey=1,Fe.focused=!0}),ae.addEventListener("updatefromsandbox",$e=>{this.showElementAndHideCanvas($e.target);let Ve={value(Ze){Fe.userValue=Ze.detail.value??"",j.setValue(H,{value:Fe.userValue.toString()}),Ze.target.value=Fe.userValue},formattedValue(Ze){let{formattedValue:dt}=Ze.detail;Fe.formattedValue=dt,dt!=null&&Ze.target!==document.activeElement&&(Ze.target.value=dt),j.setValue(H,{formattedValue:dt})},selRange(Ze){Ze.target.setSelectionRange(...Ze.detail.selRange)},charLimit:Ze=>{let{charLimit:dt}=Ze.detail,{target:bt}=Ze;if(dt===0){bt.removeAttribute("maxLength");return}bt.setAttribute("maxLength",dt);let gt=Fe.userValue;!gt||gt.length<=dt||(gt=gt.slice(0,dt),bt.value=Fe.userValue=gt,j.setValue(H,{value:gt}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:H,name:"Keystroke",value:gt,willCommit:!0,commitKey:1,selStart:bt.selectionStart,selEnd:bt.selectionEnd}}))}};this._dispatchEventFromSandbox(Ve,$e)}),ae.addEventListener("keydown",$e=>{Fe.commitKey=1;let Ve=-1;if($e.key==="Escape"?Ve=0:$e.key==="Enter"&&!this.data.multiLine?Ve=2:$e.key==="Tab"&&(Fe.commitKey=3),Ve===-1)return;let{value:Ze}=$e.target;Fe.lastCommittedValue!==Ze&&(Fe.lastCommittedValue=Ze,Fe.userValue=Ze,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:H,name:"Keystroke",value:Ze,willCommit:!0,commitKey:Ve,selStart:$e.target.selectionStart,selEnd:$e.target.selectionEnd}}))});let He=ot;ot=null,ae.addEventListener("blur",$e=>{if(!Fe.focused||!$e.relatedTarget)return;Fe.focused=!1;let{value:Ve}=$e.target;Fe.userValue=Ve,Fe.lastCommittedValue!==Ve&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:H,name:"Keystroke",value:Ve,willCommit:!0,commitKey:Fe.commitKey,selStart:$e.target.selectionStart,selEnd:$e.target.selectionEnd}}),He($e)}),this.data.actions?.Keystroke&&ae.addEventListener("beforeinput",$e=>{Fe.lastCommittedValue=null;let{data:Ve,target:Ze}=$e,{value:dt,selectionStart:bt,selectionEnd:gt}=Ze,Et=bt,ai=gt;switch($e.inputType){case"deleteWordBackward":{let Lt=dt.substring(0,bt).match(/\w*[^\w]*$/);Lt&&(Et-=Lt[0].length);break}case"deleteWordForward":{let Lt=dt.substring(bt).match(/^[^\w]*\w*/);Lt&&(ai+=Lt[0].length);break}case"deleteContentBackward":bt===gt&&(Et-=1);break;case"deleteContentForward":bt===gt&&(ai+=1);break}$e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:H,name:"Keystroke",value:dt,change:Ve||"",willCommit:!1,selStart:Et,selEnd:ai}})}),this._setEventListeners(ae,Fe,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],$e=>$e.target.value)}if(ot&&ae.addEventListener("blur",ot),this.data.comb){let $e=(this.data.rect[2]-this.data.rect[0])/ve;ae.classList.add("comb"),ae.style.letterSpacing=`calc(${$e}px * var(--scale-factor) - 1ch)`}}else ae=document.createElement("div"),ae.textContent=this.data.fieldValue,ae.style.verticalAlign="middle",ae.style.display="table-cell";return this._setTextStyle(ae),this._setBackgroundColor(ae),this._setDefaultPropertiesFromJS(ae),this.container.append(ae),this.container}}class L extends b{constructor(j){super(j,{isRenderable:!!j.data.hasOwnCanvas})}}class g extends b{constructor(j){super(j,{isRenderable:j.renderForms})}render(){let j=this.annotationStorage,H=this.data,ae=H.id,fe=j.getValue(ae,{value:H.exportValue===H.fieldValue}).value;typeof fe=="string"&&(fe=fe!=="Off",j.setValue(ae,{value:fe})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let ye=document.createElement("input");return v.add(ye),ye.setAttribute("data-element-id",ae),ye.disabled=H.readOnly,this._setRequired(ye,this.data.required),ye.type="checkbox",ye.name=H.fieldName,fe&&ye.setAttribute("checked",!0),ye.setAttribute("exportValue",H.exportValue),ye.tabIndex=u,ye.addEventListener("change",ve=>{let{name:Le,checked:Fe}=ve.target;for(let ot of this._getElementsByName(Le,ae)){let He=Fe&&ot.exportValue===H.exportValue;ot.domElement&&(ot.domElement.checked=He),j.setValue(ot.id,{value:He})}j.setValue(ae,{value:Fe})}),ye.addEventListener("resetform",ve=>{let Le=H.defaultFieldValue||"Off";ve.target.checked=Le===H.exportValue}),this.enableScripting&&this.hasJSActions&&(ye.addEventListener("updatefromsandbox",ve=>{let Le={value(Fe){Fe.target.checked=Fe.detail.value!=="Off",j.setValue(ae,{value:Fe.target.checked})}};this._dispatchEventFromSandbox(Le,ve)}),this._setEventListeners(ye,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ve=>ve.target.checked)),this._setBackgroundColor(ye),this._setDefaultPropertiesFromJS(ye),this.container.append(ye),this.container}}class f extends b{constructor(j){super(j,{isRenderable:j.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let j=this.annotationStorage,H=this.data,ae=H.id,fe=j.getValue(ae,{value:H.fieldValue===H.buttonValue}).value;typeof fe=="string"&&(fe=fe!==H.buttonValue,j.setValue(ae,{value:fe}));let ye=document.createElement("input");if(v.add(ye),ye.setAttribute("data-element-id",ae),ye.disabled=H.readOnly,this._setRequired(ye,this.data.required),ye.type="radio",ye.name=H.fieldName,fe&&ye.setAttribute("checked",!0),ye.tabIndex=u,ye.addEventListener("change",ve=>{let{name:Le,checked:Fe}=ve.target;for(let ot of this._getElementsByName(Le,ae))j.setValue(ot.id,{value:!1});j.setValue(ae,{value:Fe})}),ye.addEventListener("resetform",ve=>{let Le=H.defaultFieldValue;ve.target.checked=Le!=null&&Le===H.buttonValue}),this.enableScripting&&this.hasJSActions){let ve=H.buttonValue;ye.addEventListener("updatefromsandbox",Le=>{let Fe={value:ot=>{let He=ve===ot.detail.value;for(let $e of this._getElementsByName(ot.target.name)){let Ve=He&&$e.id===ae;$e.domElement&&($e.domElement.checked=Ve),j.setValue($e.id,{value:Ve})}}};this._dispatchEventFromSandbox(Fe,Le)}),this._setEventListeners(ye,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Le=>Le.target.checked)}return this._setBackgroundColor(ye),this._setDefaultPropertiesFromJS(ye),this.container.append(ye),this.container}}class p extends F{constructor(j){super(j,{ignoreBorder:j.data.hasAppearance})}render(){let j=super.render();j.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(j.title=this.data.alternativeText);let H=j.lastChild;return this.enableScripting&&this.hasJSActions&&H&&(this._setDefaultPropertiesFromJS(H),H.addEventListener("updatefromsandbox",ae=>{this._dispatchEventFromSandbox({},ae)})),j}}class C extends b{constructor(j){super(j,{isRenderable:j.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let j=this.annotationStorage,H=this.data.id,ae=j.getValue(H,{value:this.data.fieldValue}),fe=document.createElement("select");v.add(fe),fe.setAttribute("data-element-id",H),fe.disabled=this.data.readOnly,this._setRequired(fe,this.data.required),fe.name=this.data.fieldName,fe.tabIndex=u;let ye=this.data.combo&&this.data.options.length>0;this.data.combo||(fe.size=this.data.options.length,this.data.multiSelect&&(fe.multiple=!0)),fe.addEventListener("resetform",He=>{let $e=this.data.defaultFieldValue;for(let Ve of fe.options)Ve.selected=Ve.value===$e});for(let He of this.data.options){let $e=document.createElement("option");$e.textContent=He.displayValue,$e.value=He.exportValue,ae.value.includes(He.exportValue)&&($e.setAttribute("selected",!0),ye=!1),fe.append($e)}let ve=null;if(ye){let He=document.createElement("option");He.value=" ",He.setAttribute("hidden",!0),He.setAttribute("selected",!0),fe.prepend(He),ve=()=>{He.remove(),fe.removeEventListener("input",ve),ve=null},fe.addEventListener("input",ve)}let Le=He=>{let $e=He?"value":"textContent",{options:Ve,multiple:Ze}=fe;return Ze?Array.prototype.filter.call(Ve,dt=>dt.selected).map(dt=>dt[$e]):Ve.selectedIndex===-1?null:Ve[Ve.selectedIndex][$e]},Fe=Le(!1),ot=He=>{let $e=He.target.options;return Array.prototype.map.call($e,Ve=>({displayValue:Ve.textContent,exportValue:Ve.value}))};return this.enableScripting&&this.hasJSActions?(fe.addEventListener("updatefromsandbox",He=>{let $e={value(Ve){ve?.();let Ze=Ve.detail.value,dt=new Set(Array.isArray(Ze)?Ze:[Ze]);for(let bt of fe.options)bt.selected=dt.has(bt.value);j.setValue(H,{value:Le(!0)}),Fe=Le(!1)},multipleSelection(Ve){fe.multiple=!0},remove(Ve){let Ze=fe.options,dt=Ve.detail.remove;Ze[dt].selected=!1,fe.remove(dt),Ze.length>0&&Array.prototype.findIndex.call(Ze,gt=>gt.selected)===-1&&(Ze[0].selected=!0),j.setValue(H,{value:Le(!0),items:ot(Ve)}),Fe=Le(!1)},clear(Ve){for(;fe.length!==0;)fe.remove(0);j.setValue(H,{value:null,items:[]}),Fe=Le(!1)},insert(Ve){let{index:Ze,displayValue:dt,exportValue:bt}=Ve.detail.insert,gt=fe.children[Ze],Et=document.createElement("option");Et.textContent=dt,Et.value=bt,gt?gt.before(Et):fe.append(Et),j.setValue(H,{value:Le(!0),items:ot(Ve)}),Fe=Le(!1)},items(Ve){let{items:Ze}=Ve.detail;for(;fe.length!==0;)fe.remove(0);for(let dt of Ze){let{displayValue:bt,exportValue:gt}=dt,Et=document.createElement("option");Et.textContent=bt,Et.value=gt,fe.append(Et)}fe.options.length>0&&(fe.options[0].selected=!0),j.setValue(H,{value:Le(!0),items:ot(Ve)}),Fe=Le(!1)},indices(Ve){let Ze=new Set(Ve.detail.indices);for(let dt of Ve.target.options)dt.selected=Ze.has(dt.index);j.setValue(H,{value:Le(!0)}),Fe=Le(!1)},editable(Ve){Ve.target.disabled=!Ve.detail.editable}};this._dispatchEventFromSandbox($e,He)}),fe.addEventListener("input",He=>{let $e=Le(!0);j.setValue(H,{value:$e}),He.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:H,name:"Keystroke",value:Fe,changeEx:$e,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(fe,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],He=>He.target.value)):fe.addEventListener("input",function(He){j.setValue(H,{value:Le(!0)})}),this.data.combo&&this._setTextStyle(fe),this._setBackgroundColor(fe),this._setDefaultPropertiesFromJS(fe),this.container.append(fe),this.container}}class P extends M{constructor(j){let{data:H,elements:ae}=j;super(j,{isRenderable:M._hasPopupData(H)}),this.elements=ae}render(){this.container.classList.add("popupAnnotation");let j=new k({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),H=[];for(let ae of this.elements)ae.popup=j,H.push(ae.data.id),ae.addHighlightArea();return this.container.setAttribute("aria-controls",H.map(ae=>`${e.AnnotationPrefix}${ae}`).join(",")),this.container}}class k{constructor({container:j,color:H,elements:ae,titleObj:fe,modificationDate:ye,contentsObj:ve,richText:Le,parent:Fe,rect:ot,parentRect:He,open:$e}){ee(this,K);ee(this,ie,null);ee(this,ne,G(this,K,gl).bind(this));ee(this,de,G(this,K,Ks).bind(this));ee(this,me,G(this,K,qs).bind(this));ee(this,xe,G(this,K,Zn).bind(this));ee(this,Se,null);ee(this,ke,null);ee(this,Xe,null);ee(this,Ee,null);ee(this,_e,null);ee(this,ue,null);ee(this,re,!1);ee(this,y,null);ee(this,l,null);ee(this,I,null);ee(this,z,null);ee(this,Q,!1);J(this,ke,j),J(this,z,fe),J(this,Xe,ve),J(this,I,Le),J(this,_e,Fe),J(this,Se,H),J(this,l,ot),J(this,ue,He),J(this,Ee,ae);let Ve=t.PDFDateString.toDateObject(ye);Ve&&J(this,ie,Fe.l10n.get("annotation_date_string",{date:Ve.toLocaleDateString(),time:Ve.toLocaleTimeString()})),this.trigger=ae.flatMap(Ze=>Ze.getElementsToTriggerPopup());for(let Ze of this.trigger)Ze.addEventListener("click",s(this,xe)),Ze.addEventListener("mouseenter",s(this,me)),Ze.addEventListener("mouseleave",s(this,de)),Ze.classList.add("popupTriggerArea");for(let Ze of ae)Ze.container?.addEventListener("keydown",s(this,ne));s(this,ke).hidden=!0,$e&&G(this,K,Zn).call(this)}render(){if(s(this,y))return;let{page:{view:j},viewport:{rawDims:{pageWidth:H,pageHeight:ae,pageX:fe,pageY:ye}}}=s(this,_e),ve=J(this,y,document.createElement("div"));if(ve.className="popup",s(this,Se)){let Lt=ve.style.outlineColor=e.Util.makeHexColor(...s(this,Se));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?ve.style.backgroundColor=`color-mix(in srgb, ${Lt} 30%, white)`:ve.style.backgroundColor=e.Util.makeHexColor(...s(this,Se).map(Qi=>Math.floor(.7*(255-Qi)+Qi)))}let Le=document.createElement("span");Le.className="header";let Fe=document.createElement("h1");if(Le.append(Fe),{dir:Fe.dir,str:Fe.textContent}=s(this,z),ve.append(Le),s(this,ie)){let Lt=document.createElement("span");Lt.classList.add("popupDate"),s(this,ie).then(Yi=>{Lt.textContent=Yi}),Le.append(Lt)}let ot=s(this,Xe),He=s(this,I);if(He?.str&&(!ot?.str||ot.str===He.str))o.XfaLayer.render({xfaHtml:He.html,intent:"richText",div:ve}),ve.lastChild.classList.add("richText","popupContent");else{let Lt=this._formatContents(ot);ve.append(Lt)}let $e=!!s(this,ue),Ve=$e?s(this,ue):s(this,l);for(let Lt of s(this,Ee))if(!Ve||e.Util.intersect(Lt.data.rect,Ve)!==null){Ve=Lt.data.rect,$e=!0;break}let Ze=e.Util.normalizeRect([Ve[0],j[3]-Ve[1]+j[1],Ve[2],j[3]-Ve[3]+j[1]]),bt=$e?Ve[2]-Ve[0]+5:0,gt=Ze[0]+bt,Et=Ze[1],{style:ai}=s(this,ke);ai.left=`${100*(gt-fe)/H}%`,ai.top=`${100*(Et-ye)/ae}%`,s(this,ke).append(ve)}_formatContents({str:j,dir:H}){let ae=document.createElement("p");ae.classList.add("popupContent"),ae.dir=H;let fe=j.split(/(?:\r\n?|\n)/);for(let ye=0,ve=fe.length;ye<ve;++ye){let Le=fe[ye];ae.append(document.createTextNode(Le)),ye<ve-1&&ae.append(document.createElement("br"))}return ae}forceHide(){J(this,Q,this.isVisible),s(this,Q)&&(s(this,ke).hidden=!0)}maybeShow(){s(this,Q)&&(J(this,Q,!1),s(this,ke).hidden=!1)}get isVisible(){return s(this,ke).hidden===!1}}ie=new WeakMap,ne=new WeakMap,de=new WeakMap,me=new WeakMap,xe=new WeakMap,Se=new WeakMap,ke=new WeakMap,Xe=new WeakMap,Ee=new WeakMap,_e=new WeakMap,ue=new WeakMap,re=new WeakMap,y=new WeakMap,l=new WeakMap,I=new WeakMap,z=new WeakMap,Q=new WeakMap,K=new WeakSet,gl=function(j){j.altKey||j.shiftKey||j.ctrlKey||j.metaKey||(j.key==="Enter"||j.key==="Escape"&&s(this,re))&&G(this,K,Zn).call(this)},Zn=function(){J(this,re,!s(this,re)),s(this,re)?(G(this,K,qs).call(this),s(this,ke).addEventListener("click",s(this,xe)),s(this,ke).addEventListener("keydown",s(this,ne))):(G(this,K,Ks).call(this),s(this,ke).removeEventListener("click",s(this,xe)),s(this,ke).removeEventListener("keydown",s(this,ne)))},qs=function(){s(this,y)||this.render(),this.isVisible?s(this,re)&&s(this,ke).classList.add("focused"):(s(this,ke).hidden=!1,s(this,ke).style.zIndex=parseInt(s(this,ke).style.zIndex)+1e3)},Ks=function(){s(this,ke).classList.remove("focused"),!(s(this,re)||!this.isVisible)&&(s(this,ke).hidden=!0,s(this,ke).style.zIndex=parseInt(s(this,ke).style.zIndex)-1e3)};class R extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0}),this.textContent=j.data.textContent,this.textPosition=j.data.textPosition,this.annotationEditorType=e.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let j=document.createElement("div");j.classList.add("annotationTextContent"),j.setAttribute("role","comment");for(let H of this.textContent){let ae=document.createElement("span");ae.textContent=H,j.append(ae)}this.container.append(j)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}n.FreeTextAnnotationElement=R;class W extends M{constructor(H){super(H,{isRenderable:!0,ignoreBorder:!0});ee(this,Ie,null)}render(){this.container.classList.add("lineAnnotation");let H=this.data,{width:ae,height:fe}=T(H.rect),ye=this.svgFactory.create(ae,fe,!0),ve=J(this,Ie,this.svgFactory.createElement("svg:line"));return ve.setAttribute("x1",H.rect[2]-H.lineCoordinates[0]),ve.setAttribute("y1",H.rect[3]-H.lineCoordinates[1]),ve.setAttribute("x2",H.rect[2]-H.lineCoordinates[2]),ve.setAttribute("y2",H.rect[3]-H.lineCoordinates[3]),ve.setAttribute("stroke-width",H.borderStyle.width||1),ve.setAttribute("stroke","transparent"),ve.setAttribute("fill","transparent"),ye.append(ve),this.container.append(ye),!H.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,Ie)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ie=new WeakMap;class w extends M{constructor(H){super(H,{isRenderable:!0,ignoreBorder:!0});ee(this,Qe,null)}render(){this.container.classList.add("squareAnnotation");let H=this.data,{width:ae,height:fe}=T(H.rect),ye=this.svgFactory.create(ae,fe,!0),ve=H.borderStyle.width,Le=J(this,Qe,this.svgFactory.createElement("svg:rect"));return Le.setAttribute("x",ve/2),Le.setAttribute("y",ve/2),Le.setAttribute("width",ae-ve),Le.setAttribute("height",fe-ve),Le.setAttribute("stroke-width",ve||1),Le.setAttribute("stroke","transparent"),Le.setAttribute("fill","transparent"),ye.append(Le),this.container.append(ye),!H.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,Qe)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qe=new WeakMap;class D extends M{constructor(H){super(H,{isRenderable:!0,ignoreBorder:!0});ee(this,ze,null)}render(){this.container.classList.add("circleAnnotation");let H=this.data,{width:ae,height:fe}=T(H.rect),ye=this.svgFactory.create(ae,fe,!0),ve=H.borderStyle.width,Le=J(this,ze,this.svgFactory.createElement("svg:ellipse"));return Le.setAttribute("cx",ae/2),Le.setAttribute("cy",fe/2),Le.setAttribute("rx",ae/2-ve/2),Le.setAttribute("ry",fe/2-ve/2),Le.setAttribute("stroke-width",ve||1),Le.setAttribute("stroke","transparent"),Le.setAttribute("fill","transparent"),ye.append(Le),this.container.append(ye),!H.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,ze)}addHighlightArea(){this.container.classList.add("highlightArea")}}ze=new WeakMap;class V extends M{constructor(H){super(H,{isRenderable:!0,ignoreBorder:!0});ee(this,We,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let H=this.data,{width:ae,height:fe}=T(H.rect),ye=this.svgFactory.create(ae,fe,!0),ve=[];for(let Fe of H.vertices){let ot=Fe.x-H.rect[0],He=H.rect[3]-Fe.y;ve.push(ot+","+He)}ve=ve.join(" ");let Le=J(this,We,this.svgFactory.createElement(this.svgElementName));return Le.setAttribute("points",ve),Le.setAttribute("stroke-width",H.borderStyle.width||1),Le.setAttribute("stroke","transparent"),Le.setAttribute("fill","transparent"),ye.append(Le),this.container.append(ye),!H.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,We)}addHighlightArea(){this.container.classList.add("highlightArea")}}We=new WeakMap;class U extends V{constructor(j){super(j),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class q extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class $ extends M{constructor(H){super(H,{isRenderable:!0,ignoreBorder:!0});ee(this,rt,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=e.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);let H=this.data,{width:ae,height:fe}=T(H.rect),ye=this.svgFactory.create(ae,fe,!0);for(let ve of H.inkLists){let Le=[];for(let ot of ve){let He=ot.x-H.rect[0],$e=H.rect[3]-ot.y;Le.push(`${He},${$e}`)}Le=Le.join(" ");let Fe=this.svgFactory.createElement(this.svgElementName);s(this,rt).push(Fe),Fe.setAttribute("points",Le),Fe.setAttribute("stroke-width",H.borderStyle.width||1),Fe.setAttribute("stroke","transparent"),Fe.setAttribute("fill","transparent"),!H.popupRef&&this.hasPopupData&&this._createPopup(),ye.append(Fe)}return this.container.append(ye),this.container}getElementsToTriggerPopup(){return s(this,rt)}addHighlightArea(){this.container.classList.add("highlightArea")}}rt=new WeakMap,n.InkAnnotationElement=$;class x extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class a extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class c extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class E extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class B extends M{constructor(j){super(j,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}n.StampAnnotationElement=B;class O extends M{constructor(H){super(H,{isRenderable:!0});ee(this,be);ee(this,at,null);let{filename:ae,content:fe}=this.data.file;this.filename=(0,t.getFilenameFromUrl)(ae,!0),this.content=fe,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:ae,content:fe})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:H,data:ae}=this,fe;ae.hasAppearance||ae.fillAlpha===0?fe=document.createElement("div"):(fe=document.createElement("img"),fe.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(ae.name)?"paperclip":"pushpin"}.svg`,ae.fillAlpha&&ae.fillAlpha<1&&(fe.style=`filter: opacity(${Math.round(ae.fillAlpha*100)}%);`)),fe.addEventListener("dblclick",G(this,be,Ys).bind(this)),J(this,at,fe);let{isMac:ye}=e.FeatureTest.platform;return H.addEventListener("keydown",ve=>{ve.key==="Enter"&&(ye?ve.metaKey:ve.ctrlKey)&&G(this,be,Ys).call(this)}),!ae.popupRef&&this.hasPopupData?this._createPopup():fe.classList.add("popupTriggerArea"),H.append(fe),H}getElementsToTriggerPopup(){return s(this,at)}addHighlightArea(){this.container.classList.add("highlightArea")}}at=new WeakMap,be=new WeakSet,Ys=function(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)};class Y{constructor({div:j,accessibilityManager:H,annotationCanvasMap:ae,l10n:fe,page:ye,viewport:ve}){ee(this,te);ee(this,ce,null);ee(this,Me,null);ee(this,et,new Map);this.div=j,J(this,ce,H),J(this,Me,ae),this.l10n=fe,this.page=ye,this.viewport=ve,this.zIndex=0,this.l10n||=m.NullL10n}render(j){return Ue(this,null,function*(){let{annotations:H}=j,ae=this.div;(0,t.setLayerDimensions)(ae,this.viewport);let fe=new Map,ye={data:null,layer:ae,linkService:j.linkService,downloadManager:j.downloadManager,imageResourcesPath:j.imageResourcesPath||"",renderForms:j.renderForms!==!1,svgFactory:new t.DOMSVGFactory,annotationStorage:j.annotationStorage||new i.AnnotationStorage,enableScripting:j.enableScripting===!0,hasJSActions:j.hasJSActions,fieldObjects:j.fieldObjects,parent:this,elements:null};for(let ve of H){if(ve.noHTML)continue;let Le=ve.annotationType===e.AnnotationType.POPUP;if(Le){let He=fe.get(ve.id);if(!He)continue;ye.elements=He}else{let{width:He,height:$e}=T(ve.rect);if(He<=0||$e<=0)continue}ye.data=ve;let Fe=A.create(ye);if(!Fe.isRenderable)continue;if(!Le&&ve.popupRef){let He=fe.get(ve.popupRef);He?He.push(Fe):fe.set(ve.popupRef,[Fe])}Fe.annotationEditorType>0&&s(this,et).set(Fe.data.id,Fe);let ot=Fe.render();ve.hidden&&(ot.style.visibility="hidden"),G(this,te,ml).call(this,ot,ve.id)}G(this,te,Qs).call(this),yield this.l10n.translate(ae)})}update({viewport:j}){let H=this.div;this.viewport=j,(0,t.setLayerDimensions)(H,{rotation:j.rotation}),G(this,te,Qs).call(this),H.hidden=!1}getEditableAnnotations(){return Array.from(s(this,et).values())}getEditableAnnotation(j){return s(this,et).get(j)}}ce=new WeakMap,Me=new WeakMap,et=new WeakMap,te=new WeakSet,ml=function(j,H){let ae=j.firstChild||j;ae.id=`${e.AnnotationPrefix}${H}`,this.div.append(j),s(this,ce)?.moveElementInDOM(this.div,j,ae,!1)},Qs=function(){if(!s(this,Me))return;let j=this.div;for(let[H,ae]of s(this,Me)){let fe=j.querySelector(`[data-annotation-id="${H}"]`);if(!fe)continue;let{firstChild:ye}=fe;ye?ye.nodeName==="CANVAS"?ye.replaceWith(ae):ye.before(ae):fe.append(ae)}s(this,Me).clear()},n.AnnotationLayer=Y},(h,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorConverters=void 0;function _(i){return Math.floor(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function e(i){return Math.max(0,Math.min(255,255*i))}class t{static CMYK_G([r,m,o,u]){return["G",1-Math.min(1,.3*r+.59*o+.11*m+u)]}static G_CMYK([r]){return["CMYK",0,0,0,1-r]}static G_RGB([r]){return["RGB",r,r,r]}static G_rgb([r]){return r=e(r),[r,r,r]}static G_HTML([r]){let m=_(r);return`#${m}${m}${m}`}static RGB_G([r,m,o]){return["G",.3*r+.59*m+.11*o]}static RGB_rgb(r){return r.map(e)}static RGB_HTML(r){return`#${r.map(_).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([r,m,o,u]){return["RGB",1-Math.min(1,r+u),1-Math.min(1,o+u),1-Math.min(1,m+u)]}static CMYK_rgb([r,m,o,u]){return[e(1-Math.min(1,r+u)),e(1-Math.min(1,o+u)),e(1-Math.min(1,m+u))]}static CMYK_HTML(r){let m=this.CMYK_RGB(r).slice(1);return this.RGB_HTML(m)}static RGB_CMYK([r,m,o]){let u=1-r,d=1-m,v=1-o,T=Math.min(u,d,v);return["CMYK",u,d,v,T]}}n.ColorConverters=t},(h,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.NullL10n=void 0,n.getL10nFallback=e;let _={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xD7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xD7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};_.print_progress_percent="{{progress}}%";function e(m,o){switch(m){case"find_match_count":m=`find_match_count[${o.total===1?"one":"other"}]`;break;case"find_match_count_limit":m=`find_match_count_limit[${o.limit===1?"one":"other"}]`;break}return _[m]||""}function t(m,o){return o?m.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(u,d)=>d in o?o[d]:"{{"+d+"}}"):m}let i={getLanguage(){return Ue(this,null,function*(){return"en-us"})},getDirection(){return Ue(this,null,function*(){return"ltr"})},get(d){return Ue(this,arguments,function*(m,o=null,u=e(m,o)){return t(u,o)})},translate(m){return Ue(this,null,function*(){})}};n.NullL10n=i},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.XfaLayer=void 0;var e=_(25);class t{static setupStorage(r,m,o,u,d){let v=u.getValue(m,{value:null});switch(o.name){case"textarea":if(v.value!==null&&(r.textContent=v.value),d==="print")break;r.addEventListener("input",T=>{u.setValue(m,{value:T.target.value})});break;case"input":if(o.attributes.type==="radio"||o.attributes.type==="checkbox"){if(v.value===o.attributes.xfaOn?r.setAttribute("checked",!0):v.value===o.attributes.xfaOff&&r.removeAttribute("checked"),d==="print")break;r.addEventListener("change",T=>{u.setValue(m,{value:T.target.checked?T.target.getAttribute("xfaOn"):T.target.getAttribute("xfaOff")})})}else{if(v.value!==null&&r.setAttribute("value",v.value),d==="print")break;r.addEventListener("input",T=>{u.setValue(m,{value:T.target.value})})}break;case"select":if(v.value!==null){r.setAttribute("value",v.value);for(let T of o.children)T.attributes.value===v.value?T.attributes.selected=!0:T.attributes.hasOwnProperty("selected")&&delete T.attributes.selected}r.addEventListener("input",T=>{let A=T.target.options,M=A.selectedIndex===-1?"":A[A.selectedIndex].value;u.setValue(m,{value:M})});break}}static setAttributes({html:r,element:m,storage:o=null,intent:u,linkService:d}){let{attributes:v}=m,T=r instanceof HTMLAnchorElement;v.type==="radio"&&(v.name=`${v.name}-${u}`);for(let[A,M]of Object.entries(v))if(M!=null)switch(A){case"class":M.length&&r.setAttribute(A,M.join(" "));break;case"dataId":break;case"id":r.setAttribute("data-element-id",M);break;case"style":Object.assign(r.style,M);break;case"textContent":r.textContent=M;break;default:(!T||A!=="href"&&A!=="newWindow")&&r.setAttribute(A,M)}T&&d.addLinkAttributes(r,v.href,v.newWindow),o&&v.dataId&&this.setupStorage(r,v.dataId,m,o)}static render(r){let m=r.annotationStorage,o=r.linkService,u=r.xfaHtml,d=r.intent||"display",v=document.createElement(u.name);u.attributes&&this.setAttributes({html:v,element:u,intent:d,linkService:o});let T=[[u,-1,v]],A=r.div;if(A.append(v),r.viewport){let F=`matrix(${r.viewport.transform.join(",")})`;A.style.transform=F}d!=="richText"&&A.setAttribute("class","xfaLayer xfaFont");let M=[];for(;T.length>0;){let[F,S,b]=T.at(-1);if(S+1===F.children.length){T.pop();continue}let N=F.children[++T.at(-1)[1]];if(N===null)continue;let{name:L}=N;if(L==="#text"){let f=document.createTextNode(N.value);M.push(f),b.append(f);continue}let g=N?.attributes?.xmlns?document.createElementNS(N.attributes.xmlns,L):document.createElement(L);if(b.append(g),N.attributes&&this.setAttributes({html:g,element:N,storage:m,intent:d,linkService:o}),N.children&&N.children.length>0)T.push([N,-1,g]);else if(N.value){let f=document.createTextNode(N.value);e.XfaText.shouldBuildText(L)&&M.push(f),g.append(f)}}for(let F of A.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))F.setAttribute("readOnly",!0);return{textDivs:M}}static update(r){let m=`matrix(${r.viewport.transform.join(",")})`;r.div.style.transform=m,r.div.hidden=!1}}n.XfaLayer=t},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InkEditor=void 0;var e=_(1),t=_(4),i=_(29),r=_(6),m=_(5);let o=(()=>{var d,v,T,A,M,F,S,b,N,L,g,f,p,C,P,_l,bl,vl,yl,Zs,Cl,Js,wl,Sl,xl,Al,Pl,gi,er,Jn,es,Xi,tr,ts,ne,El,ir,Tl,Ml,nr,is,qi;let _e=class _e extends t.AnnotationEditor{constructor(y){super(At(ft({},y),{name:"inkEditor"}));ee(this,P);ee(this,d,0);ee(this,v,0);ee(this,T,this.canvasPointermove.bind(this));ee(this,A,this.canvasPointerleave.bind(this));ee(this,M,this.canvasPointerup.bind(this));ee(this,F,this.canvasPointerdown.bind(this));ee(this,S,new Path2D);ee(this,b,!1);ee(this,N,!1);ee(this,L,!1);ee(this,g,null);ee(this,f,0);ee(this,p,0);ee(this,C,null);this.color=y.color||null,this.thickness=y.thickness||null,this.opacity=y.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(y){t.AnnotationEditor.initialize(y,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(y,l){switch(y){case e.AnnotationEditorParamsType.INK_THICKNESS:_e._defaultThickness=l;break;case e.AnnotationEditorParamsType.INK_COLOR:_e._defaultColor=l;break;case e.AnnotationEditorParamsType.INK_OPACITY:_e._defaultOpacity=l/100;break}}updateParams(y,l){switch(y){case e.AnnotationEditorParamsType.INK_THICKNESS:G(this,P,_l).call(this,l);break;case e.AnnotationEditorParamsType.INK_COLOR:G(this,P,bl).call(this,l);break;case e.AnnotationEditorParamsType.INK_OPACITY:G(this,P,vl).call(this,l);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.INK_THICKNESS,_e._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,_e._defaultColor||t.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(_e._defaultOpacity*100)]]}get propertiesToUpdate(){return[[e.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||_e._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,this.color||_e._defaultColor||t.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??_e._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(G(this,P,Jn).call(this),G(this,P,es).call(this)),this.isAttachedToDOM||(this.parent.add(this),G(this,P,Xi).call(this)),G(this,P,qi).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,s(this,g).disconnect(),J(this,g,null),super.remove())}setParent(y){!this.parent&&y?this._uiManager.removeShouldRescale(this):this.parent&&y===null&&this._uiManager.addShouldRescale(this),super.setParent(y)}onScaleChanging(){let[y,l]=this.parentDimensions,I=this.width*y,z=this.height*l;this.setDimensions(I,z)}enableEditMode(){s(this,b)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",s(this,F)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",s(this,F)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){s(this,b)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),J(this,b,!0),this.div.classList.add("disabled"),G(this,P,qi).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(y){this._focusEventsAllowed&&(super.focusin(y),this.enableEditMode())}canvasPointerdown(y){y.button!==0||!this.isInEditMode()||s(this,b)||(this.setInForeground(),y.preventDefault(),y.type!=="mouse"&&this.div.focus(),G(this,P,Cl).call(this,y.offsetX,y.offsetY))}canvasPointermove(y){y.preventDefault(),G(this,P,Js).call(this,y.offsetX,y.offsetY)}canvasPointerup(y){y.preventDefault(),G(this,P,er).call(this,y)}canvasPointerleave(y){G(this,P,er).call(this,y)}get isResizable(){return!this.isEmpty()&&s(this,b)}render(){if(this.div)return this.div;let y,l;this.width&&(y=this.x,l=this.y),super.render(),t.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(le=>this.div?.setAttribute("aria-label",le));let[I,z,Q,K]=G(this,P,yl).call(this);if(this.setAt(I,z,0,0),this.setDims(Q,K),G(this,P,Jn).call(this),this.width){let[le,se]=this.parentDimensions;this.setAspectRatio(this.width*le,this.height*se),this.setAt(y*le,l*se,this.width*le,this.height*se),J(this,L,!0),G(this,P,Xi).call(this),this.setDims(this.width*le,this.height*se),G(this,P,gi).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return G(this,P,es).call(this),this.div}setDimensions(y,l){let I=Math.round(y),z=Math.round(l);if(s(this,f)===I&&s(this,p)===z)return;J(this,f,I),J(this,p,z),this.canvas.style.visibility="hidden";let[Q,K]=this.parentDimensions;this.width=y/Q,this.height=l/K,this.fixAndSetPosition(),s(this,b)&&G(this,P,tr).call(this,y,l),G(this,P,Xi).call(this),G(this,P,gi).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(y,l,I){var rt,at,be;if(y instanceof i.InkAnnotationElement)return null;let z=super.deserialize(y,l,I);z.thickness=y.thickness,z.color=e.Util.makeHexColor(...y.color),z.opacity=y.opacity;let[Q,K]=z.pageDimensions,le=z.width*Q,se=z.height*K,oe=z.parentScale,we=y.thickness/2;J(z,b,!0),J(z,f,Math.round(le)),J(z,p,Math.round(se));let{paths:Ie,rect:Qe,rotation:ze}=y;for(let{bezier:he}of Ie){he=G(rt=_e,ne,Tl).call(rt,he,Qe,ze);let ce=[];z.paths.push(ce);let Me=oe*(he[0]-we),et=oe*(he[1]-we);for(let Pe=2,Ye=he.length;Pe<Ye;Pe+=6){let Oe=oe*(he[Pe]-we),j=oe*(he[Pe+1]-we),H=oe*(he[Pe+2]-we),ae=oe*(he[Pe+3]-we),fe=oe*(he[Pe+4]-we),ye=oe*(he[Pe+5]-we);ce.push([[Me,et],[Oe,j],[H,ae],[fe,ye]]),Me=fe,et=ye}let te=G(this,ne,El).call(this,ce);z.bezierPath2D.push(te)}let We=G(at=z,P,nr).call(at);return J(z,v,Math.max(t.AnnotationEditor.MIN_SIZE,We[2]-We[0])),J(z,d,Math.max(t.AnnotationEditor.MIN_SIZE,We[3]-We[1])),G(be=z,P,tr).call(be,le,se),z}serialize(){if(this.isEmpty())return null;let y=this.getRect(0,0),l=t.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:e.AnnotationEditorType.INK,color:l,thickness:this.thickness,opacity:this.opacity,paths:G(this,P,Ml).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,y),pageIndex:this.pageIndex,rect:y,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakMap,N=new WeakMap,L=new WeakMap,g=new WeakMap,f=new WeakMap,p=new WeakMap,C=new WeakMap,P=new WeakSet,_l=function(y){let l=this.thickness;this.addCommands({cmd:()=>{this.thickness=y,G(this,P,qi).call(this)},undo:()=>{this.thickness=l,G(this,P,qi).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},bl=function(y){let l=this.color;this.addCommands({cmd:()=>{this.color=y,G(this,P,gi).call(this)},undo:()=>{this.color=l,G(this,P,gi).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},vl=function(y){y/=100;let l=this.opacity;this.addCommands({cmd:()=>{this.opacity=y,G(this,P,gi).call(this)},undo:()=>{this.opacity=l,G(this,P,gi).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},yl=function(){let{parentRotation:y,parentDimensions:[l,I]}=this;switch(y){case 90:return[0,I,I,l];case 180:return[l,I,l,I];case 270:return[l,0,I,l];default:return[0,0,l,I]}},Zs=function(){let{ctx:y,color:l,opacity:I,thickness:z,parentScale:Q,scaleFactor:K}=this;y.lineWidth=z*Q/K,y.lineCap="round",y.lineJoin="round",y.miterLimit=10,y.strokeStyle=`${l}${(0,m.opacityToHex)(I)}`},Cl=function(y,l){this.canvas.addEventListener("contextmenu",r.noContextMenu),this.canvas.addEventListener("pointerleave",s(this,A)),this.canvas.addEventListener("pointermove",s(this,T)),this.canvas.addEventListener("pointerup",s(this,M)),this.canvas.removeEventListener("pointerdown",s(this,F)),this.isEditing=!0,s(this,L)||(J(this,L,!0),G(this,P,Xi).call(this),this.thickness||=_e._defaultThickness,this.color||=_e._defaultColor||t.AnnotationEditor._defaultLineColor,this.opacity??=_e._defaultOpacity),this.currentPath.push([y,l]),J(this,N,!1),G(this,P,Zs).call(this),J(this,C,()=>{G(this,P,xl).call(this),s(this,C)&&window.requestAnimationFrame(s(this,C))}),window.requestAnimationFrame(s(this,C))},Js=function(y,l){let[I,z]=this.currentPath.at(-1);if(this.currentPath.length>1&&y===I&&l===z)return;let Q=this.currentPath,K=s(this,S);if(Q.push([y,l]),J(this,N,!0),Q.length<=2){K.moveTo(...Q[0]),K.lineTo(y,l);return}Q.length===3&&(J(this,S,K=new Path2D),K.moveTo(...Q[0])),G(this,P,Al).call(this,K,...Q.at(-3),...Q.at(-2),y,l)},wl=function(){if(this.currentPath.length===0)return;let y=this.currentPath.at(-1);s(this,S).lineTo(...y)},Sl=function(y,l){J(this,C,null),y=Math.min(Math.max(y,0),this.canvas.width),l=Math.min(Math.max(l,0),this.canvas.height),G(this,P,Js).call(this,y,l),G(this,P,wl).call(this);let I;if(this.currentPath.length!==1)I=G(this,P,Pl).call(this);else{let se=[y,l];I=[[se,se.slice(),se.slice(),se]]}let z=s(this,S),Q=this.currentPath;this.currentPath=[],J(this,S,new Path2D);let K=()=>{this.allRawPaths.push(Q),this.paths.push(I),this.bezierPath2D.push(z),this.rebuild()},le=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(G(this,P,Jn).call(this),G(this,P,es).call(this)),G(this,P,qi).call(this))};this.addCommands({cmd:K,undo:le,mustExec:!0})},xl=function(){if(!s(this,N))return;J(this,N,!1);let y=Math.ceil(this.thickness*this.parentScale),l=this.currentPath.slice(-3),I=l.map(we=>we[0]),z=l.map(we=>we[1]),Q=Math.min(...I)-y,K=Math.max(...I)+y,le=Math.min(...z)-y,se=Math.max(...z)+y,{ctx:oe}=this;oe.save(),oe.clearRect(0,0,this.canvas.width,this.canvas.height);for(let we of this.bezierPath2D)oe.stroke(we);oe.stroke(s(this,S)),oe.restore()},Al=function(y,l,I,z,Q,K,le){let se=(l+z)/2,oe=(I+Q)/2,we=(z+K)/2,Ie=(Q+le)/2;y.bezierCurveTo(se+2*(z-se)/3,oe+2*(Q-oe)/3,we+2*(z-we)/3,Ie+2*(Q-Ie)/3,we,Ie)},Pl=function(){let y=this.currentPath;if(y.length<=2)return[[y[0],y[0],y.at(-1),y.at(-1)]];let l=[],I,[z,Q]=y[0];for(I=1;I<y.length-2;I++){let[Qe,ze]=y[I],[We,rt]=y[I+1],at=(Qe+We)/2,be=(ze+rt)/2,he=[z+2*(Qe-z)/3,Q+2*(ze-Q)/3],ce=[at+2*(Qe-at)/3,be+2*(ze-be)/3];l.push([[z,Q],he,ce,[at,be]]),[z,Q]=[at,be]}let[K,le]=y[I],[se,oe]=y[I+1],we=[z+2*(K-z)/3,Q+2*(le-Q)/3],Ie=[se+2*(K-se)/3,oe+2*(le-oe)/3];return l.push([[z,Q],we,Ie,[se,oe]]),l},gi=function(){if(this.isEmpty()){G(this,P,ts).call(this);return}G(this,P,Zs).call(this);let{canvas:y,ctx:l}=this;l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,y.width,y.height),G(this,P,ts).call(this);for(let I of this.bezierPath2D)l.stroke(I)},er=function(y){this.canvas.removeEventListener("pointerleave",s(this,A)),this.canvas.removeEventListener("pointermove",s(this,T)),this.canvas.removeEventListener("pointerup",s(this,M)),this.canvas.addEventListener("pointerdown",s(this,F)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",r.noContextMenu)},10),G(this,P,Sl).call(this,y.offsetX,y.offsetY),this.addToAnnotationStorage(),this.setInBackground()},Jn=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",t.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(y=>this.canvas?.setAttribute("aria-label",y)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},es=function(){J(this,g,new ResizeObserver(y=>{let l=y[0].contentRect;l.width&&l.height&&this.setDimensions(l.width,l.height)})),s(this,g).observe(this.div)},Xi=function(){if(!s(this,L))return;let[y,l]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*y),this.canvas.height=Math.ceil(this.height*l),G(this,P,ts).call(this)},tr=function(y,l){let I=G(this,P,is).call(this),z=(y-I)/s(this,v),Q=(l-I)/s(this,d);this.scaleFactor=Math.min(z,Q)},ts=function(){let y=G(this,P,is).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+y,this.translationY*this.scaleFactor+y)},ne=new WeakSet,El=function(y){let l=new Path2D;for(let I=0,z=y.length;I<z;I++){let[Q,K,le,se]=y[I];I===0&&l.moveTo(...Q),l.bezierCurveTo(K[0],K[1],le[0],le[1],se[0],se[1])}return l},ir=function(y,l,I){let[z,Q,K,le]=l;switch(I){case 0:for(let se=0,oe=y.length;se<oe;se+=2)y[se]+=z,y[se+1]=le-y[se+1];break;case 90:for(let se=0,oe=y.length;se<oe;se+=2){let we=y[se];y[se]=y[se+1]+z,y[se+1]=we+Q}break;case 180:for(let se=0,oe=y.length;se<oe;se+=2)y[se]=K-y[se],y[se+1]+=Q;break;case 270:for(let se=0,oe=y.length;se<oe;se+=2){let we=y[se];y[se]=K-y[se+1],y[se+1]=le-we}break;default:throw new Error("Invalid rotation")}return y},Tl=function(y,l,I){let[z,Q,K,le]=l;switch(I){case 0:for(let se=0,oe=y.length;se<oe;se+=2)y[se]-=z,y[se+1]=le-y[se+1];break;case 90:for(let se=0,oe=y.length;se<oe;se+=2){let we=y[se];y[se]=y[se+1]-Q,y[se+1]=we-z}break;case 180:for(let se=0,oe=y.length;se<oe;se+=2)y[se]=K-y[se],y[se+1]-=Q;break;case 270:for(let se=0,oe=y.length;se<oe;se+=2){let we=y[se];y[se]=le-y[se+1],y[se+1]=K-we}break;default:throw new Error("Invalid rotation")}return y},Ml=function(y,l,I,z){var oe,we;let Q=[],K=this.thickness/2,le=y*l+K,se=y*I+K;for(let Ie of this.paths){let Qe=[],ze=[];for(let We=0,rt=Ie.length;We<rt;We++){let[at,be,he,ce]=Ie[We],Me=y*at[0]+le,et=y*at[1]+se,te=y*be[0]+le,Pe=y*be[1]+se,Ye=y*he[0]+le,Oe=y*he[1]+se,j=y*ce[0]+le,H=y*ce[1]+se;We===0&&(Qe.push(Me,et),ze.push(Me,et)),Qe.push(te,Pe,Ye,Oe,j,H),ze.push(te,Pe),We===rt-1&&ze.push(j,H)}Q.push({bezier:G(oe=_e,ne,ir).call(oe,Qe,z,this.rotation),points:G(we=_e,ne,ir).call(we,ze,z,this.rotation)})}return Q},nr=function(){let y=1/0,l=-1/0,I=1/0,z=-1/0;for(let Q of this.paths)for(let[K,le,se,oe]of Q){let we=e.Util.bezierBoundingBox(...K,...le,...se,...oe);y=Math.min(y,we[0]),I=Math.min(I,we[1]),l=Math.max(l,we[2]),z=Math.max(z,we[3])}return[y,I,l,z]},is=function(){return s(this,b)?Math.ceil(this.thickness*this.parentScale):0},qi=function(y=!1){if(this.isEmpty())return;if(!s(this,b)){G(this,P,gi).call(this);return}let l=G(this,P,nr).call(this),I=G(this,P,is).call(this);J(this,v,Math.max(t.AnnotationEditor.MIN_SIZE,l[2]-l[0])),J(this,d,Math.max(t.AnnotationEditor.MIN_SIZE,l[3]-l[1]));let z=Math.ceil(I+s(this,v)*this.scaleFactor),Q=Math.ceil(I+s(this,d)*this.scaleFactor),[K,le]=this.parentDimensions;this.width=z/K,this.height=Q/le,this.setAspectRatio(z,Q);let se=this.translationX,oe=this.translationY;this.translationX=-l[0],this.translationY=-l[1],G(this,P,Xi).call(this),G(this,P,gi).call(this),J(this,f,z),J(this,p,Q),this.setDims(z,Q);let we=y?I/this.scaleFactor/2:0;this.translate(se-this.translationX-we,oe-this.translationY-we)},ee(_e,ne),qe(_e,"_defaultColor",null),qe(_e,"_defaultOpacity",1),qe(_e,"_defaultThickness",1),qe(_e,"_type","ink");let u=_e;return u})();n.InkEditor=o},(h,n,_)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.StampEditor=void 0;var e=_(1),t=_(4),i=_(6),r=_(29);let m=(()=>{var u,d,v,T,A,M,F,S,b,N,L,cn,hn,ns,sr,kl,Ll,rr,ss,Il;let D=class D extends t.AnnotationEditor{constructor(q){super(At(ft({},q),{name:"stampEditor"}));ee(this,L);ee(this,u,null);ee(this,d,null);ee(this,v,null);ee(this,T,null);ee(this,A,null);ee(this,M,null);ee(this,F,null);ee(this,S,null);ee(this,b,!1);ee(this,N,!1);J(this,T,q.bitmapUrl),J(this,A,q.bitmapFile)}static initialize(q){t.AnnotationEditor.initialize(q)}static get supportedTypes(){let q=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,e.shadow)(this,"supportedTypes",q.map($=>`image/${$}`))}static get supportedTypesStr(){return(0,e.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(q){return this.supportedTypes.includes(q)}static paste(q,$){$.pasteEditor(e.AnnotationEditorType.STAMP,{bitmapFile:q.getAsFile()})}remove(){s(this,d)&&(J(this,u,null),this._uiManager.imageManager.deleteId(s(this,d)),s(this,M)?.remove(),J(this,M,null),s(this,F)?.disconnect(),J(this,F,null)),super.remove()}rebuild(){if(!this.parent){s(this,d)&&G(this,L,ns).call(this);return}super.rebuild(),this.div!==null&&(s(this,d)&&G(this,L,ns).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(s(this,v)||s(this,u)||s(this,T)||s(this,A))}get isResizable(){return!0}render(){if(this.div)return this.div;let q,$;if(this.width&&(q=this.x,$=this.y),super.render(),this.div.hidden=!0,s(this,u)?G(this,L,sr).call(this):G(this,L,ns).call(this),this.width){let[x,a]=this.parentDimensions;this.setAt(q*x,$*a,this.width*x,this.height*a)}return this.div}static deserialize(q,$,x){if(q instanceof r.StampAnnotationElement)return null;let a=super.deserialize(q,$,x),{rect:c,bitmapUrl:E,bitmapId:B,isSvg:O,accessibilityData:Y}=q;B&&x.imageManager.isValidId(B)?J(a,d,B):J(a,T,E),J(a,b,O);let[Z,X]=a.pageDimensions;return a.width=(c[2]-c[0])/Z,a.height=(c[3]-c[1])/X,Y&&(a.altTextData=Y),a}serialize(q=!1,$=null){if(this.isEmpty())return null;let x={annotationType:e.AnnotationEditorType.STAMP,bitmapId:s(this,d),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:s(this,b),structTreeParentId:this._structTreeParentId};if(q)return x.bitmapUrl=G(this,L,ss).call(this,!0),x.accessibilityData=this.altTextData,x;let{decorative:a,altText:c}=this.altTextData;if(!a&&c&&(x.accessibilityData={type:"Figure",alt:c}),$===null)return x;$.stamps||=new Map;let E=s(this,b)?(x.rect[2]-x.rect[0])*(x.rect[3]-x.rect[1]):null;if(!$.stamps.has(s(this,d)))$.stamps.set(s(this,d),{area:E,serialized:x}),x.bitmap=G(this,L,ss).call(this,!1);else if(s(this,b)){let B=$.stamps.get(s(this,d));E>B.area&&(B.area=E,B.serialized.bitmap.close(),B.serialized.bitmap=G(this,L,ss).call(this,!1))}return x}};u=new WeakMap,d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakMap,N=new WeakMap,L=new WeakSet,cn=function(q,$=!1){if(!q){this.remove();return}J(this,u,q.bitmap),$||(J(this,d,q.id),J(this,b,q.isSvg)),G(this,L,sr).call(this)},hn=function(){J(this,v,null),this._uiManager.enableWaiting(!1),s(this,M)&&this.div.focus()},ns=function(){if(s(this,d)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(s(this,d)).then($=>G(this,L,cn).call(this,$,!0)).finally(()=>G(this,L,hn).call(this));return}if(s(this,T)){let $=s(this,T);J(this,T,null),this._uiManager.enableWaiting(!0),J(this,v,this._uiManager.imageManager.getFromUrl($).then(x=>G(this,L,cn).call(this,x)).finally(()=>G(this,L,hn).call(this)));return}if(s(this,A)){let $=s(this,A);J(this,A,null),this._uiManager.enableWaiting(!0),J(this,v,this._uiManager.imageManager.getFromFile($).then(x=>G(this,L,cn).call(this,x)).finally(()=>G(this,L,hn).call(this)));return}let q=document.createElement("input");q.type="file",q.accept=D.supportedTypesStr,J(this,v,new Promise($=>{q.addEventListener("change",()=>Ue(this,null,function*(){if(!q.files||q.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let x=yield this._uiManager.imageManager.getFromFile(q.files[0]);G(this,L,cn).call(this,x)}$()})),q.addEventListener("cancel",()=>{this.remove(),$()})}).finally(()=>G(this,L,hn).call(this))),q.click()},sr=function(){let{div:q}=this,{width:$,height:x}=s(this,u),[a,c]=this.pageDimensions,E=.75;if(this.width)$=this.width*a,x=this.height*c;else if($>E*a||x>E*c){let Z=Math.min(E*a/$,E*c/x);$*=Z,x*=Z}let[B,O]=this.parentDimensions;this.setDims($*B/a,x*O/c),this._uiManager.enableWaiting(!1);let Y=J(this,M,document.createElement("canvas"));q.append(Y),q.hidden=!1,G(this,L,rr).call(this,$,x),G(this,L,Il).call(this),s(this,N)||(this.parent.addUndoableEditor(this),J(this,N,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},kl=function(q,$){let[x,a]=this.parentDimensions;this.width=q/x,this.height=$/a,this.setDims(q,$),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,s(this,S)!==null&&clearTimeout(s(this,S)),J(this,S,setTimeout(()=>{J(this,S,null),G(this,L,rr).call(this,q,$)},200))},Ll=function(q,$){let{width:x,height:a}=s(this,u),c=x,E=a,B=s(this,u);for(;c>2*q||E>2*$;){let O=c,Y=E;c>2*q&&(c=c>=16384?Math.floor(c/2)-1:Math.ceil(c/2)),E>2*$&&(E=E>=16384?Math.floor(E/2)-1:Math.ceil(E/2));let Z=new OffscreenCanvas(c,E);Z.getContext("2d").drawImage(B,0,0,O,Y,0,0,c,E),B=Z.transferToImageBitmap()}return B},rr=function(q,$){q=Math.ceil(q),$=Math.ceil($);let x=s(this,M);if(!x||x.width===q&&x.height===$)return;x.width=q,x.height=$;let a=s(this,b)?s(this,u):G(this,L,Ll).call(this,q,$),c=x.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(a,0,0,a.width,a.height,0,0,q,$)},ss=function(q){if(q){if(s(this,b)){let a=this._uiManager.imageManager.getSvgUrl(s(this,d));if(a)return a}let $=document.createElement("canvas");return{width:$.width,height:$.height}=s(this,u),$.getContext("2d").drawImage(s(this,u),0,0),$.toDataURL()}if(s(this,b)){let[$,x]=this.pageDimensions,a=Math.round(this.width*$*i.PixelsPerInch.PDF_TO_CSS_UNITS),c=Math.round(this.height*x*i.PixelsPerInch.PDF_TO_CSS_UNITS),E=new OffscreenCanvas(a,c);return E.getContext("2d").drawImage(s(this,u),0,0,s(this,u).width,s(this,u).height,0,0,a,c),E.transferToImageBitmap()}return structuredClone(s(this,u))},Il=function(){J(this,F,new ResizeObserver(q=>{let $=q[0].contentRect;$.width&&$.height&&G(this,L,kl).call(this,$.width,$.height)})),s(this,F).observe(this.div)},qe(D,"_type","stamp");let o=D;return o})();n.StampEditor=m}],__webpack_module_cache__={};function __w_pdfjs_require__(h){var n=__webpack_module_cache__[h];if(n!==void 0)return n.exports;var _=__webpack_module_cache__[h]={exports:{}};return __webpack_modules__[h](_,_.exports,__w_pdfjs_require__),_.exports}var __webpack_exports__={};return(()=>{var h=__webpack_exports__;Object.defineProperty(h,"__esModule",{value:!0}),Object.defineProperty(h,"AbortException",{enumerable:!0,get:function(){return n.AbortException}}),Object.defineProperty(h,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(h,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return n.AnnotationEditorParamsType}}),Object.defineProperty(h,"AnnotationEditorType",{enumerable:!0,get:function(){return n.AnnotationEditorType}}),Object.defineProperty(h,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return r.AnnotationEditorUIManager}}),Object.defineProperty(h,"AnnotationLayer",{enumerable:!0,get:function(){return m.AnnotationLayer}}),Object.defineProperty(h,"AnnotationMode",{enumerable:!0,get:function(){return n.AnnotationMode}}),Object.defineProperty(h,"CMapCompressionType",{enumerable:!0,get:function(){return n.CMapCompressionType}}),Object.defineProperty(h,"DOMSVGFactory",{enumerable:!0,get:function(){return e.DOMSVGFactory}}),Object.defineProperty(h,"FeatureTest",{enumerable:!0,get:function(){return n.FeatureTest}}),Object.defineProperty(h,"GlobalWorkerOptions",{enumerable:!0,get:function(){return o.GlobalWorkerOptions}}),Object.defineProperty(h,"ImageKind",{enumerable:!0,get:function(){return n.ImageKind}}),Object.defineProperty(h,"InvalidPDFException",{enumerable:!0,get:function(){return n.InvalidPDFException}}),Object.defineProperty(h,"MissingPDFException",{enumerable:!0,get:function(){return n.MissingPDFException}}),Object.defineProperty(h,"OPS",{enumerable:!0,get:function(){return n.OPS}}),Object.defineProperty(h,"PDFDataRangeTransport",{enumerable:!0,get:function(){return _.PDFDataRangeTransport}}),Object.defineProperty(h,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(h,"PDFWorker",{enumerable:!0,get:function(){return _.PDFWorker}}),Object.defineProperty(h,"PasswordResponses",{enumerable:!0,get:function(){return n.PasswordResponses}}),Object.defineProperty(h,"PermissionFlag",{enumerable:!0,get:function(){return n.PermissionFlag}}),Object.defineProperty(h,"PixelsPerInch",{enumerable:!0,get:function(){return e.PixelsPerInch}}),Object.defineProperty(h,"PromiseCapability",{enumerable:!0,get:function(){return n.PromiseCapability}}),Object.defineProperty(h,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(h,"SVGGraphics",{enumerable:!0,get:function(){return _.SVGGraphics}}),Object.defineProperty(h,"UnexpectedResponseException",{enumerable:!0,get:function(){return n.UnexpectedResponseException}}),Object.defineProperty(h,"Util",{enumerable:!0,get:function(){return n.Util}}),Object.defineProperty(h,"VerbosityLevel",{enumerable:!0,get:function(){return n.VerbosityLevel}}),Object.defineProperty(h,"XfaLayer",{enumerable:!0,get:function(){return u.XfaLayer}}),Object.defineProperty(h,"build",{enumerable:!0,get:function(){return _.build}}),Object.defineProperty(h,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return n.createValidAbsoluteUrl}}),Object.defineProperty(h,"getDocument",{enumerable:!0,get:function(){return _.getDocument}}),Object.defineProperty(h,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(h,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return e.getPdfFilenameFromUrl}}),Object.defineProperty(h,"getXfaPageViewport",{enumerable:!0,get:function(){return e.getXfaPageViewport}}),Object.defineProperty(h,"isDataScheme",{enumerable:!0,get:function(){return e.isDataScheme}}),Object.defineProperty(h,"isPdfFile",{enumerable:!0,get:function(){return e.isPdfFile}}),Object.defineProperty(h,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(h,"noContextMenu",{enumerable:!0,get:function(){return e.noContextMenu}}),Object.defineProperty(h,"normalizeUnicode",{enumerable:!0,get:function(){return n.normalizeUnicode}}),Object.defineProperty(h,"renderTextLayer",{enumerable:!0,get:function(){return t.renderTextLayer}}),Object.defineProperty(h,"setLayerDimensions",{enumerable:!0,get:function(){return e.setLayerDimensions}}),Object.defineProperty(h,"shadow",{enumerable:!0,get:function(){return n.shadow}}),Object.defineProperty(h,"updateTextLayer",{enumerable:!0,get:function(){return t.updateTextLayer}}),Object.defineProperty(h,"version",{enumerable:!0,get:function(){return _.version}});var n=__w_pdfjs_require__(1),_=__w_pdfjs_require__(2),e=__w_pdfjs_require__(6),t=__w_pdfjs_require__(26),i=__w_pdfjs_require__(27),r=__w_pdfjs_require__(5),m=__w_pdfjs_require__(29),o=__w_pdfjs_require__(14),u=__w_pdfjs_require__(32);let d="3.11.174",v="ce8716743"})(),__webpack_exports__})())});var sc=_i((ds,Tr)=>{(function(n,_){typeof ds=="object"&&typeof Tr=="object"?Tr.exports=n.pdfjsViewer=_():typeof define=="function"&&define.amd?define("pdfjs-dist/web/pdf_viewer",[],()=>n.pdfjsViewer=_()):typeof ds=="object"?ds["pdfjs-dist/web/pdf_viewer"]=n.pdfjsViewer=_():n["pdfjs-dist/web/pdf_viewer"]=n.pdfjsViewer=_()})(globalThis,()=>(()=>{"use strict";var h=[,(t,i,r)=>{var V,U,q,$,Fl,or,ar,Rl,Dl,Nl,lr,Bl,$l,rs,dn,Ki,Vl,cr,hr,os,zl,dr,ur,un;Object.defineProperty(i,"__esModule",{value:!0}),i.PDFFindController=i.FindState=void 0;var m=r(2),o=r(3),u=r(4);let d={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};i.FindState=d;let v=250,T=-50,A=-400,M={"\u2010":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xBC":"1/4","\xBD":"1/2","\xBE":"3/4"},F=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]),S,b=new RegExp("\\p{M}+","gu"),N=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),L=new RegExp("([^\\p{M}])\\p{M}*$","u"),g=new RegExp("^\\p{M}*([^\\p{M}])","u"),f=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,p=new Map,C="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",P=new Map,k=null,R=null;function W(re){let y=[],l;for(;(l=f.exec(re))!==null;){let{index:ze}=l;for(let We of l[0]){let rt=p.get(We);rt||(rt=We.normalize("NFD").length,p.set(We,rt)),y.push([rt,ze++])}}let I;if(y.length===0&&k)I=k;else if(y.length>0&&R)I=R;else{let ze=Object.keys(M).join(""),We=(0,o.getNormalizeWithNFKC)(),be=`([${ze}])|([${We}])|((?:\u3099|\u309A)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[\u3040-\u30FF])\\n)|(\\n)`;y.length===0?I=k=new RegExp(be+"|(\\u0000)","gum"):I=R=new RegExp(be+`|(${C})`,"gum")}let z=[];for(;(l=b.exec(re))!==null;)z.push([l[0].length,l.index]);let Q=re.normalize("NFD"),K=[[0,0]],le=0,se=0,oe=0,we=0,Ie=0,Qe=!1;return Q=Q.replace(I,(ze,We,rt,at,be,he,ce,Me,et,te)=>{if(te-=we,We){let Pe=M[We],Ye=Pe.length;for(let Oe=1;Oe<Ye;Oe++)K.push([te-oe+Oe,oe-Oe]);return oe-=Ye-1,Pe}if(rt){let Pe=P.get(rt);Pe||(Pe=rt.normalize("NFKC"),P.set(rt,Pe));let Ye=Pe.length;for(let Oe=1;Oe<Ye;Oe++)K.push([te-oe+Oe,oe-Oe]);return oe-=Ye-1,Pe}if(at)return Qe=!0,te+Ie===z[le]?.[1]?++le:(K.push([te-1-oe+1,oe-1]),oe-=1,we+=1),K.push([te-oe+1,oe]),we+=1,Ie+=1,at.charAt(0);if(be){let Pe=be.endsWith(`
`),Ye=Pe?be.length-2:be.length;Qe=!0;let Oe=Ye;te+Ie===z[le]?.[1]&&(Oe-=z[le][0],++le);for(let j=1;j<=Oe;j++)K.push([te-1-oe+j,oe-j]);return oe-=Oe,we+=Oe,Pe?(te+=Ye-1,K.push([te-oe+1,1+oe]),oe+=1,we+=1,Ie+=1,be.slice(0,Ye)):be}if(he){let Pe=he.length-2;return K.push([te-oe+Pe,1+oe]),oe+=1,we+=1,Ie+=1,he.slice(0,-2)}if(ce){let Pe=ce.length-1;return K.push([te-oe+Pe,oe]),we+=1,Ie+=1,ce.slice(0,-1)}if(Me)return K.push([te-oe+1,oe-1]),oe-=1,we+=1,Ie+=1," ";if(te+Ie===y[se]?.[1]){let Pe=y[se][0]-1;++se;for(let Ye=1;Ye<=Pe;Ye++)K.push([te-(oe-Ye),oe-Ye]);oe-=Pe,we+=Pe}return et}),K.push([Q.length,oe]),[Q,K,Qe]}function w(re,y,l){if(!re)return[y,l];let I=y,z=y+l-1,Q=(0,m.binarySearchFirstItem)(re,we=>we[0]>=I);re[Q][0]>I&&--Q;let K=(0,m.binarySearchFirstItem)(re,we=>we[0]>=z,Q);re[K][0]>z&&--K;let le=I+re[Q][1],oe=z+re[K][1]+1-le;return[le,oe]}class D{constructor({linkService:y,eventBus:l,updateMatchesCountOnProgress:I=!0}){ee(this,$);ee(this,V,null);ee(this,U,!0);ee(this,q,0);this._linkService=y,this._eventBus=l,J(this,U,I),this.onIsPageVisible=null,G(this,$,or).call(this),l._on("find",G(this,$,Fl).bind(this)),l._on("findbarclose",G(this,$,zl).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 s(this,V)}setDocument(y){this._pdfDocument&&G(this,$,or).call(this),y&&(this._pdfDocument=y,this._firstPageCapability.resolve())}scrollMatchIntoView({element:y=null,selectedLeft:l=0,pageIndex:I=-1,matchIndex:z=-1}){if(!this._scrollMatches||!y)return;if(z===-1||z!==this._selected.matchIdx)return;if(I===-1||I!==this._selected.pageIdx)return;this._scrollMatches=!1;let Q={top:T,left:l+A};(0,m.scrollIntoView)(y,Q,!0)}}V=new WeakMap,U=new WeakMap,q=new WeakMap,$=new WeakSet,Fl=function(y){if(!y)return;y.phraseSearch===!1&&(console.error("The `phraseSearch`-parameter was removed, please provide an Array of strings in the `query`-parameter instead."),typeof y.query=="string"&&(y.query=y.query.match(/\S+/g)));let l=this._pdfDocument,{type:I}=y;(s(this,V)===null||G(this,$,Rl).call(this,y))&&(this._dirtyMatch=!0),J(this,V,y),I!=="highlightallchange"&&G(this,$,un).call(this,d.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||l&&this._pdfDocument!==l)return;G(this,$,$l).call(this);let z=!this._highlightMatches,Q=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),I?this._dirtyMatch?G(this,$,Ki).call(this):I==="again"?(G(this,$,Ki).call(this),z&&s(this,V).highlightAll&&G(this,$,dn).call(this)):I==="highlightallchange"?(Q?G(this,$,Ki).call(this):this._highlightMatches=!0,G(this,$,dn).call(this)):G(this,$,Ki).call(this):this._findTimeout=setTimeout(()=>{G(this,$,Ki).call(this),this._findTimeout=null},v)})},or=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],J(this,q,0),J(this,V,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 u.PromiseCapability},ar=function(){let{query:y}=s(this,V);return typeof y=="string"?(y!==this._rawQuery&&(this._rawQuery=y,[this._normalizedQuery]=W(y)),this._normalizedQuery):(y||[]).filter(l=>!!l).map(l=>W(l)[0])},Rl=function(y){let l=y.query,I=s(this,V).query,z=typeof l;if(z!==typeof I)return!0;if(z==="string"){if(l!==I)return!0}else if(JSON.stringify(l)!==JSON.stringify(I))return!0;switch(y.type){case"again":let K=this._selected.pageIdx+1,le=this._linkService;return K>=1&&K<=le.pagesCount&&K!==le.page&&!(this.onIsPageVisible?.(K)??!0);case"highlightallchange":return!1}return!0},Dl=function(y,l,I){let z=y.slice(0,l).match(L);if(z){let Q=y.charCodeAt(l),K=z[1].charCodeAt(0);if((0,o.getCharacterType)(Q)===(0,o.getCharacterType)(K))return!1}if(z=y.slice(l+I).match(g),z){let Q=y.charCodeAt(l+I-1),K=z[1].charCodeAt(0);if((0,o.getCharacterType)(Q)===(0,o.getCharacterType)(K))return!1}return!0},Nl=function(y,l,I,z){let Q=this._pageMatches[I]=[],K=this._pageMatchesLength[I]=[];if(!y)return;let le=this._pageDiffs[I],se;for(;(se=y.exec(z))!==null;){if(l&&!G(this,$,Dl).call(this,z,se.index,se[0].length))continue;let[oe,we]=w(le,se.index,se[0].length);we&&(Q.push(oe),K.push(we))}},lr=function(y,l){let{matchDiacritics:I}=s(this,V),z=!1;y=y.replaceAll(N,(K,le,se,oe,we,Ie)=>le?`[ ]*\\${le}[ ]*`:se?`[ ]*${se}[ ]*`:oe?"[ ]+":I?we||Ie:we?F.has(we.charCodeAt(0))?we:"":l?(z=!0,`${Ie}\\p{M}*`):Ie);let Q="[ ]*";return y.endsWith(Q)&&(y=y.slice(0,y.length-Q.length)),I&&l&&(S||=String.fromCharCode(...F),z=!0,y=`${y}(?=[${S}]|[^\\p{M}]|$)`),[z,y]},Bl=function(y){let l=s(this,$,ar);if(l.length===0)return;let{caseSensitive:I,entireWord:z}=s(this,V),Q=this._pageContents[y],K=this._hasDiacritics[y],le=!1;typeof l=="string"?[le,l]=G(this,$,lr).call(this,l,K):l=l.sort().reverse().map(we=>{let[Ie,Qe]=G(this,$,lr).call(this,we,K);return le||=Ie,`(${Qe})`}).join("|");let se=`g${le?"u":""}${I?"":"i"}`;l=l?new RegExp(l,se):null,G(this,$,Nl).call(this,l,z,y,Q),s(this,V).highlightAll&&G(this,$,rs).call(this,y),this._resumePageIdx===y&&(this._resumePageIdx=null,G(this,$,cr).call(this));let oe=this._pageMatches[y].length;this._matchesCountTotal+=oe,s(this,U)?oe>0&&G(this,$,ur).call(this):++Pi(this,q)._===this._linkService.pagesCount&&G(this,$,ur).call(this)},$l=function(){if(this._extractTextPromises.length>0)return;let y=Promise.resolve(),l={disableNormalization:!0};for(let I=0,z=this._linkService.pagesCount;I<z;I++){let Q=new u.PromiseCapability;this._extractTextPromises[I]=Q.promise,y=y.then(()=>this._pdfDocument.getPage(I+1).then(K=>K.getTextContent(l)).then(K=>{let le=[];for(let se of K.items)le.push(se.str),se.hasEOL&&le.push(`
`);[this._pageContents[I],this._pageDiffs[I],this._hasDiacritics[I]]=W(le.join("")),Q.resolve()},K=>{console.error(`Unable to get text content for page ${I+1}`,K),this._pageContents[I]="",this._pageDiffs[I]=null,this._hasDiacritics[I]=!1,Q.resolve()}))}},rs=function(y){this._scrollMatches&&this._selected.pageIdx===y&&(this._linkService.page=y+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:y})},dn=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},Ki=function(){let y=s(this,V).findPrevious,l=this._linkService.page-1,I=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=l,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,J(this,q,0),this._matchesCountTotal=0,G(this,$,dn).call(this);for(let K=0;K<I;K++)this._pendingFindMatches.has(K)||(this._pendingFindMatches.add(K),this._extractTextPromises[K].then(()=>{this._pendingFindMatches.delete(K),G(this,$,Bl).call(this,K)}))}if(s(this,$,ar).length===0){G(this,$,un).call(this,d.FOUND);return}if(this._resumePageIdx)return;let Q=this._offset;if(this._pagesToSearch=I,Q.matchIdx!==null){let K=this._pageMatches[Q.pageIdx].length;if(!y&&Q.matchIdx+1<K||y&&Q.matchIdx>0){Q.matchIdx=y?Q.matchIdx-1:Q.matchIdx+1,G(this,$,os).call(this,!0);return}G(this,$,hr).call(this,y)}G(this,$,cr).call(this)},Vl=function(y){let l=this._offset,I=y.length,z=s(this,V).findPrevious;return I?(l.matchIdx=z?I-1:0,G(this,$,os).call(this,!0),!0):(G(this,$,hr).call(this,z),l.wrapped&&(l.matchIdx=null,this._pagesToSearch<0)?(G(this,$,os).call(this,!1),!0):!1)},cr=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let y=null;do{let l=this._offset.pageIdx;if(y=this._pageMatches[l],!y){this._resumePageIdx=l;break}}while(!G(this,$,Vl).call(this,y))},hr=function(y){let l=this._offset,I=this._linkService.pagesCount;l.pageIdx=y?l.pageIdx-1:l.pageIdx+1,l.matchIdx=null,this._pagesToSearch--,(l.pageIdx>=I||l.pageIdx<0)&&(l.pageIdx=y?I-1:0,l.wrapped=!0)},os=function(y=!1){let l=d.NOT_FOUND,I=this._offset.wrapped;if(this._offset.wrapped=!1,y){let z=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,l=I?d.WRAPPED:d.FOUND,z!==-1&&z!==this._selected.pageIdx&&G(this,$,rs).call(this,z)}G(this,$,un).call(this,l,s(this,V).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,G(this,$,rs).call(this,this._selected.pageIdx))},zl=function(y){let l=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||l&&this._pdfDocument!==l||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),G(this,$,un).call(this,d.FOUND),this._highlightMatches=!1,G(this,$,dn).call(this))})},dr=function(){let{pageIdx:y,matchIdx:l}=this._selected,I=0,z=this._matchesCountTotal;if(l!==-1){for(let Q=0;Q<y;Q++)I+=this._pageMatches[Q]?.length||0;I+=l+1}return(I<1||I>z)&&(I=z=0),{current:I,total:z}},ur=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:G(this,$,dr).call(this)})},un=function(y,l=!1){!s(this,U)&&(s(this,q)!==this._linkService.pagesCount||y===d.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:y,previous:l,matchesCount:G(this,$,dr).call(this),rawQuery:s(this,V)?.query??null})},i.PDFFindController=D},(t,i)=>{var Xe,Ee,_e,ue,re;Object.defineProperty(i,"__esModule",{value:!0}),i.animationStarted=i.VERTICAL_PADDING=i.UNKNOWN_SCALE=i.TextLayerMode=i.SpreadMode=i.SidebarView=i.ScrollMode=i.SCROLLBAR_PADDING=i.RenderingStates=i.ProgressBar=i.PresentationModeState=i.OutputScale=i.MIN_SCALE=i.MAX_SCALE=i.MAX_AUTO_SCALE=i.DEFAULT_SCALE_VALUE=i.DEFAULT_SCALE_DELTA=i.DEFAULT_SCALE=i.CursorTool=i.AutoPrintRegExp=void 0,i.apiPageLayoutToViewerModes=me,i.apiPageModeToSidebarView=xe,i.approximateFraction=V,i.backtrackBeforeAllVisibleElements=$,i.binarySearchFirstItem=D,i.docStyle=void 0,i.getActiveOrFocusedElement=de,i.getPageSizeInches=q,i.getVisibleElements=x,i.isPortraitOrientation=Y,i.isValidRotation=E,i.isValidScrollMode=B,i.isValidSpreadMode=O,i.normalizeWheelEventDelta=c,i.normalizeWheelEventDirection=a,i.parseQueryString=R,i.removeNullCharacters=w,i.roundToDivide=U,i.scrollIntoView=P,i.toggleCheckedBtn=Se,i.toggleExpandedBtn=ke,i.watchScroll=k;let r="auto";i.DEFAULT_SCALE_VALUE=r;let m=1;i.DEFAULT_SCALE=m;let o=1.1;i.DEFAULT_SCALE_DELTA=o;let u=.1;i.MIN_SCALE=u;let d=10;i.MAX_SCALE=d;let v=0;i.UNKNOWN_SCALE=v;let T=1.25;i.MAX_AUTO_SCALE=T;let A=40;i.SCROLLBAR_PADDING=A;let M=5;i.VERTICAL_PADDING=M;let F={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};i.RenderingStates=F;let S={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};i.PresentationModeState=S;let b={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};i.SidebarView=b;let N={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2};i.TextLayerMode=N;let L={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};i.ScrollMode=L;let g={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};i.SpreadMode=g;let f={SELECT:0,HAND:1,ZOOM:2};i.CursorTool=f;let p=/\bprint\s*\(/;i.AutoPrintRegExp=p;class C{constructor(){let l=window.devicePixelRatio||1;this.sx=l,this.sy=l}get scaled(){return this.sx!==1||this.sy!==1}}i.OutputScale=C;function P(y,l,I=!1){let z=y.offsetParent;if(!z){console.error("offsetParent is not set -- cannot scroll");return}let Q=y.offsetTop+y.clientTop,K=y.offsetLeft+y.clientLeft;for(;z.clientHeight===z.scrollHeight&&z.clientWidth===z.scrollWidth||I&&(z.classList.contains("markedContent")||getComputedStyle(z).overflow==="hidden");)if(Q+=z.offsetTop,K+=z.offsetLeft,z=z.offsetParent,!z)return;l&&(l.top!==void 0&&(Q+=l.top),l.left!==void 0&&(K+=l.left,z.scrollLeft=K)),z.scrollTop=Q}function k(y,l){let I=function(K){Q||(Q=window.requestAnimationFrame(function(){Q=null;let se=y.scrollLeft,oe=z.lastX;se!==oe&&(z.right=se>oe),z.lastX=se;let we=y.scrollTop,Ie=z.lastY;we!==Ie&&(z.down=we>Ie),z.lastY=we,l(z)}))},z={right:!0,down:!0,lastX:y.scrollLeft,lastY:y.scrollTop,_eventHandler:I},Q=null;return y.addEventListener("scroll",I,!0),z}function R(y){let l=new Map;for(let[I,z]of new URLSearchParams(y))l.set(I.toLowerCase(),z);return l}let W=/[\x01-\x1F]/g;function w(y,l=!1){return typeof y!="string"?(console.error("The argument must be a string."),y):(l&&(y=y.replaceAll(W," ")),y.replaceAll("\0",""))}function D(y,l,I=0){let z=I,Q=y.length-1;if(Q<0||!l(y[Q]))return y.length;if(l(y[z]))return z;for(;z<Q;){let K=z+Q>>1,le=y[K];l(le)?Q=K:z=K+1}return z}function V(y){if(Math.floor(y)===y)return[y,1];let l=1/y,I=8;if(l>I)return[1,I];if(Math.floor(l)===l)return[1,l];let z=y>1?l:y,Q=0,K=1,le=1,se=1;for(;;){let we=Q+le,Ie=K+se;if(Ie>I)break;z<=we/Ie?(le=we,se=Ie):(Q=we,K=Ie)}let oe;return z-Q/K<le/se-z?oe=z===y?[Q,K]:[K,Q]:oe=z===y?[le,se]:[se,le],oe}function U(y,l){let I=y%l;return I===0?y:Math.round(y-I+l)}function q({view:y,userUnit:l,rotate:I}){let[z,Q,K,le]=y,se=I%180!==0,oe=(K-z)/72*l,we=(le-Q)/72*l;return{width:se?we:oe,height:se?oe:we}}function $(y,l,I){if(y<2)return y;let z=l[y].div,Q=z.offsetTop+z.clientTop;Q>=I&&(z=l[y-1].div,Q=z.offsetTop+z.clientTop);for(let K=y-2;K>=0&&(z=l[K].div,!(z.offsetTop+z.clientTop+z.clientHeight<=Q));--K)y=K;return y}function x({scrollEl:y,views:l,sortByVisibility:I=!1,horizontal:z=!1,rtl:Q=!1}){let K=y.scrollTop,le=K+y.clientHeight,se=y.scrollLeft,oe=se+y.clientWidth;function we(ce){let Me=ce.div;return Me.offsetTop+Me.clientTop+Me.clientHeight>K}function Ie(ce){let Me=ce.div,et=Me.offsetLeft+Me.clientLeft,te=et+Me.clientWidth;return Q?et<oe:te>se}let Qe=[],ze=new Set,We=l.length,rt=D(l,z?Ie:we);rt>0&&rt<We&&!z&&(rt=$(rt,l,K));let at=z?oe:-1;for(let ce=rt;ce<We;ce++){let Me=l[ce],et=Me.div,te=et.offsetLeft+et.clientLeft,Pe=et.offsetTop+et.clientTop,Ye=et.clientWidth,Oe=et.clientHeight,j=te+Ye,H=Pe+Oe;if(at===-1)H>=le&&(at=H);else if((z?te:Pe)>at)break;if(H<=K||Pe>=le||j<=se||te>=oe)continue;let ae=Math.max(0,K-Pe)+Math.max(0,H-le),fe=Math.max(0,se-te)+Math.max(0,j-oe),ye=(Oe-ae)/Oe,ve=(Ye-fe)/Ye,Le=ye*ve*100|0;Qe.push({id:Me.id,x:te,y:Pe,view:Me,percent:Le,widthPercent:ve*100|0}),ze.add(Me.id)}let be=Qe[0],he=Qe.at(-1);return I&&Qe.sort(function(ce,Me){let et=ce.percent-Me.percent;return Math.abs(et)>.001?-et:ce.id-Me.id}),{first:be,last:he,views:Qe,ids:ze}}function a(y){let l=Math.hypot(y.deltaX,y.deltaY),I=Math.atan2(y.deltaY,y.deltaX);return-.25*Math.PI<I&&I<.75*Math.PI&&(l=-l),l}function c(y){let l=y.deltaMode,I=a(y),z=30,Q=30;return l===WheelEvent.DOM_DELTA_PIXEL?I/=z*Q:l===WheelEvent.DOM_DELTA_LINE&&(I/=Q),I}function E(y){return Number.isInteger(y)&&y%90===0}function B(y){return Number.isInteger(y)&&Object.values(L).includes(y)&&y!==L.UNKNOWN}function O(y){return Number.isInteger(y)&&Object.values(g).includes(y)&&y!==g.UNKNOWN}function Y(y){return y.width<=y.height}let Z=new Promise(function(y){window.requestAnimationFrame(y)});i.animationStarted=Z;let X=document.documentElement.style;i.docStyle=X;function ie(y,l,I){return Math.min(Math.max(y,l),I)}class ne{constructor(l){ee(this,Xe,null);ee(this,Ee,null);ee(this,_e,0);ee(this,ue,null);ee(this,re,!0);J(this,Xe,l.classList),J(this,ue,l.style)}get percent(){return s(this,_e)}set percent(l){if(J(this,_e,ie(l,0,100)),isNaN(l)){s(this,Xe).add("indeterminate");return}s(this,Xe).remove("indeterminate"),s(this,ue).setProperty("--progressBar-percent",`${s(this,_e)}%`)}setWidth(l){if(!l)return;let z=l.parentNode.offsetWidth-l.offsetWidth;z>0&&s(this,ue).setProperty("--progressBar-end-offset",`${z}px`)}setDisableAutoFetch(l=5e3){isNaN(s(this,_e))||(s(this,Ee)&&clearTimeout(s(this,Ee)),this.show(),J(this,Ee,setTimeout(()=>{J(this,Ee,null),this.hide()},l)))}hide(){s(this,re)&&(J(this,re,!1),s(this,Xe).add("hidden"))}show(){s(this,re)||(J(this,re,!0),s(this,Xe).remove("hidden"))}}Xe=new WeakMap,Ee=new WeakMap,_e=new WeakMap,ue=new WeakMap,re=new WeakMap,i.ProgressBar=ne;function de(){let y=document,l=y.activeElement||y.querySelector(":focus");for(;l?.shadowRoot;)y=l.shadowRoot,l=y.activeElement||y.querySelector(":focus");return l}function me(y){let l=L.VERTICAL,I=g.NONE;switch(y){case"SinglePage":l=L.PAGE;break;case"OneColumn":break;case"TwoPageLeft":l=L.PAGE;case"TwoColumnLeft":I=g.ODD;break;case"TwoPageRight":l=L.PAGE;case"TwoColumnRight":I=g.EVEN;break}return{scrollMode:l,spreadMode:I}}function xe(y){switch(y){case"UseNone":return b.NONE;case"UseThumbs":return b.THUMBS;case"UseOutlines":return b.OUTLINE;case"UseAttachments":return b.ATTACHMENTS;case"UseOC":return b.LAYERS}return b.NONE}function Se(y,l,I=null){y.classList.toggle("toggled",l),y.setAttribute("aria-checked",l),I?.classList.toggle("hidden",!l)}function ke(y,l,I=null){y.classList.toggle("toggled",l),y.setAttribute("aria-expanded",l),I?.classList.toggle("hidden",!l)}},(t,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterType=void 0,i.getCharacterType=b,i.getNormalizeWithNFKC=L;let r={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};i.CharacterType=r;function m(g){return g<11904}function o(g){return(g&65408)===0}function u(g){return g>=97&&g<=122||g>=65&&g<=90}function d(g){return g>=48&&g<=57}function v(g){return g===32||g===9||g===13||g===10}function T(g){return g>=13312&&g<=40959||g>=63744&&g<=64255}function A(g){return g>=12448&&g<=12543}function M(g){return g>=12352&&g<=12447}function F(g){return g>=65376&&g<=65439}function S(g){return(g&65408)===3584}function b(g){return m(g)?o(g)?v(g)?r.SPACE:u(g)||d(g)||g===95?r.ALPHA_LETTER:r.PUNCT:S(g)?r.THAI_LETTER:g===160?r.SPACE:r.ALPHA_LETTER:T(g)?r.HAN_LETTER:A(g)?r.KATAKANA_LETTER:M(g)?r.HIRAGANA_LETTER:F(g)?r.HALFWIDTH_KATAKANA_LETTER:r.ALPHA_LETTER}let N;function L(){return N||="\xA0\xA8\xAA\xAF\xB2-\xB5\xB8-\xBA\xBC-\xBE\u0132-\u0133\u013F-\u0140\u0149\u017F\u01C4-\u01CC\u01F1-\u01F3\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0374\u037A\u037E\u0384-\u0385\u0387\u03D0-\u03D6\u03F0-\u03F2\u03F4-\u03F5\u03F9\u0587\u0675-\u0678\u0958-\u095F\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u10FC\u1D2C-\u1D2E\u1D30-\u1D3A\u1D3C-\u1D4D\u1D4F-\u1D6A\u1D78\u1D9B-\u1DBF\u1E9A-\u1E9B\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1FBB\u1FBD-\u1FC1\u1FC9\u1FCB\u1FCD-\u1FCF\u1FD3\u1FDB\u1FDD-\u1FDF\u1FE3\u1FEB\u1FED-\u1FEF\u1FF9\u1FFB\u1FFD-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2047-\u2049\u2057\u205F\u2070-\u2071\u2074-\u208E\u2090-\u209C\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u213B-\u2140\u2145-\u2149\u2150-\u217F\u2189\u222C-\u222D\u222F-\u2230\u2329-\u232A\u2460-\u24EA\u2A0C\u2A74-\u2A76\u2ADC\u2C7C-\u2C7D\u2D6F\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u309B-\u309C\u309F\u30FF\u3131-\u318E\u3192-\u319F\u3200-\u321E\u3220-\u3247\u3250-\u327E\u3280-\u33FF\uA69C-\uA69D\uA770\uA7F2-\uA7F4\uA7F8-\uA7F9\uAB5C-\uAB5F\uAB69\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE10-\uFE19\uFE30-\uFE44\uFE47-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6",N}},t=>{t.exports=globalThis.pdfjsLib},(t,i,r)=>{var A,M,pr,S,jl;Object.defineProperty(i,"__esModule",{value:!0}),i.SimpleLinkService=i.PDFLinkService=i.LinkTarget=void 0;var m=r(2);let o="noopener noreferrer nofollow",u={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};i.LinkTarget=u;function d(L,{url:g,target:f,rel:p,enabled:C=!0}={}){if(!g||typeof g!="string")throw new Error('A valid "url" parameter must provided.');C?L.href=L.title=g:(L.href="",L.title=`Disabled: ${g}`,L.onclick=()=>!1);let P="";switch(f){case u.NONE:break;case u.SELF:P="_self";break;case u.BLANK:P="_blank";break;case u.PARENT:P="_parent";break;case u.TOP:P="_top";break}L.target=P,L.rel=typeof p=="string"?p:o}let N=class N{constructor({eventBus:g,externalLinkTarget:f=null,externalLinkRel:p=null,ignoreDestinationZoom:C=!1}={}){ee(this,M);ee(this,A,new Map);this.eventBus=g,this.externalLinkTarget=f,this.externalLinkRel=p,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=C,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(g,f=null){this.baseUrl=f,this.pdfDocument=g,s(this,A).clear()}setViewer(g){this.pdfViewer=g}setHistory(g){this.pdfHistory=g}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(g){this.pdfViewer.currentPageNumber=g}get rotation(){return this.pdfViewer.pagesRotation}set rotation(g){this.pdfViewer.pagesRotation=g}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}goToDestination(g){return Ue(this,null,function*(){if(!this.pdfDocument)return;let f,p;if(typeof g=="string"?(f=g,p=yield this.pdfDocument.getDestination(g)):(f=null,p=yield g),!Array.isArray(p)){console.error(`PDFLinkService.goToDestination: "${p}" is not a valid destination array, for dest="${g}".`);return}G(this,M,pr).call(this,g,f,p)})}goToPage(g){if(!this.pdfDocument)return;let f=typeof g=="string"&&this.pdfViewer.pageLabelToPageNumber(g)||g|0;if(!(Number.isInteger(f)&&f>0&&f<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${g}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(f)),this.pdfViewer.scrollPageIntoView({pageNumber:f})}addLinkAttributes(g,f,p=!1){d(g,{url:f,target:p?u.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(g){if(typeof g=="string"){if(g.length>0)return this.getAnchorUrl("#"+escape(g))}else if(Array.isArray(g)){let f=JSON.stringify(g);if(f.length>0)return this.getAnchorUrl("#"+escape(f))}return this.getAnchorUrl("")}getAnchorUrl(g){return this.baseUrl?this.baseUrl+g:g}setHash(g){var C;if(!this.pdfDocument)return;let f,p;if(g.includes("=")){let P=(0,m.parseQueryString)(g);if(P.has("search")){let k=P.get("search").replaceAll('"',""),R=P.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:R?k:k.match(/\S+/g)})}if(P.has("page")&&(f=P.get("page")|0||1),P.has("zoom")){let k=P.get("zoom").split(","),R=k[0],W=parseFloat(R);R.includes("Fit")?R==="Fit"||R==="FitB"?p=[null,{name:R}]:R==="FitH"||R==="FitBH"||R==="FitV"||R==="FitBV"?p=[null,{name:R},k.length>1?k[1]|0:null]:R==="FitR"?k.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):p=[null,{name:R},k[1]|0,k[2]|0,k[3]|0,k[4]|0]:console.error(`PDFLinkService.setHash: "${R}" is not a valid zoom value.`):p=[null,{name:"XYZ"},k.length>1?k[1]|0:null,k.length>2?k[2]|0:null,W?W/100:R]}p?this.pdfViewer.scrollPageIntoView({pageNumber:f||this.page,destArray:p,allowNegativeOffset:!0}):f&&(this.page=f),P.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:P.get("pagemode")}),P.has("nameddest")&&this.goToDestination(P.get("nameddest"))}else{p=unescape(g);try{p=JSON.parse(p),Array.isArray(p)||(p=p.toString())}catch{}if(typeof p=="string"||G(C=N,S,jl).call(C,p)){this.goToDestination(p);return}console.error(`PDFLinkService.setHash: "${unescape(g)}" is not a valid destination.`)}}executeNamedAction(g){switch(g){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break;default:break}this.eventBus.dispatch("namedaction",{source:this,action:g})}executeSetOCGState(g){return Ue(this,null,function*(){let f=this.pdfDocument,p=yield this.pdfViewer.optionalContentConfigPromise;if(f!==this.pdfDocument)return;let C;for(let P of g.state){switch(P){case"ON":case"OFF":case"Toggle":C=P;continue}switch(C){case"ON":p.setVisibility(P,!0);break;case"OFF":p.setVisibility(P,!1);break;case"Toggle":let k=p.getGroup(P);k&&p.setVisibility(P,!k.visible);break}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(p)})}cachePageRef(g,f){if(!f)return;let p=f.gen===0?`${f.num}R`:`${f.num}R${f.gen}`;s(this,A).set(p,g)}_cachedPageNumber(g){if(!g)return null;let f=g.gen===0?`${g.num}R`:`${g.num}R${g.gen}`;return s(this,A).get(f)||null}};A=new WeakMap,M=new WeakSet,pr=function(g,f=null,p){let C=p[0],P;if(typeof C=="object"&&C!==null){if(P=this._cachedPageNumber(C),!P){this.pdfDocument.getPageIndex(C).then(k=>{this.cachePageRef(k+1,C),G(this,M,pr).call(this,g,f,p)}).catch(()=>{console.error(`PDFLinkService.#goToDestinationHelper: "${C}" is not a valid page reference, for dest="${g}".`)});return}}else if(Number.isInteger(C))P=C+1;else{console.error(`PDFLinkService.#goToDestinationHelper: "${C}" is not a valid destination reference, for dest="${g}".`);return}if(!P||P<1||P>this.pagesCount){console.error(`PDFLinkService.#goToDestinationHelper: "${P}" is not a valid page number, for dest="${g}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:f,explicitDest:p,pageNumber:P})),this.pdfViewer.scrollPageIntoView({pageNumber:P,destArray:p,ignoreDestinationZoom:this._ignoreDestinationZoom})},S=new WeakSet,jl=function(g){if(!Array.isArray(g))return!1;let f=g.length;if(f<2)return!1;let p=g[0];if(!(typeof p=="object"&&Number.isInteger(p.num)&&Number.isInteger(p.gen))&&!(Number.isInteger(p)&&p>=0))return!1;let C=g[1];if(!(typeof C=="object"&&typeof C.name=="string"))return!1;let P=!0;switch(C.name){case"XYZ":if(f!==5)return!1;break;case"Fit":case"FitB":return f===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(f!==3)return!1;break;case"FitR":if(f!==6)return!1;P=!1;break;default:return!1}for(let k=2;k<f;k++){let R=g[k];if(!(typeof R=="number"||P&&R===null))return!1}return!0},ee(N,S);let v=N;i.PDFLinkService=v;class T{constructor(){this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(g){}get rotation(){return 0}set rotation(g){}get isInPresentationMode(){return!1}goToDestination(g){return Ue(this,null,function*(){})}goToPage(g){}addLinkAttributes(g,f,p=!1){d(g,{url:f,enabled:this.externalLinkEnabled})}getDestinationHash(g){return"#"}getAnchorUrl(g){return"#"}setHash(g){}executeNamedAction(g){}executeSetOCGState(g){}cachePageRef(g,f){}}i.SimpleLinkService=T},(t,i,r)=>{var v,T,fr;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationLayerBuilder=void 0;var m=r(4),o=r(7),u=r(2);class d{constructor({pageDiv:F,pdfPage:S,linkService:b,downloadManager:N,annotationStorage:L=null,imageResourcesPath:g="",renderForms:f=!0,l10n:p=o.NullL10n,enableScripting:C=!1,hasJSActionsPromise:P=null,fieldObjectsPromise:k=null,annotationCanvasMap:R=null,accessibilityManager:W=null}){ee(this,T);ee(this,v,null);this.pageDiv=F,this.pdfPage=S,this.linkService=b,this.downloadManager=N,this.imageResourcesPath=g,this.renderForms=f,this.l10n=p,this.annotationStorage=L,this.enableScripting=C,this._hasJSActionsPromise=P||Promise.resolve(!1),this._fieldObjectsPromise=k||Promise.resolve(null),this._annotationCanvasMap=R,this._accessibilityManager=W,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=b.eventBus}render(F,S="display"){return Ue(this,null,function*(){if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:F.clone({dontFlip:!0})});return}let[b,N,L]=yield Promise.all([this.pdfPage.getAnnotations({intent:S}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;let g=this.div=document.createElement("div");if(g.className="annotationLayer",this.pageDiv.append(g),b.length===0){this.hide();return}this.annotationLayer=new m.AnnotationLayer({div:g,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,l10n:this.l10n,page:this.pdfPage,viewport:F.clone({dontFlip:!0})}),yield this.annotationLayer.render({annotations:b,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:N,fieldObjects:L}),this.linkService.isInPresentationMode&&G(this,T,fr).call(this,u.PresentationModeState.FULLSCREEN),s(this,v)||(J(this,v,f=>{G(this,T,fr).call(this,f.state)}),this._eventBus?._on("presentationmodechanged",s(this,v)))})}cancel(){this._cancelled=!0,s(this,v)&&(this._eventBus?._off("presentationmodechanged",s(this,v)),J(this,v,null))}hide(){this.div&&(this.div.hidden=!0)}}v=new WeakMap,T=new WeakSet,fr=function(F){if(!this.div)return;let S=!1;switch(F){case u.PresentationModeState.FULLSCREEN:S=!0;break;case u.PresentationModeState.NORMAL:break;default:return}for(let b of this.div.childNodes)b.hasAttribute("data-internal-link")||(b.inert=S)},i.AnnotationLayerBuilder=d},(t,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.NullL10n=void 0,i.getL10nFallback=m;let r={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xD7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xD7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};r.print_progress_percent="{{progress}}%";function m(v,T){switch(v){case"find_match_count":v=`find_match_count[${T.total===1?"one":"other"}]`;break;case"find_match_count_limit":v=`find_match_count_limit[${T.limit===1?"one":"other"}]`;break}return r[v]||""}function o(v,T){return T?v.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(A,M)=>M in T?T[M]:"{{"+M+"}}"):v}let u={getLanguage(){return Ue(this,null,function*(){return"en-us"})},getDirection(){return Ue(this,null,function*(){return"ltr"})},get(M){return Ue(this,arguments,function*(v,T=null,A=m(v,T)){return o(A,T)})},translate(v){return Ue(this,null,function*(){})}};i.NullL10n=u},(t,i,r)=>{var d;Object.defineProperty(i,"__esModule",{value:!0}),i.DownloadManager=void 0;var m=r(4);function o(v,T){let A=document.createElement("a");if(!A.click)throw new Error('DownloadManager: "a.click()" is not supported.');A.href=v,A.target="_parent","download"in A&&(A.download=T),(document.body||document.documentElement).append(A),A.click(),A.remove()}class u{constructor(){ee(this,d,new WeakMap)}downloadUrl(T,A,M){if(!(0,m.createValidAbsoluteUrl)(T,"http://example.com")){console.error(`downloadUrl - not a valid URL: ${T}`);return}o(T+"#pdfjs.action=download",A)}downloadData(T,A,M){let F=URL.createObjectURL(new Blob([T],{type:M}));o(F,A)}openOrDownloadData(T,A,M){let S=(0,m.isPdfFile)(M)?"application/pdf":"";return this.downloadData(A,M,S),!1}download(T,A,M,F){let S=URL.createObjectURL(T);o(S,M)}}d=new WeakMap,i.DownloadManager=u},(t,i)=>{var d;Object.defineProperty(i,"__esModule",{value:!0}),i.WaitOnType=i.EventBus=i.AutomationEventBus=void 0,i.waitOnEventOrTimeout=m;let r={EVENT:"event",TIMEOUT:"timeout"};i.WaitOnType=r;function m({target:v,name:T,delay:A=0}){return new Promise(function(M,F){if(typeof v!="object"||!(T&&typeof T=="string")||!(Number.isInteger(A)&&A>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function S(g){v instanceof o?v._off(T,b):v.removeEventListener(T,b),L&&clearTimeout(L),M(g)}let b=S.bind(null,r.EVENT);v instanceof o?v._on(T,b):v.addEventListener(T,b);let N=S.bind(null,r.TIMEOUT),L=setTimeout(N,A)})}class o{constructor(){ee(this,d,Object.create(null))}on(T,A,M=null){this._on(T,A,{external:!0,once:M?.once})}off(T,A,M=null){this._off(T,A,{external:!0,once:M?.once})}dispatch(T,A){let M=s(this,d)[T];if(!M||M.length===0)return;let F;for(let{listener:S,external:b,once:N}of M.slice(0)){if(N&&this._off(T,S),b){(F||=[]).push(S);continue}S(A)}if(F){for(let S of F)S(A);F=null}}_on(T,A,M=null){(s(this,d)[T]||=[]).push({listener:A,external:M?.external===!0,once:M?.once===!0})}_off(T,A,M=null){let F=s(this,d)[T];if(F){for(let S=0,b=F.length;S<b;S++)if(F[S].listener===A){F.splice(S,1);return}}}}d=new WeakMap,i.EventBus=o;class u extends o{dispatch(T,A){throw new Error("Not implemented: AutomationEventBus.dispatch")}}i.AutomationEventBus=u},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GenericL10n=void 0,r(11);var m=r(7);let o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function u(v){return o[v?.toLowerCase()]||v}class d{constructor(T){let{webL10n:A}=document;this._lang=T,this._ready=new Promise((M,F)=>{A.setLanguage(u(T),()=>{M(A)})})}getLanguage(){return Ue(this,null,function*(){return(yield this._ready).getLanguage()})}getDirection(){return Ue(this,null,function*(){return(yield this._ready).getDirection()})}get(F){return Ue(this,arguments,function*(T,A=null,M=(0,m.getL10nFallback)(T,A)){return(yield this._ready).get(T,A,M)})}translate(T){return Ue(this,null,function*(){return(yield this._ready).translate(T)})}}i.GenericL10n=d},()=>{document.webL10n=function(t,i){var r={},m="",o="textContent",u="",d={},v="loading",T=!0;function A(){return i.querySelectorAll('link[type="application/l10n"]')}function M(){var w=i.querySelector('script[type="application/l10n"]');return w?JSON.parse(w.innerHTML):null}function F(w){return w?w.querySelectorAll("*[data-l10n-id]"):[]}function S(w){if(!w)return{};var D=w.getAttribute("data-l10n-id"),V=w.getAttribute("data-l10n-args"),U={};if(V)try{U=JSON.parse(V)}catch{console.warn("could not parse arguments for #"+D)}return{id:D,args:U}}function b(w,D,V){D=D||function($){},V=V||function(){};var U=new XMLHttpRequest;U.open("GET",w,T),U.overrideMimeType&&U.overrideMimeType("text/plain; charset=utf-8"),U.onreadystatechange=function(){U.readyState==4&&(U.status==200||U.status===0?D(U.responseText):V())},U.onerror=V,U.ontimeout=V;try{U.send(null)}catch{V()}}function N(w,D,V,U){var q=w.replace(/[^\/]*$/,"")||"./";function $(a){return a.lastIndexOf("\\")<0?a:a.replace(/\\\\/g,"\\").replace(/\\n/g,`
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function x(a,c){var E={},B=/^\s*|\s*$/,O=/^\s*#|^\s*$/,Y=/^\s*\[(.*)\]\s*$/,Z=/^\s*@import\s+url\((.*)\)\s*$/i,X=/^([^=\s]*)\s*=\s*(.+)$/;function ie(de,me,xe){var Se=de.replace(B,"").split(/[\r\n]+/),ke="*",Xe=D.split("-",1)[0],Ee=!1,_e="";function ue(){for(;;){if(!Se.length){xe();return}var re=Se.shift();if(!O.test(re)){if(me){if(_e=Y.exec(re),_e){ke=_e[1].toLowerCase(),Ee=ke!=="*"&&ke!==D&&ke!==Xe;continue}else if(Ee)continue;if(_e=Z.exec(re),_e){ne(q+_e[1],ue);return}}var y=re.match(X);y&&y.length==3&&(E[y[1]]=$(y[2]))}}}ue()}function ne(de,me){b(de,function(xe){ie(xe,!1,me)},function(){console.warn(de+" not found."),me()})}ie(a,!0,function(){c(E)})}b(w,function(a){m+=a,x(a,function(c){for(var E in c){var B,O,Y=E.lastIndexOf(".");Y>0?(B=E.substring(0,Y),O=E.substring(Y+1)):(B=E,O=o),r[B]||(r[B]={}),r[B][O]=c[E]}V&&V()})},U)}function L(w,D){w&&(w=w.toLowerCase()),D=D||function(){},g(),u=w;var V=A(),U=V.length;if(U===0){var q=M();if(q&&q.locales&&q.default_locale){if(console.log("using the embedded JSON directory, early way out"),r=q.locales[w],!r){var $=q.default_locale.toLowerCase();for(var x in q.locales)if(x=x.toLowerCase(),x===w){r=q.locales[w];break}else x===$&&(r=q.locales[$])}D()}else console.log("no resource to load, early way out");v="complete";return}var a=null,c=0;a=function(){c++,c>=U&&(D(),v="complete")};function E(Y){var Z=Y.href;this.load=function(X,ie){N(Z,X,ie,function(){console.warn(Z+" not found."),console.warn('"'+X+'" resource not found'),u="",ie()})}}for(var B=0;B<U;B++){var O=new E(V[B]);O.load(w,a)}}function g(){r={},m="",u=""}function f(w){var D={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 V(x,a){return a.indexOf(x)!==-1}function U(x,a,c){return a<=x&&x<=c}var q={0:function(x){return"other"},1:function(x){return U(x%100,3,10)?"few":x===0?"zero":U(x%100,11,99)?"many":x==2?"two":x==1?"one":"other"},2:function(x){return x!==0&&x%10===0?"many":x==2?"two":x==1?"one":"other"},3:function(x){return x==1?"one":"other"},4:function(x){return U(x,0,1)?"one":"other"},5:function(x){return U(x,0,2)&&x!=2?"one":"other"},6:function(x){return x===0?"zero":x%10==1&&x%100!=11?"one":"other"},7:function(x){return x==2?"two":x==1?"one":"other"},8:function(x){return U(x,3,6)?"few":U(x,7,10)?"many":x==2?"two":x==1?"one":"other"},9:function(x){return x===0||x!=1&&U(x%100,1,19)?"few":x==1?"one":"other"},10:function(x){return U(x%10,2,9)&&!U(x%100,11,19)?"few":x%10==1&&!U(x%100,11,19)?"one":"other"},11:function(x){return U(x%10,2,4)&&!U(x%100,12,14)?"few":x%10===0||U(x%10,5,9)||U(x%100,11,14)?"many":x%10==1&&x%100!=11?"one":"other"},12:function(x){return U(x,2,4)?"few":x==1?"one":"other"},13:function(x){return U(x%10,2,4)&&!U(x%100,12,14)?"few":x!=1&&U(x%10,0,1)||U(x%10,5,9)||U(x%100,12,14)?"many":x==1?"one":"other"},14:function(x){return U(x%100,3,4)?"few":x%100==2?"two":x%100==1?"one":"other"},15:function(x){return x===0||U(x%100,2,10)?"few":U(x%100,11,19)?"many":x==1?"one":"other"},16:function(x){return x%10==1&&x!=11?"one":"other"},17:function(x){return x==3?"few":x===0?"zero":x==6?"many":x==2?"two":x==1?"one":"other"},18:function(x){return x===0?"zero":U(x,0,2)&&x!==0&&x!=2?"one":"other"},19:function(x){return U(x,2,10)?"few":U(x,0,1)?"one":"other"},20:function(x){return(U(x%10,3,4)||x%10==9)&&!(U(x%100,10,19)||U(x%100,70,79)||U(x%100,90,99))?"few":x%1e6===0&&x!==0?"many":x%10==2&&!V(x%100,[12,72,92])?"two":x%10==1&&!V(x%100,[11,71,91])?"one":"other"},21:function(x){return x===0?"zero":x==1?"one":"other"},22:function(x){return U(x,0,1)||U(x,11,99)?"one":"other"},23:function(x){return U(x%10,1,2)||x%20===0?"one":"other"},24:function(x){return U(x,3,10)||U(x,13,19)?"few":V(x,[2,12])?"two":V(x,[1,11])?"one":"other"}},$=D[w.replace(/-.*$/,"")];return $ in q?q[$]:(console.warn("plural form unknown for ["+w+"]"),function(){return"other"})}d.plural=function(w,D,V,U){var q=parseFloat(D);if(isNaN(q)||U!=o)return w;d._pluralRules||(d._pluralRules=f(u));var $="["+d._pluralRules(q)+"]";return q===0&&V+"[zero]"in r?w=r[V+"[zero]"][U]:q==1&&V+"[one]"in r?w=r[V+"[one]"][U]:q==2&&V+"[two]"in r?w=r[V+"[two]"][U]:V+$ in r?w=r[V+$][U]:V+"[other]"in r&&(w=r[V+"[other]"][U]),w};function p(w,D,V){var U=r[w];if(!U){if(console.warn("#"+w+" is undefined."),!V)return null;U=V}var q={};for(var $ in U){var x=U[$];x=C(x,D,w,$),x=P(x,D,w),q[$]=x}return q}function C(w,D,V,U){var q=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/,$=q.exec(w);if(!$||!$.length)return w;var x=$[1],a=$[2],c;if(D&&a in D?c=D[a]:a in r&&(c=r[a]),x in d){var E=d[x];w=E(w,c,V,U)}return w}function P(w,D,V){var U=/\{\{\s*(.+?)\s*\}\}/g;return w.replace(U,function(q,$){return D&&$ in D?D[$]:$ in r?r[$]:(console.log("argument {{"+$+"}} for #"+V+" is undefined."),q)})}function k(w){var D=S(w);if(D.id){var V=p(D.id,D.args);if(!V){console.warn("#"+D.id+" is undefined.");return}if(V[o]){if(R(w)===0)w[o]=V[o];else{for(var U=w.childNodes,q=!1,$=0,x=U.length;$<x;$++)U[$].nodeType===3&&/\S/.test(U[$].nodeValue)&&(q?U[$].nodeValue="":(U[$].nodeValue=V[o],q=!0));if(!q){var a=i.createTextNode(V[o]);w.prepend(a)}}delete V[o]}for(var c in V)w[c]=V[c]}}function R(w){if(w.children)return w.children.length;if(typeof w.childElementCount<"u")return w.childElementCount;for(var D=0,V=0;V<w.childNodes.length;V++)D+=w.nodeType===1?1:0;return D}function W(w){w=w||i.documentElement;for(var D=F(w),V=D.length,U=0;U<V;U++)k(D[U]);k(w)}return{get:function(w,D,V){var U=w.lastIndexOf("."),q=o;U>0&&(q=w.substring(U+1),w=w.substring(0,U));var $;V&&($={},$[q]=V);var x=p(w,D,$);return x&&q in x?x[q]:"{{"+w+"}}"},getData:function(){return r},getText:function(){return m},getLanguage:function(){return u},setLanguage:function(w,D){L(w,function(){D&&D()})},getDirection:function(){var w=["ar","he","fa","ps","ur"],D=u.split("-",1)[0];return w.indexOf(D)>=0?"rtl":"ltr"},translate:W,getReadyState:function(){return v},ready:function(w){if(w)v=="complete"||v=="interactive"?t.setTimeout(function(){w()}):i.addEventListener&&i.addEventListener("localized",function D(){i.removeEventListener("localized",D),w()});else return}}}(window,document)},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFHistory=void 0,i.isDestArraysEqual=F,i.isDestHashesEqual=M;var m=r(2),o=r(9);let u=1e3,d=50,v=1e3;function T(){return document.location.hash}class A{constructor({linkService:b,eventBus:N}){this.linkService=b,this.eventBus=N,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",L=>{this._isPagesLoaded=!!L.pagesCount},{once:!0})})}initialize({fingerprint:b,resetHistory:N=!1,updateUrl:L=!1}){if(!b||typeof b!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();let g=this._fingerprint!==""&&this._fingerprint!==b;this._fingerprint=b,this._updateUrl=L===!0,this._initialized=!0,this._bindEvents();let f=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=T(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(f,!0)||N){let{hash:C,page:P,rotation:k}=this._parseCurrentHash(!0);if(!C||g||N){this._pushOrReplaceState(null,!0);return}this._pushOrReplaceState({hash:C,page:P,rotation:k},!0);return}let p=f.destination;this._updateInternalState(p,f.uid,!0),p.rotation!==void 0&&(this._initialRotation=p.rotation),p.dest?(this._initialBookmark=JSON.stringify(p.dest),this._destination.page=null):p.hash?this._initialBookmark=p.hash:p.page&&(this._initialBookmark=`page=${p.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:b=null,explicitDest:N,pageNumber:L}){if(!this._initialized)return;if(b&&typeof b!="string"){console.error(`PDFHistory.push: "${b}" is not a valid namedDest parameter.`);return}else if(Array.isArray(N)){if(!this._isValidPage(L)&&(L!==null||this._destination)){console.error(`PDFHistory.push: "${L}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${N}" is not a valid explicitDest parameter.`);return}let g=b||JSON.stringify(N);if(!g)return;let f=!1;if(this._destination&&(M(this._destination.hash,g)||F(this._destination.dest,N))){if(this._destination.page)return;f=!0}this._popStateInProgress&&!f||(this._pushOrReplaceState({dest:N,hash:g,page:L,rotation:this.linkService.rotation},f),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(b){if(this._initialized){if(!this._isValidPage(b)){console.error(`PDFHistory.pushPage: "${b}" is not a valid page number.`);return}this._destination?.page!==b&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${b}`,page:b,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;let b=window.history.state;this._isValidState(b)&&b.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;let b=window.history.state;this._isValidState(b)&&b.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(b,N=!1){let L=N||!this._destination,g={fingerprint:this._fingerprint,uid:L?this._uid:this._uid+1,destination:b};this._updateInternalState(b,g.uid);let f;if(this._updateUrl&&b?.hash){let p=document.location.href.split("#")[0];p.startsWith("file://")||(f=`${p}#${b.hash}`)}L?window.history.replaceState(g,"",f):window.history.pushState(g,"",f)}_tryPushCurrentPosition(b=!1){if(!this._position)return;let N=this._position;if(b&&(N=Object.assign(Object.create(null),this._position),N.temporary=!0),!this._destination){this._pushOrReplaceState(N);return}if(this._destination.temporary){this._pushOrReplaceState(N,!0);return}if(this._destination.hash===N.hash||!this._destination.page&&(d<=0||this._numPositionUpdates<=d))return;let L=!1;if(this._destination.page>=N.first&&this._destination.page<=N.page){if(this._destination.dest!==void 0||!this._destination.first)return;L=!0}this._pushOrReplaceState(N,L)}_isValidPage(b){return Number.isInteger(b)&&b>0&&b<=this.linkService.pagesCount}_isValidState(b,N=!1){if(!b)return!1;if(b.fingerprint!==this._fingerprint)if(N){if(typeof b.fingerprint!="string"||b.fingerprint.length!==this._fingerprint.length)return!1;let[L]=performance.getEntriesByType("navigation");if(L?.type!=="reload")return!1}else return!1;return!(!Number.isInteger(b.uid)||b.uid<0||b.destination===null||typeof b.destination!="object")}_updateInternalState(b,N,L=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),L&&b?.temporary&&delete b.temporary,this._destination=b,this._uid=N,this._maxUid=Math.max(this._maxUid,N),this._numPositionUpdates=0}_parseCurrentHash(b=!1){let N=unescape(T()).substring(1),L=(0,m.parseQueryString)(N),g=L.get("nameddest")||"",f=L.get("page")|0;return(!this._isValidPage(f)||b&&g.length>0)&&(f=null),{hash:N,page:f,rotation:this.linkService.rotation}}_updateViewarea({location:b}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:b.pdfOpenParams.substring(1),page:this.linkService.page,first:b.pageNumber,rotation:b.rotation},!this._popStateInProgress&&(d>0&&this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,v>0&&(this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null},v)))}_popState({state:b}){let N=T(),L=this._currentHash!==N;if(this._currentHash=N,!b){this._uid++;let{hash:f,page:p,rotation:C}=this._parseCurrentHash();this._pushOrReplaceState({hash:f,page:p,rotation:C},!0);return}if(!this._isValidState(b))return;this._popStateInProgress=!0,L&&(this._blockHashChange++,(0,o.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:u}).then(()=>{this._blockHashChange--}));let g=b.destination;this._updateInternalState(g,b.uid,!0),(0,m.isValidRotation)(g.rotation)&&(this.linkService.rotation=g.rotation),g.dest?this.linkService.goToDestination(g.dest):g.hash?this.linkService.setHash(g.hash):g.page&&(this.linkService.page=g.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}_pageHide(){(!this._destination||this._destination.temporary)&&this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}i.PDFHistory=A;function M(S,b){return typeof S!="string"||typeof b!="string"?!1:S===b||(0,m.parseQueryString)(S).get("nameddest")===b}function F(S,b){function N(L,g){if(typeof L!=typeof g||Array.isArray(L)||Array.isArray(g))return!1;if(L!==null&&typeof L=="object"&&g!==null){if(Object.keys(L).length!==Object.keys(g).length)return!1;for(let f in L)if(!N(L[f],g[f]))return!1;return!0}return L===g||Number.isNaN(L)&&Number.isNaN(g)}if(!(Array.isArray(S)&&Array.isArray(b))||S.length!==b.length)return!1;for(let L=0,g=S.length;L<g;L++)if(!N(S[L],b[L]))return!1;return!0}},(t,i,r)=>{var p,C,P,k,R,W,w,D,V,U,q,as,gr,mr,_r,br,Wl,Ul,vr;Object.defineProperty(i,"__esModule",{value:!0}),i.PDFPageView=void 0;var m=r(4),o=r(2),u=r(14),d=r(6),v=r(15),T=r(7),A=r(5),M=r(16),F=r(17),S=r(18),b=r(19),N=r(20);let L=v.compatibilityParams.maxCanvasPixels||16777216,g=()=>({annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new A.SimpleLinkService}});class f{constructor(X){ee(this,q);ee(this,p,m.AnnotationMode.ENABLE_FORMS);ee(this,C,!1);ee(this,P,null);ee(this,k,null);ee(this,R,null);ee(this,W,null);ee(this,w,o.RenderingStates.INITIAL);ee(this,D,o.TextLayerMode.ENABLE);ee(this,V,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0});ee(this,U,new WeakMap);let ie=X.container,ne=X.defaultViewport;this.id=X.id,this.renderingId="page"+this.id,J(this,P,X.layerProperties||g),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=X.scale||o.DEFAULT_SCALE,this.viewport=ne,this.pdfPageRotate=ne.rotation,this._optionalContentConfigPromise=X.optionalContentConfigPromise||null,J(this,D,X.textLayerMode??o.TextLayerMode.ENABLE),J(this,p,X.annotationMode??m.AnnotationMode.ENABLE_FORMS),this.imageResourcesPath=X.imageResourcesPath||"",this.isOffscreenCanvasSupported=X.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=X.maxCanvasPixels??L,this.pageColors=X.pageColors||null,this.eventBus=X.eventBus,this.renderingQueue=X.renderingQueue,this.l10n=X.l10n||T.NullL10n,this.renderTask=null,this.resume=null,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=ie,X.useOnlyCssZoom&&(console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."),this.maxCanvasPixels=0),this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;let de=document.createElement("div");if(de.className="page",de.setAttribute("data-page-number",this.id),de.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then(me=>{de.setAttribute("aria-label",me)}),this.div=de,G(this,q,as).call(this),ie?.append(de),this._isStandalone){ie?.style.setProperty("--scale-factor",this.scale*m.PixelsPerInch.PDF_TO_CSS_UNITS);let{optionalContentConfigPromise:me}=X;me&&me.then(xe=>{me===this._optionalContentConfigPromise&&(s(this,V).initialOptionalContent=xe.hasInitialVisibility)})}}get renderingState(){return s(this,w)}set renderingState(X){if(X!==s(this,w))switch(J(this,w,X),s(this,k)&&(clearTimeout(s(this,k)),J(this,k,null)),X){case o.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case o.RenderingStates.RUNNING:this.div.classList.add("loadingIcon"),J(this,k,setTimeout(()=>{this.div.classList.add("loading"),J(this,k,null)},0));break;case o.RenderingStates.INITIAL:case o.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}setPdfPage(X){this._isStandalone&&(this.pageColors?.foreground==="CanvasText"||this.pageColors?.background==="Canvas")&&this._container?.style.setProperty("--hcm-highligh-filter",X.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight")),this.pdfPage=X,this.pdfPageRotate=X.rotate;let ie=(this.rotation+this.pdfPageRotate)%360;this.viewport=X.getViewport({scale:this.scale*m.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:ie}),G(this,q,as).call(this),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}get _textHighlighter(){return(0,m.shadow)(this,"_textHighlighter",new S.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:s(this,P).call(this).findController}))}_resetZoomLayer(X=!1){if(!this.zoomLayer)return;let ie=this.zoomLayer.firstChild;s(this,U).delete(ie),ie.width=0,ie.height=0,X&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:X=!1,keepAnnotationLayer:ie=!1,keepAnnotationEditorLayer:ne=!1,keepXfaLayer:de=!1,keepTextLayer:me=!1}={}){this.cancelRendering({keepAnnotationLayer:ie,keepAnnotationEditorLayer:ne,keepXfaLayer:de,keepTextLayer:me}),this.renderingState=o.RenderingStates.INITIAL;let xe=this.div,Se=xe.childNodes,ke=X&&this.zoomLayer||null,Xe=ie&&this.annotationLayer?.div||null,Ee=ne&&this.annotationEditorLayer?.div||null,_e=de&&this.xfaLayer?.div||null,ue=me&&this.textLayer?.div||null;for(let re=Se.length-1;re>=0;re--){let y=Se[re];switch(y){case ke:case Xe:case Ee:case _e:case ue:continue}y.remove()}xe.removeAttribute("data-loaded"),Xe&&this.annotationLayer.hide(),Ee&&this.annotationEditorLayer.hide(),_e&&this.xfaLayer.hide(),ue&&this.textLayer.hide(),this.structTreeLayer?.hide(),ke||(this.canvas&&(s(this,U).delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}update({scale:X=0,rotation:ie=null,optionalContentConfigPromise:ne=null,drawingDelay:de=-1}){this.scale=X||this.scale,typeof ie=="number"&&(this.rotation=ie),ne instanceof Promise&&(this._optionalContentConfigPromise=ne,ne.then(xe=>{ne===this._optionalContentConfigPromise&&(s(this,V).initialOptionalContent=xe.hasInitialVisibility)})),s(this,V).directDrawing=!0;let me=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*m.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:me}),G(this,q,as).call(this),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),this.canvas){let xe=!1;if(s(this,C)){if(this.maxCanvasPixels===0)xe=!0;else if(this.maxCanvasPixels>0){let{width:ke,height:Xe}=this.viewport,{sx:Ee,sy:_e}=this.outputScale;xe=(Math.floor(ke)*Ee|0)*(Math.floor(Xe)*_e|0)>this.maxCanvasPixels}}let Se=!xe&&de>=0&&de<1e3;if(Se||xe){if(Se&&this.renderingState!==o.RenderingStates.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:de}),this.renderingState=o.RenderingStates.FINISHED,s(this,V).directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!Se,hideTextLayer:Se}),Se)return;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:s(this,W)});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:X=!1,keepAnnotationEditorLayer:ie=!1,keepXfaLayer:ne=!1,keepTextLayer:de=!1,cancelExtraDelay:me=0}={}){this.renderTask&&(this.renderTask.cancel(me),this.renderTask=null),this.resume=null,this.textLayer&&(!de||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationLayer&&(!X||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.annotationEditorLayer&&(!ie||!this.annotationEditorLayer.div)&&(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!ne||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({target:X,redrawAnnotationLayer:ie=!1,redrawAnnotationEditorLayer:ne=!1,redrawXfaLayer:de=!1,redrawTextLayer:me=!1,hideTextLayer:xe=!1}){if(!X.hasAttribute("zooming")){X.setAttribute("zooming",!0);let{style:ke}=X;ke.width=ke.height=""}let Se=s(this,U).get(X);if(this.viewport!==Se){let ke=this.viewport.rotation-Se.rotation,Xe=Math.abs(ke),Ee=1,_e=1;if(Xe===90||Xe===270){let{width:ue,height:re}=this.viewport;Ee=re/ue,_e=ue/re}X.style.transform=`rotate(${ke}deg) scale(${Ee}, ${_e})`}ie&&this.annotationLayer&&G(this,q,gr).call(this),ne&&this.annotationEditorLayer&&G(this,q,mr).call(this),de&&this.xfaLayer&&G(this,q,_r).call(this),this.textLayer&&(xe?(this.textLayer.hide(),this.structTreeLayer?.hide()):me&&G(this,q,br).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(X,ie){return this.viewport.convertToPdfPoint(X,ie)}draw(){return Ue(this,null,function*(){this.renderingState!==o.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());let{div:X,l10n:ie,pageColors:ne,pdfPage:de,viewport:me}=this;if(!de)throw this.renderingState=o.RenderingStates.FINISHED,new Error("pdfPage is not loaded");this.renderingState=o.RenderingStates.RUNNING;let xe=document.createElement("div");if(xe.classList.add("canvasWrapper"),X.append(xe),!this.textLayer&&s(this,D)!==o.TextLayerMode.DISABLE&&!de.isPureXfa&&(this._accessibilityManager||=new F.TextAccessibilityManager,this.textLayer=new b.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,enablePermissions:s(this,D)===o.TextLayerMode.ENABLE_PERMISSIONS}),X.append(this.textLayer.div)),!this.annotationLayer&&s(this,p)!==m.AnnotationMode.DISABLE){let{annotationStorage:oe,downloadManager:we,enableScripting:Ie,fieldObjectsPromise:Qe,hasJSActionsPromise:ze,linkService:We}=s(this,P).call(this);this._annotationCanvasMap||=new Map,this.annotationLayer=new d.AnnotationLayerBuilder({pageDiv:X,pdfPage:de,annotationStorage:oe,imageResourcesPath:this.imageResourcesPath,renderForms:s(this,p)===m.AnnotationMode.ENABLE_FORMS,linkService:We,downloadManager:we,l10n:ie,enableScripting:Ie,hasJSActionsPromise:ze,fieldObjectsPromise:Qe,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}let Se=oe=>{if(ue?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=o.RenderingStates.PAUSED,this.resume=()=>{this.renderingState=o.RenderingStates.RUNNING,oe()};return}oe()},{width:ke,height:Xe}=me,Ee=document.createElement("canvas");Ee.setAttribute("role","presentation"),Ee.hidden=!0;let _e=!!(ne?.background&&ne?.foreground),ue=oe=>{(!_e||oe)&&(Ee.hidden=!1,ue=null)};xe.append(Ee),this.canvas=Ee;let re=Ee.getContext("2d",{alpha:!1}),y=this.outputScale=new o.OutputScale;if(this.maxCanvasPixels===0){let oe=1/this.scale;y.sx*=oe,y.sy*=oe,J(this,C,!0)}else if(this.maxCanvasPixels>0){let oe=ke*Xe,we=Math.sqrt(this.maxCanvasPixels/oe);y.sx>we||y.sy>we?(y.sx=we,y.sy=we,J(this,C,!0)):J(this,C,!1)}let l=(0,o.approximateFraction)(y.sx),I=(0,o.approximateFraction)(y.sy);Ee.width=(0,o.roundToDivide)(ke*y.sx,l[0]),Ee.height=(0,o.roundToDivide)(Xe*y.sy,I[0]);let{style:z}=Ee;z.width=(0,o.roundToDivide)(ke,l[1])+"px",z.height=(0,o.roundToDivide)(Xe,I[1])+"px",s(this,U).set(Ee,me);let Q=y.scaled?[y.sx,0,0,y.sy,0,0]:null,K={canvasContext:re,transform:Q,viewport:me,annotationMode:s(this,p),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:ne},le=this.renderTask=this.pdfPage.render(K);le.onContinue=Se;let se=le.promise.then(()=>Ue(this,null,function*(){if(ue?.(!0),yield G(this,q,vr).call(this,le),G(this,q,br).call(this),this.annotationLayer&&(yield G(this,q,gr).call(this)),!this.annotationEditorLayer){let{annotationEditorUIManager:oe}=s(this,P).call(this);if(!oe)return;this.annotationEditorLayer=new u.AnnotationEditorLayerBuilder({uiManager:oe,pageDiv:X,pdfPage:de,l10n:ie,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer})}G(this,q,mr).call(this)}),oe=>(oe instanceof m.RenderingCancelledException||ue?.(!0),G(this,q,vr).call(this,le,oe)));if(de.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&X.append(this.xfaLayer.div);else{let{annotationStorage:oe,linkService:we}=s(this,P).call(this);this.xfaLayer=new N.XfaLayerBuilder({pageDiv:X,pdfPage:de,annotationStorage:oe,linkService:we})}G(this,q,_r).call(this)}return X.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),se})}setPageLabel(X){this.pageLabel=typeof X=="string"?X:null,this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){let{directDrawing:X,initialOptionalContent:ie,regularAnnotations:ne}=s(this,V);return X&&ie&&ne?this.canvas:null}}p=new WeakMap,C=new WeakMap,P=new WeakMap,k=new WeakMap,R=new WeakMap,W=new WeakMap,w=new WeakMap,D=new WeakMap,V=new WeakMap,U=new WeakMap,q=new WeakSet,as=function(){let{viewport:X}=this;if(this.pdfPage){if(s(this,R)===X.rotation)return;J(this,R,X.rotation)}(0,m.setLayerDimensions)(this.div,X,!0,!1)},gr=function(){return Ue(this,null,function*(){let X=null;try{yield this.annotationLayer.render(this.viewport,"display")}catch(ie){console.error(`#renderAnnotationLayer: "${ie}".`),X=ie}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:X})}})},mr=function(){return Ue(this,null,function*(){let X=null;try{yield this.annotationEditorLayer.render(this.viewport,"display")}catch(ie){console.error(`#renderAnnotationEditorLayer: "${ie}".`),X=ie}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:X})}})},_r=function(){return Ue(this,null,function*(){let X=null;try{let ie=yield this.xfaLayer.render(this.viewport,"display");ie?.textDivs&&this._textHighlighter&&G(this,q,Ul).call(this,ie.textDivs)}catch(ie){console.error(`#renderXfaLayer: "${ie}".`),X=ie}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:X})}})},br=function(){return Ue(this,null,function*(){let{pdfPage:X,textLayer:ie,viewport:ne}=this;if(!ie)return;let de=null;try{if(!ie.renderingDone){let me=X.streamTextContent({includeMarkedContent:!0,disableNormalization:!0});ie.setTextContentSource(me)}yield ie.render(ne)}catch(me){if(me instanceof m.AbortException)return;console.error(`#renderTextLayer: "${me}".`),de=me}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:ie.numTextDivs,error:de}),G(this,q,Wl).call(this)})},Wl=function(){return Ue(this,null,function*(){if(!this.textLayer)return;this.structTreeLayer||=new M.StructTreeLayerBuilder;let X=yield this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree(),ie=this.structTreeLayer?.render(X);ie&&this.canvas?.append(ie),this.structTreeLayer?.show()})},Ul=function(X){return Ue(this,null,function*(){let ie=yield this.pdfPage.getTextContent(),ne=[];for(let de of ie.items)ne.push(de.str);this._textHighlighter.setTextMapping(X,ne),this._textHighlighter.enable()})},vr=function(X,ie=null){return Ue(this,null,function*(){if(X===this.renderTask&&(this.renderTask=null),ie instanceof m.RenderingCancelledException){J(this,W,null);return}if(J(this,W,ie),this.renderingState=o.RenderingStates.FINISHED,this._resetZoomLayer(!0),s(this,V).regularAnnotations=!X.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:s(this,W)}),ie)throw ie})},i.PDFPageView=f},(t,i,r)=>{var d,v;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationEditorLayerBuilder=void 0;var m=r(4),o=r(7);class u{constructor(A){ee(this,d,null);ee(this,v);this.pageDiv=A.pageDiv,this.pdfPage=A.pdfPage,this.accessibilityManager=A.accessibilityManager,this.l10n=A.l10n||o.NullL10n,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,J(this,v,A.uiManager),J(this,d,A.annotationLayer||null)}render(A,M="display"){return Ue(this,null,function*(){if(M!=="display"||this._cancelled)return;let F=A.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:F}),this.show();return}let S=this.div=document.createElement("div");S.className="annotationEditorLayer",S.tabIndex=0,S.hidden=!0,S.dir=s(this,v).direction,this.pageDiv.append(S),this.annotationEditorLayer=new m.AnnotationEditorLayer({uiManager:s(this,v),div:S,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:F,annotationLayer:s(this,d)});let b={viewport:F,div:S,annotations:null,intent:M};this.annotationEditorLayer.render(b),this.show()})}cancel(){this._cancelled=!0,this.div&&(this.pageDiv=null,this.annotationEditorLayer.destroy(),this.div.remove())}hide(){this.div&&(this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isEmpty||(this.div.hidden=!1)}}d=new WeakMap,v=new WeakMap,i.AnnotationEditorLayerBuilder=u},(t,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.compatibilityParams=i.OptionKind=i.AppOptions=void 0;let r=Object.create(null);i.compatibilityParams=r;{let v=navigator.userAgent||"",T=navigator.platform||"",A=navigator.maxTouchPoints||1,M=/Android/.test(v),F=/\b(iPad|iPhone|iPod)(?=;)/.test(v)||T==="MacIntel"&&A>1;(function(){(F||M)&&(r.maxCanvasPixels=5242880)})()}let m={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};i.OptionKind=m;let o={annotationEditorMode:{value:0,kind:m.VIEWER+m.PREFERENCE},annotationMode:{value:2,kind:m.VIEWER+m.PREFERENCE},cursorToolOnLoad:{value:0,kind:m.VIEWER+m.PREFERENCE},defaultZoomDelay:{value:400,kind:m.VIEWER+m.PREFERENCE},defaultZoomValue:{value:"",kind:m.VIEWER+m.PREFERENCE},disableHistory:{value:!1,kind:m.VIEWER},disablePageLabels:{value:!1,kind:m.VIEWER+m.PREFERENCE},enablePermissions:{value:!1,kind:m.VIEWER+m.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:m.VIEWER+m.PREFERENCE},enableScripting:{value:!0,kind:m.VIEWER+m.PREFERENCE},enableStampEditor:{value:!0,kind:m.VIEWER+m.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:m.VIEWER},externalLinkTarget:{value:0,kind:m.VIEWER+m.PREFERENCE},historyUpdateUrl:{value:!1,kind:m.VIEWER+m.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:m.VIEWER+m.PREFERENCE},imageResourcesPath:{value:"./images/",kind:m.VIEWER},maxCanvasPixels:{value:16777216,kind:m.VIEWER},forcePageColors:{value:!1,kind:m.VIEWER+m.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:m.VIEWER+m.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:m.VIEWER+m.PREFERENCE},pdfBugEnabled:{value:!1,kind:m.VIEWER+m.PREFERENCE},printResolution:{value:150,kind:m.VIEWER},sidebarViewOnLoad:{value:-1,kind:m.VIEWER+m.PREFERENCE},scrollModeOnLoad:{value:-1,kind:m.VIEWER+m.PREFERENCE},spreadModeOnLoad:{value:-1,kind:m.VIEWER+m.PREFERENCE},textLayerMode:{value:1,kind:m.VIEWER+m.PREFERENCE},viewerCssTheme:{value:0,kind:m.VIEWER+m.PREFERENCE},viewOnLoad:{value:0,kind:m.VIEWER+m.PREFERENCE},cMapPacked:{value:!0,kind:m.API},cMapUrl:{value:"../web/cmaps/",kind:m.API},disableAutoFetch:{value:!1,kind:m.API+m.PREFERENCE},disableFontFace:{value:!1,kind:m.API+m.PREFERENCE},disableRange:{value:!1,kind:m.API+m.PREFERENCE},disableStream:{value:!1,kind:m.API+m.PREFERENCE},docBaseUrl:{value:"",kind:m.API},enableXfa:{value:!0,kind:m.API+m.PREFERENCE},fontExtraProperties:{value:!1,kind:m.API},isEvalSupported:{value:!0,kind:m.API},isOffscreenCanvasSupported:{value:!0,kind:m.API},maxImageSize:{value:-1,kind:m.API},pdfBug:{value:!1,kind:m.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:m.API},verbosity:{value:1,kind:m.API},workerPort:{value:null,kind:m.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:m.WORKER}};o.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:m.VIEWER},o.disablePreferences={value:!1,kind:m.VIEWER},o.locale={value:navigator.language||"en-US",kind:m.VIEWER},o.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:m.VIEWER};let u=Object.create(null);class d{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(T){let A=u[T];if(A!==void 0)return A;let M=o[T];if(M!==void 0)return r[T]??M.value}static getAll(T=null){let A=Object.create(null);for(let M in o){let F=o[M];if(T){if(!(T&F.kind))continue;if(T===m.PREFERENCE){let b=F.value,N=typeof b;if(N==="boolean"||N==="string"||N==="number"&&Number.isInteger(b)){A[M]=b;continue}throw new Error(`Invalid type for preference: ${M}`)}}let S=u[M];A[M]=S!==void 0?S:r[M]??F.value}return A}static set(T,A){u[T]=A}static setAll(T){for(let A in T)u[A]=T[A]}static remove(T){delete u[T]}}i.AppOptions=d,d._hasUserOptions=function(){return Object.keys(u).length>0}},(t,i,r)=>{var v,T,yr,Cr;Object.defineProperty(i,"__esModule",{value:!0}),i.StructTreeLayerBuilder=void 0;var m=r(2);let o={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},u=/^H(\d+)$/;class d{constructor(){ee(this,T);ee(this,v)}get renderingDone(){return s(this,v)!==void 0}render(S){if(s(this,v)!==void 0)return s(this,v);let b=G(this,T,Cr).call(this,S);return b?.classList.add("structTree"),J(this,v,b)}hide(){s(this,v)&&!s(this,v).hidden&&(s(this,v).hidden=!0)}show(){s(this,v)?.hidden&&(s(this,v).hidden=!1)}}v=new WeakMap,T=new WeakSet,yr=function(S,b){let{alt:N,id:L,lang:g}=S;N!==void 0&&b.setAttribute("aria-label",(0,m.removeNullCharacters)(N)),L!==void 0&&b.setAttribute("aria-owns",L),g!==void 0&&b.setAttribute("lang",(0,m.removeNullCharacters)(g,!0))},Cr=function(S){if(!S)return null;let b=document.createElement("span");if("role"in S){let{role:N}=S,L=N.match(u);L?(b.setAttribute("role","heading"),b.setAttribute("aria-level",L[1])):o[N]&&b.setAttribute("role",o[N])}if(G(this,T,yr).call(this,S,b),S.children)if(S.children.length===1&&"id"in S.children[0])G(this,T,yr).call(this,S.children[0],b);else for(let N of S.children)b.append(G(this,T,Cr).call(this,N));return b},i.StructTreeLayerBuilder=d},(t,i,r)=>{var u,d,v,T,A,ls,F,wr;Object.defineProperty(i,"__esModule",{value:!0}),i.TextAccessibilityManager=void 0;var m=r(2);let b=class b{constructor(){ee(this,F);ee(this,u,!1);ee(this,d,null);ee(this,v,new Map);ee(this,T,new Map)}setTextMapping(L){J(this,d,L)}enable(){if(s(this,u))throw new Error("TextAccessibilityManager is already enabled.");if(!s(this,d))throw new Error("Text divs and strings have not been set.");if(J(this,u,!0),J(this,d,s(this,d).slice()),s(this,d).sort(G(b,A,ls)),s(this,v).size>0){let L=s(this,d);for(let[g,f]of s(this,v)){if(!document.getElementById(g)){s(this,v).delete(g);continue}G(this,F,wr).call(this,g,L[f])}}for(let[L,g]of s(this,T))this.addPointerInTextLayer(L,g);s(this,T).clear()}disable(){s(this,u)&&(s(this,T).clear(),J(this,d,null),J(this,u,!1))}removePointerInTextLayer(L){if(!s(this,u)){s(this,T).delete(L);return}let g=s(this,d);if(!g||g.length===0)return;let{id:f}=L,p=s(this,v).get(f);if(p===void 0)return;let C=g[p];s(this,v).delete(f);let P=C.getAttribute("aria-owns");P?.includes(f)&&(P=P.split(" ").filter(k=>k!==f).join(" "),P?C.setAttribute("aria-owns",P):(C.removeAttribute("aria-owns"),C.setAttribute("role","presentation")))}addPointerInTextLayer(L,g){let{id:f}=L;if(!f)return null;if(!s(this,u))return s(this,T).set(L,g),null;g&&this.removePointerInTextLayer(L);let p=s(this,d);if(!p||p.length===0)return null;let C=(0,m.binarySearchFirstItem)(p,W=>{var w;return G(w=b,A,ls).call(w,L,W)<0}),P=Math.max(0,C-1),k=p[P];G(this,F,wr).call(this,f,k),s(this,v).set(f,P);let R=k.parentNode;return R?.classList.contains("markedContent")?R.id:null}moveElementInDOM(L,g,f,p){let C=this.addPointerInTextLayer(f,p);if(!L.hasChildNodes())return L.append(g),C;let P=Array.from(L.childNodes).filter(W=>W!==g);if(P.length===0)return C;let k=f||g,R=(0,m.binarySearchFirstItem)(P,W=>{var w;return G(w=b,A,ls).call(w,k,W)<0});return R===0?P[0].before(g):P[R-1].after(g),C}};u=new WeakMap,d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakSet,ls=function(L,g){let f=L.getBoundingClientRect(),p=g.getBoundingClientRect();if(f.width===0&&f.height===0)return 1;if(p.width===0&&p.height===0)return-1;let C=f.y,P=f.y+f.height,k=f.y+f.height/2,R=p.y,W=p.y+p.height,w=p.y+p.height/2;if(k<=R&&w>=P)return-1;if(w<=C&&k>=W)return 1;let D=f.x+f.width/2,V=p.x+p.width/2;return D-V},F=new WeakSet,wr=function(L,g){let f=g.getAttribute("aria-owns");f?.includes(L)||g.setAttribute("aria-owns",f?`${f} ${L}`:L),g.removeAttribute("role")},ee(b,A);let o=b;i.TextAccessibilityManager=o},(t,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TextHighlighter=void 0;class r{constructor({findController:o,eventBus:u,pageIndex:d}){this.findController=o,this.matches=[],this.eventBus=u,this.pageIdx=d,this._onUpdateTextLayerMatches=null,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(o,u){this.textDivs=o,this.textContentItemsStr=u}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=o=>{(o.pageIndex===this.pageIdx||o.pageIndex===-1)&&this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null),this._updateMatches(!0))}_convertMatches(o,u){if(!o)return[];let{textContentItemsStr:d}=this,v=0,T=0,A=d.length-1,M=[];for(let F=0,S=o.length;F<S;F++){let b=o[F];for(;v!==A&&b>=T+d[v].length;)T+=d[v].length,v++;v===d.length&&console.error("Could not find a matching mapping");let N={begin:{divIdx:v,offset:b-T}};for(b+=u[F];v!==A&&b>T+d[v].length;)T+=d[v].length,v++;N.end={divIdx:v,offset:b-T},M.push(N)}return M}_renderMatches(o){if(o.length===0)return;let{findController:u,pageIdx:d}=this,{textContentItemsStr:v,textDivs:T}=this,A=d===u.selected.pageIdx,M=u.selected.matchIdx,F=u.state.highlightAll,S=null,b={divIdx:-1,offset:void 0};function N(P,k){let R=P.divIdx;return T[R].textContent="",L(R,0,P.offset,k)}function L(P,k,R,W){let w=T[P];if(w.nodeType===Node.TEXT_NODE){let U=document.createElement("span");w.before(U),U.append(w),T[P]=U,w=U}let D=v[P].substring(k,R),V=document.createTextNode(D);if(W){let U=document.createElement("span");return U.className=`${W} appended`,U.append(V),w.append(U),W.includes("selected")?U.offsetLeft:0}return w.append(V),0}let g=M,f=g+1;if(F)g=0,f=o.length;else if(!A)return;let p=-1,C=-1;for(let P=g;P<f;P++){let k=o[P],R=k.begin;if(R.divIdx===p&&R.offset===C)continue;p=R.divIdx,C=R.offset;let W=k.end,w=A&&P===M,D=w?" selected":"",V=0;if(!S||R.divIdx!==S.divIdx?(S!==null&&L(S.divIdx,S.offset,b.offset),N(R)):L(S.divIdx,S.offset,R.offset),R.divIdx===W.divIdx)V=L(R.divIdx,R.offset,W.offset,"highlight"+D);else{V=L(R.divIdx,R.offset,b.offset,"highlight begin"+D);for(let U=R.divIdx+1,q=W.divIdx;U<q;U++)T[U].className="highlight middle"+D;N(W,"highlight end"+D)}S=W,w&&u.scrollMatchIntoView({element:T[R.divIdx],selectedLeft:V,pageIndex:d,matchIndex:M})}S&&L(S.divIdx,S.offset,b.offset)}_updateMatches(o=!1){if(!this.enabled&&!o)return;let{findController:u,matches:d,pageIdx:v}=this,{textContentItemsStr:T,textDivs:A}=this,M=-1;for(let b of d){let N=Math.max(M,b.begin.divIdx);for(let L=N,g=b.end.divIdx;L<=g;L++){let f=A[L];f.textContent=T[L],f.className=""}M=b.end.divIdx+1}if(!u?.highlightMatches||o)return;let F=u.pageMatches[v]||null,S=u.pageMatchesLength[v]||null;this.matches=this._convertMatches(F,S),this._renderMatches(this.matches)}}i.TextHighlighter=r},(t,i,r)=>{var d,v,T,A,M,Hl,Gl;Object.defineProperty(i,"__esModule",{value:!0}),i.TextLayerBuilder=void 0;var m=r(4),o=r(2);class u{constructor({highlighter:N=null,accessibilityManager:L=null,isOffscreenCanvasSupported:g=!0,enablePermissions:f=!1}){ee(this,M);ee(this,d,!1);ee(this,v,0);ee(this,T,0);ee(this,A,null);this.textContentItemsStr=[],this.renderingDone=!1,this.textDivs=[],this.textDivProperties=new WeakMap,this.textLayerRenderTask=null,this.highlighter=N,this.accessibilityManager=L,this.isOffscreenCanvasSupported=g,J(this,d,f===!0),this.div=document.createElement("div"),this.div.className="textLayer",this.hide()}get numTextDivs(){return this.textDivs.length}render(N){return Ue(this,null,function*(){if(!s(this,A))throw new Error('No "textContentSource" parameter specified.');let L=N.scale*(globalThis.devicePixelRatio||1),{rotation:g}=N;if(this.renderingDone){let f=g!==s(this,v),p=L!==s(this,T);(f||p)&&(this.hide(),(0,m.updateTextLayer)({container:this.div,viewport:N,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:p,mustRotate:f}),J(this,T,L),J(this,v,g)),this.show();return}this.cancel(),this.highlighter?.setTextMapping(this.textDivs,this.textContentItemsStr),this.accessibilityManager?.setTextMapping(this.textDivs),this.textLayerRenderTask=(0,m.renderTextLayer)({textContentSource:s(this,A),container:this.div,viewport:N,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),yield this.textLayerRenderTask.promise,G(this,M,Hl).call(this),J(this,T,L),J(this,v,g),this.show(),this.accessibilityManager?.enable()})}hide(){this.div.hidden||(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.renderingDone&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.highlighter?.disable(),this.accessibilityManager?.disable(),this.textContentItemsStr.length=0,this.textDivs.length=0,this.textDivProperties=new WeakMap}setTextContentSource(N){this.cancel(),J(this,A,N)}}d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakSet,Hl=function(){this.renderingDone=!0;let N=document.createElement("div");N.className="endOfContent",this.div.append(N),G(this,M,Gl).call(this)},Gl=function(){let{div:N}=this;N.addEventListener("mousedown",L=>{let g=N.querySelector(".endOfContent");if(!g)return;let f=L.target!==N;if(f&&=getComputedStyle(g).getPropertyValue("-moz-user-select")!=="none",f){let p=N.getBoundingClientRect(),C=Math.max(0,(L.pageY-p.top)/p.height);g.style.top=(C*100).toFixed(2)+"%"}g.classList.add("active")}),N.addEventListener("mouseup",()=>{let L=N.querySelector(".endOfContent");L&&(L.style.top="",L.classList.remove("active"))}),N.addEventListener("copy",L=>{if(!s(this,d)){let g=document.getSelection();L.clipboardData.setData("text/plain",(0,o.removeNullCharacters)((0,m.normalizeUnicode)(g.toString())))}L.preventDefault(),L.stopPropagation()})},i.TextLayerBuilder=u},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.XfaLayerBuilder=void 0;var m=r(4);class o{constructor({pageDiv:d,pdfPage:v,annotationStorage:T=null,linkService:A,xfaHtml:M=null}){this.pageDiv=d,this.pdfPage=v,this.annotationStorage=T,this.linkService=A,this.xfaHtml=M,this.div=null,this._cancelled=!1}render(d,v="display"){return Ue(this,null,function*(){if(v==="print"){let M={viewport:d.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:v},F=document.createElement("div");return this.pageDiv.append(F),M.div=F,m.XfaLayer.render(M)}let T=yield this.pdfPage.getXfa();if(this._cancelled||!T)return{textDivs:[]};let A={viewport:d.clone({dontFlip:!0}),div:this.div,xfaHtml:T,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:v};return this.div?m.XfaLayer.update(A):(this.div=document.createElement("div"),this.pageDiv.append(this.div),A.div=this.div,m.XfaLayer.render(A))})}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}i.XfaLayerBuilder=o},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFScriptingManager=void 0;var m=r(22),o=r(23);class u extends o.PDFScriptingManager{constructor(v){v.externalServices||window.addEventListener("updatefromsandbox",T=>{v.eventBus.dispatch("updatefromsandbox",{source:window,detail:T.detail})}),v.externalServices||={createScripting:({sandboxBundleSrc:T})=>new m.GenericScripting(T)},v.docProperties||=T=>(0,m.docProperties)(T),super(v)}}i.PDFScriptingManager=u},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GenericScripting=void 0,i.docProperties=o;var m=r(4);function o(d){return Ue(this,null,function*(){let v="",T=v.split("#")[0],{info:A,metadata:M,contentDispositionFilename:F,contentLength:S}=yield d.getMetadata();if(!S){let{length:b}=yield d.getDownloadInfo();S=b}return At(ft({},A),{baseURL:T,filesize:S,filename:F||(0,m.getPdfFilenameFromUrl)(v),metadata:M?.getRaw(),authors:M?.get("dc:creator"),numPages:d.numPages,URL:v})})}class u{constructor(v){this._ready=(0,m.loadScript)(v,!0).then(()=>window.pdfjsSandbox.QuickJSSandbox())}createSandbox(v){return Ue(this,null,function*(){(yield this._ready).create(v)})}dispatchEventInSandbox(v){return Ue(this,null,function*(){let T=yield this._ready;setTimeout(()=>T.dispatchEvent(v),0)})}destroySandbox(){return Ue(this,null,function*(){(yield this._ready).nukeSandbox()})}}i.GenericScripting=u},(t,i,r)=>{var d,v,T,A,M,F,S,b,N,L,g,f,Xl,cs,Sr,ql,pn;Object.defineProperty(i,"__esModule",{value:!0}),i.PDFScriptingManager=void 0;var m=r(2),o=r(4);class u{constructor({eventBus:w,sandboxBundleSrc:D=null,externalServices:V=null,docProperties:U=null}){ee(this,f);ee(this,d,null);ee(this,v,null);ee(this,T,null);ee(this,A,null);ee(this,M,null);ee(this,F,null);ee(this,S,null);ee(this,b,!1);ee(this,N,null);ee(this,L,null);ee(this,g,null);J(this,A,w),J(this,N,D),J(this,M,V),J(this,T,U)}setViewer(w){J(this,S,w)}setDocument(w){return Ue(this,null,function*(){if(s(this,F)&&(yield G(this,f,pn).call(this)),J(this,F,w),!w)return;let[D,V,U]=yield Promise.all([w.getFieldObjects(),w.getCalculationOrderIds(),w.getJSActions()]);if(!D&&!U){yield G(this,f,pn).call(this);return}if(w===s(this,F)){try{J(this,L,G(this,f,ql).call(this))}catch(q){console.error(`setDocument: "${q.message}".`),yield G(this,f,pn).call(this);return}this._internalEvents.set("updatefromsandbox",q=>{q?.source===window&&G(this,f,Xl).call(this,q.detail)}),this._internalEvents.set("dispatcheventinsandbox",q=>{s(this,L)?.dispatchEventInSandbox(q.detail)}),this._internalEvents.set("pagechanging",({pageNumber:q,previous:$})=>{q!==$&&(G(this,f,Sr).call(this,$),G(this,f,cs).call(this,q))}),this._internalEvents.set("pagerendered",({pageNumber:q})=>{this._pageOpenPending.has(q)&&q===s(this,S).currentPageNumber&&G(this,f,cs).call(this,q)}),this._internalEvents.set("pagesdestroy",()=>Ue(this,null,function*(){yield G(this,f,Sr).call(this,s(this,S).currentPageNumber),yield s(this,L)?.dispatchEventInSandbox({id:"doc",name:"WillClose"}),s(this,d)?.resolve()}));for(let[q,$]of this._internalEvents)s(this,A)._on(q,$);try{let q=yield s(this,T).call(this,w);if(w!==s(this,F))return;yield s(this,L).createSandbox({objects:D,calculationOrder:V,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:At(ft({},q),{actions:U})}),s(this,A).dispatch("sandboxcreated",{source:this})}catch(q){console.error(`setDocument: "${q.message}".`),yield G(this,f,pn).call(this);return}yield s(this,L)?.dispatchEventInSandbox({id:"doc",name:"Open"}),yield G(this,f,cs).call(this,s(this,S).currentPageNumber,!0),Promise.resolve().then(()=>{w===s(this,F)&&J(this,b,!0)})}})}dispatchWillSave(){return Ue(this,null,function*(){return s(this,L)?.dispatchEventInSandbox({id:"doc",name:"WillSave"})})}dispatchDidSave(){return Ue(this,null,function*(){return s(this,L)?.dispatchEventInSandbox({id:"doc",name:"DidSave"})})}dispatchWillPrint(){return Ue(this,null,function*(){if(s(this,L)){yield s(this,g)?.promise,J(this,g,new o.PromiseCapability);try{yield s(this,L).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(w){throw s(this,g).resolve(),J(this,g,null),w}yield s(this,g).promise}})}dispatchDidPrint(){return Ue(this,null,function*(){return s(this,L)?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})})}get destroyPromise(){return s(this,v)?.promise||null}get ready(){return s(this,b)}get _internalEvents(){return(0,o.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,o.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,o.shadow)(this,"_visitedPages",new Map)}}d=new WeakMap,v=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,F=new WeakMap,S=new WeakMap,b=new WeakMap,N=new WeakMap,L=new WeakMap,g=new WeakMap,f=new WeakSet,Xl=function(w){return Ue(this,null,function*(){let D=s(this,S),V=D.isInPresentationMode||D.isChangingPresentationMode,{id:U,siblings:q,command:$,value:x}=w;if(!U){switch($){case"clear":console.clear();break;case"error":console.error(x);break;case"layout":if(!V){let c=(0,m.apiPageLayoutToViewerModes)(x);D.spreadMode=c.spreadMode}break;case"page-num":D.currentPageNumber=x+1;break;case"print":yield D.pagesPromise,s(this,A).dispatch("print",{source:this});break;case"println":console.log(x);break;case"zoom":V||(D.currentScaleValue=x);break;case"SaveAs":s(this,A).dispatch("download",{source:this});break;case"FirstPage":D.currentPageNumber=1;break;case"LastPage":D.currentPageNumber=D.pagesCount;break;case"NextPage":D.nextPage();break;case"PrevPage":D.previousPage();break;case"ZoomViewIn":V||D.increaseScale();break;case"ZoomViewOut":V||D.decreaseScale();break;case"WillPrintFinished":s(this,g)?.resolve(),J(this,g,null);break}return}if(V&&w.focus)return;delete w.id,delete w.siblings;let a=q?[U,...q]:[U];for(let c of a){let E=document.querySelector(`[data-element-id="${c}"]`);E?E.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:w})):s(this,F)?.annotationStorage.setValue(c,w)}})},cs=function(w,D=!1){return Ue(this,null,function*(){let V=s(this,F),U=this._visitedPages;if(D&&J(this,d,new o.PromiseCapability),!s(this,d))return;let q=s(this,S).getPageView(w-1);if(q?.renderingState!==m.RenderingStates.FINISHED){this._pageOpenPending.add(w);return}this._pageOpenPending.delete(w);let $=Ue(this,null,function*(){let x=yield U.has(w)?null:q.pdfPage?.getJSActions();V===s(this,F)&&(yield s(this,L)?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:w,actions:x}))});U.set(w,$)})},Sr=function(w){return Ue(this,null,function*(){let D=s(this,F),V=this._visitedPages;if(!s(this,d)||this._pageOpenPending.has(w))return;let U=V.get(w);U&&(V.set(w,null),yield U,D===s(this,F)&&(yield s(this,L)?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:w})))})},ql=function(){if(J(this,v,new o.PromiseCapability),s(this,L))throw new Error("#initScripting: Scripting already exists.");return s(this,M).createScripting({sandboxBundleSrc:s(this,N)})},pn=function(){return Ue(this,null,function*(){if(!s(this,L)){J(this,F,null),s(this,v)?.resolve();return}s(this,d)&&(yield Promise.race([s(this,d).promise,new Promise(w=>{setTimeout(w,1e3)})]).catch(()=>{}),J(this,d,null)),J(this,F,null);try{yield s(this,L).destroySandbox()}catch{}s(this,g)?.reject(new Error("Scripting destroyed.")),J(this,g,null);for(let[w,D]of this._internalEvents)s(this,A)._off(w,D);this._internalEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),J(this,L,null),J(this,b,!1),s(this,v)?.resolve()})},i.PDFScriptingManager=u},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFSinglePageViewer=void 0;var m=r(2),o=r(25);class u extends o.PDFViewer{_resetView(){super._resetView(),this._scrollMode=m.ScrollMode.PAGE,this._spreadMode=m.SpreadMode.NONE}set scrollMode(v){}_updateScrollMode(){}set spreadMode(v){}_updateSpreadMode(){}}i.PDFSinglePageViewer=u},(t,i,r)=>{var N,L,g,xr,p,C,P,k,R,W,w,D,V,U,q,$,x,a,c,E,B,O,Kl,Yl,Ql,Zl,fn,hs,Jl,Ar,ec,mi,Pr,tc,ic,Er,nc;Object.defineProperty(i,"__esModule",{value:!0}),i.PagesCountLimit=i.PDFViewer=i.PDFPageViewBuffer=void 0;var m=r(4),o=r(2),u=r(7),d=r(13),v=r(26),T=r(5);let A=10,M={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};i.PagesCountLimit=M;function F(y){return Object.values(m.AnnotationEditorType).includes(y)&&y!==m.AnnotationEditorType.DISABLE}class S{constructor(l){ee(this,g);ee(this,N,new Set);ee(this,L,0);J(this,L,l)}push(l){let I=s(this,N);I.has(l)&&I.delete(l),I.add(l),I.size>s(this,L)&&G(this,g,xr).call(this)}resize(l,I=null){J(this,L,l);let z=s(this,N);if(I){let Q=z.size,K=1;for(let le of z)if(I.has(le.id)&&(z.delete(le),z.add(le)),++K>Q)break}for(;z.size>s(this,L);)G(this,g,xr).call(this)}has(l){return s(this,N).has(l)}[Symbol.iterator](){return s(this,N).keys()}}N=new WeakMap,L=new WeakMap,g=new WeakSet,xr=function(){let l=s(this,N).keys().next().value;l?.destroy(),s(this,N).delete(l)},i.PDFPageViewBuffer=S;class b{constructor(l){ee(this,O);ee(this,p,null);ee(this,C,null);ee(this,P,m.AnnotationEditorType.NONE);ee(this,k,null);ee(this,R,m.AnnotationMode.ENABLE_FORMS);ee(this,W,null);ee(this,w,null);ee(this,D,!1);ee(this,V,!1);ee(this,U,null);ee(this,q,!1);ee(this,$,0);ee(this,x,new ResizeObserver(G(this,O,nc).bind(this)));ee(this,a,null);ee(this,c,null);ee(this,E,null);ee(this,B,o.TextLayerMode.ENABLE);let I="3.11.174";if(m.version!==I)throw new Error(`The API version "${m.version}" does not match the Viewer version "${I}".`);if(this.container=l.container,this.viewer=l.viewer||l.container.firstElementChild,this.container?.tagName!=="DIV"||this.viewer?.tagName!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");s(this,x).observe(this.container),this.eventBus=l.eventBus,this.linkService=l.linkService||new T.SimpleLinkService,this.downloadManager=l.downloadManager||null,this.findController=l.findController||null,J(this,C,l.altTextManager||null),this.findController&&(this.findController.onIsPageVisible=z=>this._getVisiblePages().ids.has(z)),this._scriptingManager=l.scriptingManager||null,J(this,B,l.textLayerMode??o.TextLayerMode.ENABLE),J(this,R,l.annotationMode??m.AnnotationMode.ENABLE_FORMS),J(this,P,l.annotationEditorMode??m.AnnotationEditorType.NONE),this.imageResourcesPath=l.imageResourcesPath||"",this.enablePrintAutoRotate=l.enablePrintAutoRotate||!1,this.removePageBorders=l.removePageBorders||!1,l.useOnlyCssZoom&&(console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."),l.maxCanvasPixels=0),this.isOffscreenCanvasSupported=l.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=l.maxCanvasPixels,this.l10n=l.l10n||u.NullL10n,J(this,D,l.enablePermissions||!1),this.pageColors=l.pageColors||null,this.defaultRenderingQueue=!l.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new v.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=l.renderingQueue,this.scroll=(0,o.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=o.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),G(this,O,Er).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:z,pdfPage:Q})=>{let K=this._pages[z-1];s(this,p).has(K)||Q?.cleanup()})}get pagesCount(){return this._pages.length}getPageView(l){return this._pages[l]}getCachedPageViews(){return new Set(s(this,p))}get pageViewsReady(){return this._pagesCapability.settled&&this._pages.every(l=>l?.pdfPage)}get renderForms(){return s(this,R)===m.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(l){if(!Number.isInteger(l))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(l,!0)||console.error(`currentPageNumber: "${l}" is not a valid page.`))}_setCurrentPageNumber(l,I=!1){if(this._currentPageNumber===l)return I&&G(this,O,Pr).call(this),!0;if(!(0<l&&l<=this.pagesCount))return!1;let z=this._currentPageNumber;return this._currentPageNumber=l,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:l,pageLabel:this._pageLabels?.[l-1]??null,previous:z}),I&&G(this,O,Pr).call(this),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(l){if(!this.pdfDocument)return;let I=l|0;if(this._pageLabels){let z=this._pageLabels.indexOf(l);z>=0&&(I=z+1)}this._setCurrentPageNumber(I,!0)||console.error(`currentPageLabel: "${l}" is not a valid page.`)}get currentScale(){return this._currentScale!==o.UNKNOWN_SCALE?this._currentScale:o.DEFAULT_SCALE}set currentScale(l){if(isNaN(l))throw new Error("Invalid numeric scale.");this.pdfDocument&&G(this,O,mi).call(this,l,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(l){this.pdfDocument&&G(this,O,mi).call(this,l,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(l){if(!(0,o.isValidRotation)(l))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(l%=360,l<0&&(l+=360),this._pagesRotation===l))return;this._pagesRotation=l;let I=this._currentPageNumber;this.refresh(!0,{rotation:l}),this._currentScaleValue&&G(this,O,mi).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:l,pageNumber:I}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}getAllText(){return Ue(this,null,function*(){let l=[],I=[];for(let z=1,Q=this.pdfDocument.numPages;z<=Q;++z){if(s(this,q))return null;I.length=0;let K=yield this.pdfDocument.getPage(z),{items:le}=yield K.getTextContent();for(let se of le)se.str&&I.push(se.str),se.hasEOL&&I.push(`
`);l.push((0,o.removeNullCharacters)(I.join("")))}return l.join(`
`)})}setDocument(l){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),s(this,k)&&(s(this,k).destroy(),J(this,k,null))),this.pdfDocument=l,!l)return;let I=l.numPages,z=l.getPage(1),Q=l.getOptionalContentConfig(),K=s(this,D)?l.getPermissions():Promise.resolve();if(I>M.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");let le=this._scrollMode=o.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:le})}this._pagesCapability.promise.then(()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:I})},()=>{}),this._onBeforeDraw=le=>{let se=this._pages[le.pageNumber-1];se&&s(this,p).push(se)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=le=>{le.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:le.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,s(this,c)&&(document.removeEventListener("visibilitychange",s(this,c)),J(this,c,null)))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([z,K]).then(([le,se])=>{if(l!==this.pdfDocument)return;this._firstPageCapability.resolve(le),this._optionalContentConfigPromise=Q;let{annotationEditorMode:oe,annotationMode:we,textLayerMode:Ie}=G(this,O,Yl).call(this,se);if(Ie!==o.TextLayerMode.DISABLE){let be=J(this,U,document.createElement("div"));be.id="hiddenCopyElement",this.viewer.before(be)}if(oe!==m.AnnotationEditorType.DISABLE){let be=oe;l.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):F(be)?(J(this,k,new m.AnnotationEditorUIManager(this.container,this.viewer,s(this,C),this.eventBus,l,this.pageColors)),be!==m.AnnotationEditorType.NONE&&s(this,k).updateMode(be)):console.error(`Invalid AnnotationEditor mode: ${be}`)}let Qe=G(this,O,Kl).bind(this),ze=this._scrollMode===o.ScrollMode.PAGE?null:this.viewer,We=this.currentScale,rt=le.getViewport({scale:We*m.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",rt.scale),(this.pageColors?.foreground==="CanvasText"||this.pageColors?.background==="Canvas")&&this.viewer.style.setProperty("--hcm-highligh-filter",l.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight"));for(let be=1;be<=I;++be){let he=new d.PDFPageView({container:ze,eventBus:this.eventBus,id:be,scale:We,defaultViewport:rt.clone(),optionalContentConfigPromise:Q,renderingQueue:this.renderingQueue,textLayerMode:Ie,annotationMode:we,imageResourcesPath:this.imageResourcesPath,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:Qe});this._pages.push(he)}let at=this._pages[0];at&&(at.setPdfPage(le),this.linkService.cachePageRef(1,le.ref)),this._scrollMode===o.ScrollMode.PAGE?G(this,O,fn).call(this):this._spreadMode!==o.SpreadMode.NONE&&this._updateSpreadMode(),G(this,O,Ql).call(this).then(()=>Ue(this,null,function*(){if(this.findController?.setDocument(l),this._scriptingManager?.setDocument(l),s(this,U)&&(J(this,w,G(this,O,Zl).bind(this,Ie)),document.addEventListener("copy",s(this,w))),s(this,k)&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:s(this,P)}),l.loadingParams.disableAutoFetch||I>M.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let be=I-1;if(be<=0){this._pagesCapability.resolve();return}for(let he=2;he<=I;++he){let ce=l.getPage(he).then(Me=>{let et=this._pages[he-1];et.pdfPage||et.setPdfPage(Me),this.linkService.cachePageRef(he,Me.ref),--be===0&&this._pagesCapability.resolve()},Me=>{console.error(`Unable to get page ${he} to initialize viewer`,Me),--be===0&&this._pagesCapability.resolve()});he%M.PAUSE_EAGER_PAGE_INIT===0&&(yield ce)}})),this.eventBus.dispatch("pagesinit",{source:this}),l.getMetadata().then(({info:be})=>{l===this.pdfDocument&&be.Language&&(this.viewer.lang=be.Language)}),this.defaultRenderingQueue&&this.update()}).catch(le=>{console.error("Unable to initialize viewer",le),this._pagesCapability.reject(le)})}setPageLabels(l){if(this.pdfDocument){l?Array.isArray(l)&&this.pdfDocument.numPages===l.length?this._pageLabels=l:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let I=0,z=this._pages.length;I<z;I++)this._pages[I].setPageLabel(this._pageLabels?.[I]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=o.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,J(this,p,new S(A)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=new m.PromiseCapability,this._onePageRenderedCapability=new m.PromiseCapability,this._pagesCapability=new m.PromiseCapability,this._scrollMode=o.ScrollMode.VERTICAL,this._previousScrollMode=o.ScrollMode.UNKNOWN,this._spreadMode=o.SpreadMode.NONE,J(this,a,{previousPageNumber:1,scrollDown:!0,pages:[]}),this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),s(this,c)&&(document.removeEventListener("visibilitychange",s(this,c)),J(this,c,null)),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),s(this,U)&&(document.removeEventListener("copy",s(this,w)),J(this,w,null),s(this,U).remove(),J(this,U,null))}_scrollUpdate(){this.pagesCount!==0&&this.update()}pageLabelToPageNumber(l){if(!this._pageLabels)return null;let I=this._pageLabels.indexOf(l);return I<0?null:I+1}scrollPageIntoView({pageNumber:l,destArray:I=null,allowNegativeOffset:z=!1,ignoreDestinationZoom:Q=!1}){if(!this.pdfDocument)return;let K=Number.isInteger(l)&&this._pages[l-1];if(!K){console.error(`scrollPageIntoView: "${l}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!I){this._setCurrentPageNumber(l,!0);return}let le=0,se=0,oe=0,we=0,Ie,Qe,ze=K.rotation%180!==0,We=(ze?K.height:K.width)/K.scale/m.PixelsPerInch.PDF_TO_CSS_UNITS,rt=(ze?K.width:K.height)/K.scale/m.PixelsPerInch.PDF_TO_CSS_UNITS,at=0;switch(I[1].name){case"XYZ":le=I[2],se=I[3],at=I[4],le=le!==null?le:0,se=se!==null?se:rt;break;case"Fit":case"FitB":at="page-fit";break;case"FitH":case"FitBH":se=I[2],at="page-width",se===null&&this._location?(le=this._location.left,se=this._location.top):(typeof se!="number"||se<0)&&(se=rt);break;case"FitV":case"FitBV":le=I[2],oe=We,we=rt,at="page-height";break;case"FitR":le=I[2],se=I[3],oe=I[4]-le,we=I[5]-se;let Me=o.SCROLLBAR_PADDING,et=o.VERTICAL_PADDING;this.removePageBorders&&(Me=et=0),Ie=(this.container.clientWidth-Me)/oe/m.PixelsPerInch.PDF_TO_CSS_UNITS,Qe=(this.container.clientHeight-et)/we/m.PixelsPerInch.PDF_TO_CSS_UNITS,at=Math.min(Math.abs(Ie),Math.abs(Qe));break;default:console.error(`scrollPageIntoView: "${I[1].name}" is not a valid destination type.`);return}if(Q||(at&&at!==this._currentScale?this.currentScaleValue=at:this._currentScale===o.UNKNOWN_SCALE&&(this.currentScaleValue=o.DEFAULT_SCALE_VALUE)),at==="page-fit"&&!I[4]){G(this,O,hs).call(this,K);return}let be=[K.viewport.convertToViewportPoint(le,se),K.viewport.convertToViewportPoint(le+oe,se+we)],he=Math.min(be[0][0],be[1][0]),ce=Math.min(be[0][1],be[1][1]);z||(he=Math.max(he,0),ce=Math.max(ce,0)),G(this,O,hs).call(this,K,{left:he,top:ce})}_updateLocation(l){let I=this._currentScale,z=this._currentScaleValue,Q=parseFloat(z)===I?Math.round(I*1e4)/100:z,K=l.id,le=this._pages[K-1],se=this.container,oe=le.getPagePoint(se.scrollLeft-l.x,se.scrollTop-l.y),we=Math.round(oe[0]),Ie=Math.round(oe[1]),Qe=`#page=${K}`;this.isInPresentationMode||(Qe+=`&zoom=${Q},${we},${Ie}`),this._location={pageNumber:K,scale:Q,top:Ie,left:we,rotation:this._pagesRotation,pdfOpenParams:Qe}}update(){let l=this._getVisiblePages(),I=l.views,z=I.length;if(z===0)return;let Q=Math.max(A,2*z+1);s(this,p).resize(Q,l.ids),this.renderingQueue.renderHighestPriority(l);let K=this._spreadMode===o.SpreadMode.NONE&&(this._scrollMode===o.ScrollMode.PAGE||this._scrollMode===o.ScrollMode.VERTICAL),le=this._currentPageNumber,se=!1;for(let oe of I){if(oe.percent<100)break;if(oe.id===le&&K){se=!0;break}}this._setCurrentPageNumber(se?le:I[0].id),this._updateLocation(l.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(l){return this.container.contains(l)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===o.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===o.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){let l=this._scrollMode===o.ScrollMode.PAGE?s(this,a).pages:this._pages,I=this._scrollMode===o.ScrollMode.HORIZONTAL,z=I&&this._isContainerRtl;return(0,o.getVisibleElements)({scrollEl:this.container,views:l,sortByVisibility:!0,horizontal:I,rtl:z})}cleanup(){for(let l of this._pages)l.renderingState!==o.RenderingStates.FINISHED&&l.reset()}_cancelRendering(){for(let l of this._pages)l.cancelRendering()}forceRendering(l){let I=l||this._getVisiblePages(),z=G(this,O,ic).call(this,I),Q=this._spreadMode!==o.SpreadMode.NONE&&this._scrollMode!==o.ScrollMode.HORIZONTAL,K=this.renderingQueue.getHighestPriority(I,this._pages,z,Q);return K?(G(this,O,tc).call(this,K).then(()=>{this.renderingQueue.renderView(K)}),!0):!1}get hasEqualPageSizes(){let l=this._pages[0];for(let I=1,z=this._pages.length;I<z;++I){let Q=this._pages[I];if(Q.width!==l.width||Q.height!==l.height)return!1}return!0}getPagesOverview(){let l;return this._pages.map(I=>{let z=I.pdfPage.getViewport({scale:1}),Q=(0,o.isPortraitOrientation)(z);if(l===void 0)l=Q;else if(this.enablePrintAutoRotate&&Q!==l)return{width:z.height,height:z.width,rotation:(z.rotation-90)%360};return{width:z.width,height:z.height,rotation:z.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)}set optionalContentConfigPromise(l){if(!(l instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${l}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=l,this.refresh(!1,{optionalContentConfigPromise:l}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:l}))}get scrollMode(){return this._scrollMode}set scrollMode(l){if(this._scrollMode!==l){if(!(0,o.isValidScrollMode)(l))throw new Error(`Invalid scroll mode: ${l}`);this.pagesCount>M.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=l,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:l}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(l=null){let I=this._scrollMode,z=this.viewer;z.classList.toggle("scrollHorizontal",I===o.ScrollMode.HORIZONTAL),z.classList.toggle("scrollWrapped",I===o.ScrollMode.WRAPPED),!(!this.pdfDocument||!l)&&(I===o.ScrollMode.PAGE?G(this,O,fn).call(this):this._previousScrollMode===o.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&G(this,O,mi).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(l,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(l){if(this._spreadMode!==l){if(!(0,o.isValidSpreadMode)(l))throw new Error(`Invalid spread mode: ${l}`);this._spreadMode=l,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:l}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(l=null){if(!this.pdfDocument)return;let I=this.viewer,z=this._pages;if(this._scrollMode===o.ScrollMode.PAGE)G(this,O,fn).call(this);else if(I.textContent="",this._spreadMode===o.SpreadMode.NONE)for(let Q of this._pages)I.append(Q.div);else{let Q=this._spreadMode-1,K=null;for(let le=0,se=z.length;le<se;++le)K===null?(K=document.createElement("div"),K.className="spread",I.append(K)):le%2===Q&&(K=K.cloneNode(!1),I.append(K)),K.append(z[le].div)}l&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&G(this,O,mi).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(l,!0),this.update())}_getPageAdvance(l,I=!1){switch(this._scrollMode){case o.ScrollMode.WRAPPED:{let{views:z}=this._getVisiblePages(),Q=new Map;for(let{id:K,y:le,percent:se,widthPercent:oe}of z){if(se===0||oe<100)continue;let we=Q.get(le);we||Q.set(le,we||=[]),we.push(K)}for(let K of Q.values()){let le=K.indexOf(l);if(le===-1)continue;let se=K.length;if(se===1)break;if(I)for(let oe=le-1,we=0;oe>=we;oe--){let Ie=K[oe],Qe=K[oe+1]-1;if(Ie<Qe)return l-Qe}else for(let oe=le+1,we=se;oe<we;oe++){let Ie=K[oe],Qe=K[oe-1]+1;if(Ie>Qe)return Qe-l}if(I){let oe=K[0];if(oe<l)return l-oe+1}else{let oe=K[se-1];if(oe>l)return oe-l+1}break}break}case o.ScrollMode.HORIZONTAL:break;case o.ScrollMode.PAGE:case o.ScrollMode.VERTICAL:{if(this._spreadMode===o.SpreadMode.NONE)break;let z=this._spreadMode-1;if(I&&l%2!==z)break;if(!I&&l%2===z)break;let{views:Q}=this._getVisiblePages(),K=I?l-1:l+1;for(let{id:le,percent:se,widthPercent:oe}of Q)if(le===K){if(se>0&&oe===100)return 2;break}break}}return 1}nextPage(){let l=this._currentPageNumber,I=this.pagesCount;if(l>=I)return!1;let z=this._getPageAdvance(l,!1)||1;return this.currentPageNumber=Math.min(l+z,I),!0}previousPage(){let l=this._currentPageNumber;if(l<=1)return!1;let I=this._getPageAdvance(l,!0)||1;return this.currentPageNumber=Math.max(l-I,1),!0}increaseScale({drawingDelay:l,scaleFactor:I,steps:z}={}){if(!this.pdfDocument)return;let Q=this._currentScale;if(I>1)Q=Math.round(Q*I*100)/100;else{z??=1;do Q=Math.ceil((Q*o.DEFAULT_SCALE_DELTA).toFixed(2)*10)/10;while(--z>0&&Q<o.MAX_SCALE)}G(this,O,mi).call(this,Math.min(o.MAX_SCALE,Q),{noScroll:!1,drawingDelay:l})}decreaseScale({drawingDelay:l,scaleFactor:I,steps:z}={}){if(!this.pdfDocument)return;let Q=this._currentScale;if(I>0&&I<1)Q=Math.round(Q*I*100)/100;else{z??=1;do Q=Math.floor((Q/o.DEFAULT_SCALE_DELTA).toFixed(2)*10)/10;while(--z>0&&Q>o.MIN_SCALE)}G(this,O,mi).call(this,Math.max(o.MIN_SCALE,Q),{noScroll:!1,drawingDelay:l})}get containerTopLeft(){return s(this,W)||J(this,W,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return s(this,k)?s(this,P):m.AnnotationEditorType.DISABLE}set annotationEditorMode({mode:l,editId:I=null}){if(!s(this,k))throw new Error("The AnnotationEditor is not enabled.");if(s(this,P)!==l){if(!F(l))throw new Error(`Invalid AnnotationEditor mode: ${l}`);this.pdfDocument&&(J(this,P,l),this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:l}),s(this,k).updateMode(l,I))}}set annotationEditorParams({type:l,value:I}){if(!s(this,k))throw new Error("The AnnotationEditor is not enabled.");s(this,k).updateParams(l,I)}refresh(l=!1,I=Object.create(null)){if(this.pdfDocument){for(let z of this._pages)z.update(I);s(this,E)!==null&&(clearTimeout(s(this,E)),J(this,E,null)),l||this.update()}}}p=new WeakMap,C=new WeakMap,P=new WeakMap,k=new WeakMap,R=new WeakMap,W=new WeakMap,w=new WeakMap,D=new WeakMap,V=new WeakMap,U=new WeakMap,q=new WeakMap,$=new WeakMap,x=new WeakMap,a=new WeakMap,c=new WeakMap,E=new WeakMap,B=new WeakMap,O=new WeakSet,Kl=function(){let l=this;return{get annotationEditorUIManager(){return s(l,k)},get annotationStorage(){return l.pdfDocument?.annotationStorage},get downloadManager(){return l.downloadManager},get enableScripting(){return!!l._scriptingManager},get fieldObjectsPromise(){return l.pdfDocument?.getFieldObjects()},get findController(){return l.findController},get hasJSActionsPromise(){return l.pdfDocument?.hasJSActions()},get linkService(){return l.linkService}}},Yl=function(l){let I={annotationEditorMode:s(this,P),annotationMode:s(this,R),textLayerMode:s(this,B)};return l&&(!l.includes(m.PermissionFlag.COPY)&&s(this,B)===o.TextLayerMode.ENABLE&&(I.textLayerMode=o.TextLayerMode.ENABLE_PERMISSIONS),l.includes(m.PermissionFlag.MODIFY_CONTENTS)||(I.annotationEditorMode=m.AnnotationEditorType.DISABLE),!l.includes(m.PermissionFlag.MODIFY_ANNOTATIONS)&&!l.includes(m.PermissionFlag.FILL_INTERACTIVE_FORMS)&&s(this,R)===m.AnnotationMode.ENABLE_FORMS&&(I.annotationMode=m.AnnotationMode.ENABLE)),I},Ql=function(){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return Promise.resolve();let l=new Promise(I=>{J(this,c,()=>{document.visibilityState==="hidden"&&(I(),document.removeEventListener("visibilitychange",s(this,c)),J(this,c,null))}),document.addEventListener("visibilitychange",s(this,c))});return Promise.race([this._onePageRenderedCapability.promise,l])},Zl=function(l,I){let z=document.getSelection(),{focusNode:Q,anchorNode:K}=z;if(K&&Q&&z.containsNode(s(this,U))){if(s(this,V)||l===o.TextLayerMode.ENABLE_PERMISSIONS){I.preventDefault(),I.stopPropagation();return}J(this,V,!0);let le=this.container.style.cursor;this.container.style.cursor="wait";let se=oe=>J(this,q,oe.key==="Escape");window.addEventListener("keydown",se),this.getAllText().then(oe=>Ue(this,null,function*(){oe!==null&&(yield navigator.clipboard.writeText(oe))})).catch(oe=>{console.warn(`Something goes wrong when extracting the text: ${oe.message}`)}).finally(()=>{J(this,V,!1),J(this,q,!1),window.removeEventListener("keydown",se),this.container.style.cursor=le}),I.preventDefault(),I.stopPropagation()}},fn=function(){if(this._scrollMode!==o.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");let l=this._currentPageNumber,I=s(this,a),z=this.viewer;if(z.textContent="",I.pages.length=0,this._spreadMode===o.SpreadMode.NONE&&!this.isInPresentationMode){let Q=this._pages[l-1];z.append(Q.div),I.pages.push(Q)}else{let Q=new Set,K=this._spreadMode-1;K===-1?Q.add(l-1):l%2!==K?(Q.add(l-1),Q.add(l)):(Q.add(l-2),Q.add(l-1));let le=document.createElement("div");if(le.className="spread",this.isInPresentationMode){let se=document.createElement("div");se.className="dummyPage",le.append(se)}for(let se of Q){let oe=this._pages[se];oe&&(le.append(oe.div),I.pages.push(oe))}z.append(le)}I.scrollDown=l>=I.previousPageNumber,I.previousPageNumber=l},hs=function(l,I=null){let{div:z,id:Q}=l;if(this._currentPageNumber!==Q&&this._setCurrentPageNumber(Q),this._scrollMode===o.ScrollMode.PAGE&&(G(this,O,fn).call(this),this.update()),!I&&!this.isInPresentationMode){let K=z.offsetLeft+z.clientLeft,le=K+z.clientWidth,{scrollLeft:se,clientWidth:oe}=this.container;(this._scrollMode===o.ScrollMode.HORIZONTAL||K<se||le>se+oe)&&(I={left:0,top:0})}(0,o.scrollIntoView)(z,I),!this._currentScaleValue&&this._location&&(this._location=null)},Jl=function(l){return l===this._currentScale||Math.abs(l-this._currentScale)<1e-15},Ar=function(l,I,{noScroll:z=!1,preset:Q=!1,drawingDelay:K=-1}){if(this._currentScaleValue=I.toString(),G(this,O,Jl).call(this,l)){Q&&this.eventBus.dispatch("scalechanging",{source:this,scale:l,presetValue:I});return}this.viewer.style.setProperty("--scale-factor",l*m.PixelsPerInch.PDF_TO_CSS_UNITS);let le=K>=0&&K<1e3;if(this.refresh(!0,{scale:l,drawingDelay:le?K:-1}),le&&J(this,E,setTimeout(()=>{J(this,E,null),this.refresh()},K)),this._currentScale=l,!z){let se=this._currentPageNumber,oe;this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(se=this._location.pageNumber,oe=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:se,destArray:oe,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:l,presetValue:Q?I:void 0}),this.defaultRenderingQueue&&this.update()},ec=function(){return this._spreadMode!==o.SpreadMode.NONE&&this._scrollMode!==o.ScrollMode.HORIZONTAL?2:1},mi=function(l,I){let z=parseFloat(l);if(z>0)I.preset=!1,G(this,O,Ar).call(this,z,l,I);else{let Q=this._pages[this._currentPageNumber-1];if(!Q)return;let K=o.SCROLLBAR_PADDING,le=o.VERTICAL_PADDING;this.isInPresentationMode?(K=le=4,this._spreadMode!==o.SpreadMode.NONE&&(K*=2)):this.removePageBorders?K=le=0:this._scrollMode===o.ScrollMode.HORIZONTAL&&([K,le]=[le,K]);let se=(this.container.clientWidth-K)/Q.width*Q.scale/s(this,O,ec),oe=(this.container.clientHeight-le)/Q.height*Q.scale;switch(l){case"page-actual":z=1;break;case"page-width":z=se;break;case"page-height":z=oe;break;case"page-fit":z=Math.min(se,oe);break;case"auto":let we=(0,o.isPortraitOrientation)(Q)?se:Math.min(oe,se);z=Math.min(o.MAX_AUTO_SCALE,we);break;default:console.error(`#setScale: "${l}" is an unknown zoom value.`);return}I.preset=!0,G(this,O,Ar).call(this,z,l,I)}},Pr=function(){let l=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&G(this,O,mi).call(this,this._currentScaleValue,{noScroll:!0}),G(this,O,hs).call(this,l)},tc=function(l){return Ue(this,null,function*(){if(l.pdfPage)return l.pdfPage;try{let I=yield this.pdfDocument.getPage(l.id);return l.pdfPage||l.setPdfPage(I),this.linkService._cachedPageNumber?.(I.ref)||this.linkService.cachePageRef(l.id,I.ref),I}catch(I){return console.error("Unable to get page for page view",I),null}})},ic=function(l){if(l.first?.id===1)return!0;if(l.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case o.ScrollMode.PAGE:return s(this,a).scrollDown;case o.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down},Er=function(l=this.container.clientHeight){l!==s(this,$)&&(J(this,$,l),o.docStyle.setProperty("--viewer-container-height",`${l}px`))},nc=function(l){for(let I of l)if(I.target===this.container){G(this,O,Er).call(this,Math.floor(I.borderBoxSize[0].blockSize)),J(this,W,null);break}},i.PDFViewer=b},(t,i,r)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFRenderingQueue=void 0;var m=r(4),o=r(2);let u=3e4;class d{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(T){this.pdfViewer=T}setThumbnailViewer(T){this.pdfThumbnailViewer=T}isHighestPriority(T){return this.highestPriorityPage===T.renderingId}renderHighestPriority(T){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(T)&&(this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),u)))}getHighestPriority(T,A,M,F=!1){let S=T.views,b=S.length;if(b===0)return null;for(let p=0;p<b;p++){let C=S[p].view;if(!this.isViewFinished(C))return C}let N=T.first.id,L=T.last.id;if(L-N+1>b){let p=T.ids;for(let C=1,P=L-N;C<P;C++){let k=M?N+C:L-C;if(p.has(k))continue;let R=A[k-1];if(!this.isViewFinished(R))return R}}let g=M?L:N-2,f=A[g];return f&&!this.isViewFinished(f)||F&&(g+=M?1:-1,f=A[g],f&&!this.isViewFinished(f))?f:null}isViewFinished(T){return T.renderingState===o.RenderingStates.FINISHED}renderView(T){switch(T.renderingState){case o.RenderingStates.FINISHED:return!1;case o.RenderingStates.PAUSED:this.highestPriorityPage=T.renderingId,T.resume();break;case o.RenderingStates.RUNNING:this.highestPriorityPage=T.renderingId;break;case o.RenderingStates.INITIAL:this.highestPriorityPage=T.renderingId,T.draw().finally(()=>{this.renderHighestPriority()}).catch(A=>{A instanceof m.RenderingCancelledException||console.error(`renderView: "${A}"`)});break}return!0}}i.PDFRenderingQueue=d}],n={};function _(t){var i=n[t];if(i!==void 0)return i.exports;var r=n[t]={exports:{}};return h[t](r,r.exports,_),r.exports}var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return o.AnnotationLayerBuilder}}),Object.defineProperty(t,"DownloadManager",{enumerable:!0,get:function(){return u.DownloadManager}}),Object.defineProperty(t,"EventBus",{enumerable:!0,get:function(){return d.EventBus}}),Object.defineProperty(t,"FindState",{enumerable:!0,get:function(){return i.FindState}}),Object.defineProperty(t,"GenericL10n",{enumerable:!0,get:function(){return v.GenericL10n}}),Object.defineProperty(t,"LinkTarget",{enumerable:!0,get:function(){return r.LinkTarget}}),Object.defineProperty(t,"NullL10n",{enumerable:!0,get:function(){return T.NullL10n}}),Object.defineProperty(t,"PDFFindController",{enumerable:!0,get:function(){return i.PDFFindController}}),Object.defineProperty(t,"PDFHistory",{enumerable:!0,get:function(){return A.PDFHistory}}),Object.defineProperty(t,"PDFLinkService",{enumerable:!0,get:function(){return r.PDFLinkService}}),Object.defineProperty(t,"PDFPageView",{enumerable:!0,get:function(){return M.PDFPageView}}),Object.defineProperty(t,"PDFScriptingManager",{enumerable:!0,get:function(){return F.PDFScriptingManager}}),Object.defineProperty(t,"PDFSinglePageViewer",{enumerable:!0,get:function(){return S.PDFSinglePageViewer}}),Object.defineProperty(t,"PDFViewer",{enumerable:!0,get:function(){return b.PDFViewer}}),Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return m.ProgressBar}}),Object.defineProperty(t,"RenderingStates",{enumerable:!0,get:function(){return m.RenderingStates}}),Object.defineProperty(t,"ScrollMode",{enumerable:!0,get:function(){return m.ScrollMode}}),Object.defineProperty(t,"SimpleLinkService",{enumerable:!0,get:function(){return r.SimpleLinkService}}),Object.defineProperty(t,"SpreadMode",{enumerable:!0,get:function(){return m.SpreadMode}}),Object.defineProperty(t,"StructTreeLayerBuilder",{enumerable:!0,get:function(){return N.StructTreeLayerBuilder}}),Object.defineProperty(t,"TextLayerBuilder",{enumerable:!0,get:function(){return L.TextLayerBuilder}}),Object.defineProperty(t,"XfaLayerBuilder",{enumerable:!0,get:function(){return g.XfaLayerBuilder}}),Object.defineProperty(t,"parseQueryString",{enumerable:!0,get:function(){return m.parseQueryString}});var i=_(1),r=_(5),m=_(2),o=_(6),u=_(8),d=_(9),v=_(10),T=_(7),A=_(12),M=_(13),F=_(21),S=_(24),b=_(25),N=_(16),L=_(19),g=_(20);let f="3.11.174",p="ce8716743"})(),e})())});var ys=function(h){return h.IMAGE="image",h.PDF="pdf",h}(ys||{}),Sa=[ys.IMAGE,ys.PDF];var Si=(()=>{let n=class n{constructor(){this.lastSelectedRowElid=null,this.selectedElidsListSubject=new st([]),this.selectedElidsList$=this.selectedElidsListSubject.asObservable(),this.allRowsElidsSubject=new st([]),this.currentVisibleRowsElidsSubject=new st([]),this.hasPartSelection$=this.selectedElidsList$.pipe(Je(e=>e.length>0&&e.length<this.allRowsElids.length)),this.hasSomeSelection$=this.selectedElidsList$.pipe(Je(e=>e.length>0))}get lastSelectedRowIndex(){return this.allRowsElids.findIndex(t=>t===this.lastSelectedRowElid)}get selectedElidsList(){return[...this.selectedElidsListSubject.value]}set selectedElidsList(e){this.selectedElidsListSubject.next([...e])}get allRowsElids(){return[...this.allRowsElidsSubject.value]}set allRowsElids(e){this.allRowsElidsSubject.next([...e])}get currentVisibleRowsElids(){return[...this.currentVisibleRowsElidsSubject.value]}set currentVisibleRowsElids(e){this.currentVisibleRowsElidsSubject.next([...e])}setSelectionFromTo(e,t){let i=this.allRowsElids,r=i.findIndex(T=>T===e),m=i.findIndex(T=>T===t),o=r<0?0:r,u=o<m?o:m,d=o>m?o:m,v=i.slice(u,d+1);this.selectedElidsList=v}getRelativeRowElid(e){let t=this.allRowsElids;if(this.selectedElidsList.length===0||this.lastSelectedRowIndex<0)return t?.[0];let i=t[this.lastSelectedRowIndex],r=e>0?t.length-1:0;return this.lastSelectedRowIndex===r?i:t[this.lastSelectedRowIndex+e]}toggleSelection(e){this.isRowSelected(e)?this.selectedElidsList=this.selectedElidsList.filter(t=>t!==e):this.allRowsElids.includes(e)&&(this.selectedElidsList=this.selectedElidsList.concat(e))}checkAndUpdateSelection(){this.selectedElidsList=[...this.selectedElidsList].filter(e=>this.allRowsElids.includes(e))}isRowSelected(e){return this.selectedElidsList.includes(e)}selectRow(e,t=!1,i=!1){t?this.toggleSelection(e):i?this.setSelectionFromTo(this.lastSelectedRowElid,e):this.selectedElidsList=[e],i||(this.lastSelectedRowElid=e)}selectPreviousRow(e=!1){let t=this.getRelativeRowElid(-1);if(!e){this.selectRow(t);return}let i=this.isRowSelected(t);i&&t!==this.lastSelectedRowElid?this.toggleSelection(this.lastSelectedRowElid):i||this.toggleSelection(t),this.lastSelectedRowElid=t}selectNextRow(e=!1){let t=this.getRelativeRowElid(1);if(!e){this.selectRow(t);return}let i=this.isRowSelected(t);i&&t!==this.lastSelectedRowElid?this.toggleSelection(this.lastSelectedRowElid):i||this.toggleSelection(t),this.lastSelectedRowElid=t}selectAllRows(){let e=this.currentVisibleRowsElids,t=this.selectedElidsList;t.length===0?this.selectedElidsList=t.concat(e):this.selectedElidsList=t.filter(i=>!e.includes(i)),this.lastSelectedRowElid=null}resetSelection(){this.selectedElidsList=[],this.lastSelectedRowElid=null}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var $t=(()=>{let n=class n{get tab(){return this.tabContextService.tab}get doc(){return this.tabContextService.doc}constructor(e,t,i,r,m,o,u,d,v,T,A,M){this.tabContextService=e,this.tabService=t,this.actionService=i,this.toolbarService=r,this.api5Service=m,this.messageBusService=o,this.notificationStackService=u,this.drawerManagerService=d,this.preloadedActionService=v,this.rowSelectionService=T,this.keydownService=A,this.destroyRef=M,this.tab$=this.tabContextService.tab$,this.doc$=this.tabContextService.doc$.pipe(Vt(F=>!!F)),this.destroyList$=new Mi,this.searchQuerySubject=new st(""),this.elementPatched$=new st(void 0),this.warningsSubject=new st([]),this.warnings$=this.warningsSubject.asObservable(),this.hasBreadcrumbs$=this.doc$.pipe(Je(F=>F.breadcrumb!==void 0)),this.breadcrumbList$=this.doc$.pipe(Je(F=>F.breadcrumb?.elem||[]),Je(F=>Array.isArray(F)?F:[F])),this.path$=this.breadcrumbList$.pipe(Je(F=>F.map(S=>S.$name).join(""))),this.editPath$=new st(!1),this.pathNavigateError$=new st(""),this.columnList$=this.doc$.pipe(Je(F=>bs(F))),this.elementList$=new st([]),this.activeGalleryItemIndex$=new st(0),this.galleryElidList$=new st([]),this.galleryItems$=Ft([this.galleryElidList$,this.elementList$,this.path$]).pipe(Je(([F,S,b])=>{if(!F?.length||!S?.length||!b)return null;let N=this.getElidKey();return S.filter(L=>F.includes(L[N].$)).map(L=>({cgi:L.data_cgi.$,type:L.type.$,elid:L[N].$,path:`${b}${L.name.$}`,size:L.size?.$orig?Number(L.size.$orig):void 0}))})),this.searchQuery$=this.searchQuerySubject.asObservable(),this.filterModelSubject=new st(null),this.selectionList$=this.rowSelectionService.selectedElidsList$,Ft([this.doc$,this.elementPatched$]).pipe(ct(this.destroyRef)).subscribe(([F])=>this.elementList$.next(nt.getElemList(F))),this.subscribeToWarnings(),this.subscribeToSaveSelectedElements(),this.subscribeToBackButton(),this.messageBusService.on$("drawer-form-submit").pipe(ct(this.destroyRef)).subscribe(F=>{let S=F.payload;!S||uo(S)?this.reloadListTab():S.$type===ro.List&&(this.tab.q=ao(S.$),this.tabService.update(this.tab))})}getMessageSet(){return this.tabContextService.getMessageSet()}getToolbar(){return this.tabContextService.getToolbar()}getMessage(e){return this.tabContextService.getMessage(e)}reloadTab(){this.tabContextService.reloadTab()}subscribeToBackButton(){this.doc$.pipe(mt(e=>{this.childTabEscapeSubscription?.unsubscribe();let t=e.metadata?.toolbar?.toolgrp?.find(i=>i.$name==="back");t?.toolbtn?.[0]&&(this.childTabEscapeSubscription=this.keydownService.listen$({code:"Escape",context:"escape-from-child-tab"}).pipe(mt(()=>{let i={elidList:[],toolbtn:t.toolbtn[0],tab:this.tab};this.actionService.handleToolBtn(i).subscribe()}),ct(this.destroyRef)).subscribe())}),ct(this.destroyRef)).subscribe()}subscribeToWarnings(){this.doc$.pipe(mt(e=>{if(!e.warning){this.addWarning([]);return}this.addWarning(e.warning)}),ct(this.destroyRef)).subscribe()}handlePathNavigate(e){let t={func:this.tab.func,plid:e},i=this.doc?.tparams?.table_params?.$;i&&(t.table_params=i),this.preloadedActionService.getAction(ft({func:this.tab.func},t),{skipErrorNotification:!0,emitOnError:!0}).subscribe(r=>{if(r.error){let m=r.error.$object==="stat"?"short_error_file_stat":"short_error_common",o=nt.getMessage(m,this.tab.doc);this.pathNavigateError$.next(o),this.editPath$.value||this.notificationStackService.showError$(r.error.msg.$);return}this.pathNavigateError$.next(""),this.editPath$.next(!1),this.tabService.update(this.tab,r)})}subscribeToSaveSelectedElements(){this.tab$.pipe(mt(()=>{this.updateSelectionList()}),Ut(()=>this.rowSelectionService.selectedElidsList$),ct(this.destroyRef)).subscribe(e=>{this.tab&&(this.tab.selectionList=e)})}updateSelectionList(){let e=this.tab?.selectionList?[...this.tab.selectionList]:[];this.rowSelectionService.selectedElidsList=e}excludeMenuItems(e){let t=["filter"],i=["new","list","back","refresh","url"];return!t.includes(e.$name)&&!i.includes(e.$type)&&e.$location!=="toolbar"}openTableSettings(){this.drawerManagerService.openDrawer$({type:"form",func:"tsetting",elid:this.tab.func,plid:new URLSearchParams(this.tab.q).toString()})}deleteFileFromGallery(e){let t=this.tabContextService.getToolbar().toolgrp?.map(r=>r.toolbtn).flat().find(r=>r?.$name==="delete"),i=this.handleAdditionalParams({elidList:[e],toolbtn:t,tab:this.tab,doc:this.doc});this.actionService.handleToolBtn(i).subscribe(()=>{let r=this.galleryElidList$.value,m=r.indexOf(e);this.activeGalleryItemIndex$.next(m&&m-1);let o=r.filter(u=>u!==e);this.galleryElidList$.next(o)})}downloadFileFromGallery(e){let t=this.tabContextService.getToolbar().toolgrp?.map(r=>r.toolbtn).flat().find(r=>r?.$name==="download"),i=this.handleAdditionalParams({elidList:[e],toolbtn:t,tab:this.tab,doc:this.doc});this.actionService.handleToolBtn(i).subscribe()}closeTableSettings(){this.drawerManagerService.close({func:"tsetting"})}ngOnDestroy(){this.childTabEscapeSubscription?.unsubscribe(),this.destroyList$.complete(),this.searchQuerySubject.complete()}listDestroy(){this.closeTableSettings(),this.destroyList$.next()}updateCurrentTabListScroll(e){this.tab.state.listScroll=e}nextSearchQuery(e){this.tab&&(this.tab.state.listSearch=e),this.searchQuerySubject.next(e)}saveColWidth(e){this.columnList$.pipe(Qt(1),Je(t=>{let i={elid:this.tab.func};return t.forEach((r,m)=>{let o=Math.round(e[m]);i[r.$name]=o;let u=this.doc.metadata?.coldata?.col?.find(d=>d.$name===r.$name);u&&(u.$width=`${o}%`)}),i}),Ut(t=>this.api5Service.colwidth(t))).subscribe()}getElidKey(){return this.tab?.doc?.metadata?.$key}getElementList(){return this.tab?.doc?.elem||[]}reloadListTab(){this.tabService.update(this.tab)}getElementsCount(){return Number(this.tab?.doc?.p_elems?.$)}getElementListByElid(e){let t=this.getElidKey(),i=this.getElementList();return e.map(r=>i.find(m=>Bt(m,t)?.$===r)).filter(r=>r)}getColumnMetaList(){return this.tab?.doc?.metadata?.coldata?.col||[]}patchCellValue({elid:e,columnName:t,value:i,newElid:r,silentPatch:m=!1}){let o=this.getElementListByElid([e])[0];if(o[t]={$:i},r){let u=this.getElidKey();o[u]={$:r}}m||this.elementPatched$.next()}subscribeToTab(){this.tab$.pipe(Vt(e=>e!==null),mt(e=>{this.searchQuerySubject.next(e.state.listSearch),setTimeout(()=>{this.messageBusService.emit("update-list-search-value",e.state.listSearch)})}),Ut(e=>e.doc$.pipe(Je(t=>({doc:t,tab:e})))),Pt(this.destroyList$)).subscribe(({doc:e,tab:t})=>{let i=e?.progressid?.$;t.state.progressIdSubject.value||t.state.progressIdSubject.next(i||null);let r=nt.getNotificationBanners(e);r.length&&(this.actionService.handleNotificationBanners(r),this.tabService.update(this.tab,At(ft({},e),{banner:nt.getNormalBanners(e)}),!1))})}closeGallery(){this.galleryElidList$.next([])}openGallery(e){let t=this.getElidKey(),i=this.elementList$.value.map(r=>r[t].$).filter(r=>this.isViewable(r));this.activeGalleryItemIndex$.next(i.indexOf(e)),this.galleryElidList$.next(i)}handleEmptyButtonClick(e){let t=this.getToolbar().toolgrp.map(i=>i.toolbtn).flat().find(i=>i?.$name===e.$name);t&&this.handleToolbarClick({btn:t})}handleToolbarClick(e){let t=this.rowSelectionService.selectedElidsList,i=t.find(m=>this.isViewable(m));if(e.btn.$func==="file.edit"&&i){this.openGallery(i);return}(e.btn.hide||e.btn.show)&&(t=this.getElementListByElid(t).filter(u=>e.btn.hide?.length>0?e.btn.hide.every(d=>Bt(u,d.$name)?.$!==d.$value):e.btn.show?.length>0?e.btn.show.some(d=>Bt(u,d.$name)?.$===d.$value):!0).map(u=>Bt(u,this.getElidKey())?.$));let r=this.handleAdditionalParams({elidList:t,toolbtn:e.btn,tab:this.tab,buttonElement:e.target,progressId:e?.btn?.$progressbar?Oo(e.btn.$progressbar):"",doc:this.doc});this.actionService.handleToolBtn(r).subscribe(()=>{this.rowSelectionService.checkAndUpdateSelection()})}handlePropClick(e){let t=this.handleAdditionalParams({elidList:[e.elid],toolbtn:At(ft({},e.prop),{$type:e.prop.$type==="list"?"editlist":e.prop.$type}),tab:this.tab,doc:this.doc});this.actionService.handleToolBtn(t).subscribe()}addWarning(e){this.warningsSubject.next(Array.isArray(e)?e:[e])}doDefaultAction(e){if(this.tab.func==="file"){if(this.isViewable(e)){this.openGallery(e);return}if(this.isVideo(e)){this.notificationStackService.showTemporaryNotification$({status:"warning",message:nt.getMessage("video_no_support",this.doc)});return}}let t=nt.getToolGrp(this.tab?.doc),i=this.getElementListByElid([e]),r=[].concat(...t.map(m=>m.toolbtn)).filter(m=>m?.$default).filter(m=>!this.toolbarService.isButtonRemoved(m,i)).filter(m=>this.toolbarService.isButtonActive(m,i));if(r[0]){let m=this.handleAdditionalParams({elidList:[e],toolbtn:r[0],tab:this.tab,doc:this.doc});this.actionService.handleToolBtn(m).subscribe()}}isViewable(e){let t=this.getElidKey(),i=this.elementList$.value.find(r=>r[t].$===e);return Sa.includes(i?.type?.$)}isVideo(e){let t=this.getElidKey();return this.elementList$.value.find(r=>r[t].$===e)?.type?.$==="video"}handleAdditionalParams(e){let t=this.getElidKey(),i=nt.getKeyname(this.tab.doc),m=bs(this.tab.doc).find(v=>v.$name===t),o=this.getElementListByElid(e.elidList),u={},d=o.map(v=>Bt(v,i||t)?.$).filter(Boolean);return d.length&&(u.elnameList=d),m?.$convert&&(u.tconvert=m.$convert),At(ft({},e),{additionalParams:u})}handleCellValueLinkClick(e,t){if(t.link?.nestedlist){this.actionService.handleNestedListLink({elid:e,blank:t.link.nestedlistBlank,child:t.link.nestedlistChild,nestedList:t.link.nestedlist,colName:t.name,colValue:t.value,tab:this.tab,parentFilterModel:this.filterModelSubject.value});return}t.link?.editform&&this.actionService.handleEditFormLink({elid:e,tab:this.tab,editform:t.link.editform})}getMenuForDropdownByElid(e,t){let i=`${e}${t}`,r=this.tab.listCache.get(i);if(r)return r;let m=nt.getContextMenu(this.tab)??nt.getToolbar(this.tab);if(!m?.toolgrp)return null;let o=this.getElementListByElid([e]),u=m.toolgrp.map(d=>At(ft({},d),{toolbtn:d.toolbtn?d.toolbtn.filter(v=>this.excludeMenuItems(v)&&this.toolbarService.isButtonActive(v,o)&&!this.toolbarService.isButtonRemoved(v,o)):[]})).filter(d=>d.toolbtn?.length>0);return u.length===0&&(u=null),this.tab.listCache.set(i,u),u}};n.\u0275fac=function(t){return new(t||n)(pt(zo),pt($i),pt(Ci),pt(Rn),pt(An),pt(Pn),pt(On),pt(Fo),pt(yi),pt(Si),pt(vi),pt(Rt))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();function Ac(h,n){if(h&1){let _=it();Ae(0,"div",10),Ge("click",function(){let t=Re(_).$implicit,i=pe(2);return De(i.navigate.emit(t.full))}),_t(1),Ae(2,"div",11),Ge("click",function(t){let i=Re(_).$implicit,r=pe(2);return t.stopPropagation(),De(r.handleToggleClick(i.full))}),Ke(3,"isp-svg-icon",12),Te()()}if(h&2){let _=n.$implicit;ge("title",_.full),Ce(),jt(" ",_.short," ")}}function Pc(h,n){if(h&1&&(Mt(0),Ke(1,"div",4),Ae(2,"div",5,0),Ke(4,"isp-svg-icon",6),Te(),Ae(5,"isp-dropdown",7),Ne(6,"async"),Ae(7,"div",8),je(8,Ac,4,2,"div",9),Ne(9,"async"),Te()(),kt()),h&2){let _=Ct(3),e=pe();Ce(5),ge("anchor",_)("anchorOffset",5)("destroyTrigger",Be(6,4,e.currentPath$)),Ce(3),ge("ngForOf",Be(9,6,e.pathsUI$))}}var Aa=(()=>{let n=class n{set currentPath(e){this.currentPath$.next(e)}constructor(e,t,i){this.api5Service=e,this.notificationService=t,this.listService=i,this.currentPath$=new st(""),this.lockToggle$=new st(!1),this.paths$=new st([]),this.pathsUI$=this.paths$.pipe(Je(r=>r.map(m=>{let o={full:m,short:m},u=m.split("/");return u.length>3&&(o.short=`.../${u.slice(-2)[0]}/`),o}))),this.hasCurrentPath$=Ft([this.currentPath$,this.paths$]).pipe(Je(([r,m])=>m.includes(r))),this.iconName$=this.hasCurrentPath$.pipe(Je(r=>`favorites-folder${r?"-crossed-out":""}`)),this.iconHint$=Ft([this.listService.doc$,this.hasCurrentPath$]).pipe(Je(([r,m])=>nt.getMessage(m?"hint_remove_from_favorite":"hint_add_to_favorite",r))),this.navigate=new lt,this.currentPath$.pipe(Vt(r=>!!r),Qt(1),Ut(r=>this.api5Service.favoritePaths(r)),ct()).subscribe(r=>{let m=r.elem?.map(o=>o.path?.$).filter(Boolean)||[];this.paths$.next(m)})}handleToggleClick(e){if(this.lockToggle$.value)return;let t=e||this.currentPath$.value,i=this.paths$.value,r=i.includes(t),m;r?(this.paths$.next(i.filter(d=>d!==t)),m=this.api5Service.favoritePaths(t,!1)):(this.paths$.next([...i,t]),m=this.api5Service.favoritePaths(t,!0));let o=d=>{this.lockToggle$.next(!1),d.error&&(this.paths$.next(i),this.notificationService.showError$(d.error.msg?.$))},u=()=>this.lockToggle$.next(!1);this.lockToggle$.next(!0),m.subscribe({next:o,error:u})}};n.\u0275fac=function(t){return new(t||n)(tt(An),tt(On),tt($t))},n.\u0275cmp=ut({type:n,selectors:[["isp-favorite-paths"]],inputs:{currentPath:"currentPath"},outputs:{navigate:"navigate"},decls:6,vars:9,consts:[["anchor",""],["ispTooltipPosition","top-start","ispTooltipShowDelay","1000",1,"favorite-paths__button",3,"click","ispTooltip"],[3,"name"],[4,"ngIf"],[1,"favorite-paths__divider"],[1,"favorite-paths__button"],["name","arrow_down_s"],["trigger","click","popupClasses","isp-favorite-paths-popup",3,"anchor","anchorOffset","destroyTrigger"],[1,"favorite-paths__list","ispui-scrollbar_gray"],["class","favorite-paths__list-item",3,"title","click",4,"ngFor","ngForOf"],[1,"favorite-paths__list-item",3,"click","title"],[1,"favorite-paths__list-item-icon-container",3,"click"],["name","favorites-folder-crossed-out"]],template:function(t,i){t&1&&(Ae(0,"div",1),Ne(1,"async"),Ge("click",function(){return i.handleToggleClick()}),Ke(2,"isp-svg-icon",2),Ne(3,"async"),Te(),je(4,Pc,10,8,"ng-container",3),Ne(5,"async")),t&2&&(ge("ispTooltip",Be(1,3,i.iconHint$)),Ce(2),ge("name",Be(3,5,i.iconName$)),Ce(2),ge("ngIf",Be(5,7,i.pathsUI$).length>0))},dependencies:[ni,Wt,Jt,St,Yt,xt],styles:["[_nghost-%COMP%]{display:flex;align-items:center;background:var(--isp-dc-norilsk);border-radius:5px}.favorite-paths__button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:35px;height:25px;background:var(--isp-dc-norilsk);border-radius:5px;cursor:pointer}.favorite-paths__button[_ngcontent-%COMP%]:hover{background:var(--isp-dc-reincarnation)}.favorite-paths__button[_ngcontent-%COMP%]:active{background:var(--isp-dc-charlie-chaplin)}.favorite-paths__divider[_ngcontent-%COMP%]{width:1px;height:15px;background:var(--isp-dc-charlie-chaplin)}.favorite-paths__list[_ngcontent-%COMP%]{max-height:240px;overflow-y:auto}.favorite-paths__list-item[_ngcontent-%COMP%]{position:relative;height:30px;padding-right:40px;padding-left:15px;overflow:hidden;line-height:30px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.favorite-paths__list-item[_ngcontent-%COMP%]:hover{background:var(--isp-dc-cult)}.favorite-paths__list-item-icon-container[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-c-grey-weekdays);position:absolute;top:5px;right:13px;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;cursor:pointer}.favorite-paths__list-item-icon-container[_ngcontent-%COMP%]:hover{--isp-icons-main-color: var(--isp-dc-highway-star)}"],changeDetection:0});let h=n;return h})();var Pa=(()=>{let n=class n{transform(e){return e?"page":null}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=li({name:"isCurrentPage",type:n,pure:!0});let h=n;return h})();var Mc=["shadow"],kc=()=>[],Lc=(h,n)=>({spreadLinks:h,collapsedLinks:n,isShadow:!0}),Ic=(h,n)=>({spreadLinks:h,collapsedLinks:n});function Oc(h,n){if(h&1){let _=it();Ae(0,"div",19),Ge("click",function(t){let i=Re(_).$implicit,r=pe(4);return De(r.navigate(i,t))}),_t(1),Te()}if(h&2){let _=n.$implicit;Ce(),jt(" ",_.$name," ")}}function Fc(h,n){if(h&1&&(Mt(0),Ae(1,"div",14,3),Ke(3,"isp-svg-icon",15),Te(),Ae(4,"isp-dropdown",16)(5,"div",17),je(6,Oc,2,1,"div",18),Te()(),kt()),h&2){let _=Ct(2),e=pe(2).collapsedLinks;Ce(4),ge("anchor",_)("anchorOffset",5)("hideOnPopupClick",!0),Ce(2),ge("ngForOf",e)}}function Rc(h,n){if(h&1&&je(0,Fc,7,4,"ng-container",13),h&2){let _=pe().collapsedLinks;ge("ngIf",_.length)}}function Dc(h,n){h&1&&Ke(0,"div",14)}function Nc(h,n){if(h&1){let _=it();Ae(0,"a",20),Ne(1,"isCurrentPage"),Ge("click",function(t){let i=Re(_).$implicit,r=pe(2);return De(r.navigate(i,t))}),_t(2),Te()}if(h&2){let _=n.$implicit,e=n.last;ki("aria-current",Be(1,2,e)),Ce(2),zt(_.$name)}}function Bc(h,n){if(h&1){let _=it();Ae(0,"div",21),Ge("click",function(){Re(_);let t=pe(2);return De(t.edit.emit())}),Ke(1,"isp-svg-icon",22),Te()}if(h&2){let _=pe(2);ge("ispTooltip",_.editPathMessage)}}function $c(h,n){if(h&1){let _=it();Ae(0,"isp-favorite-paths",23),Ge("navigate",function(t){Re(_);let i=pe(2);return De(i.favoritePathNavigate.emit(t))}),Te()}if(h&2){let _=pe(2);ge("currentPath",_.path)}}function Vc(h,n){if(h&1&&(Ae(0,"nav",6),je(1,Rc,1,1,"ng-template",null,2,Ht)(3,Dc,1,0,"div",7)(4,Nc,3,4,"a",8),Te(),Ae(5,"isp-clipboard-pin",9),Ke(6,"isp-svg-icon",10),Te(),je(7,Bc,2,1,"div",11)(8,$c,1,1,"isp-favorite-paths",12)),h&2){let _=n.spreadLinks,e=n.isShadow,t=Ct(2),i=pe();Ce(3),ge("ngIf",e)("ngIfElse",t),Ce(),ge("ngForOf",_),Ce(),ge("text",i.path)("report",i.copiedMessage)("ispTooltip",i.copyPathMessage),Ce(2),ge("ngIf",i.editable),Ce(),ge("ngIf",i.showFavorite)}}var Ea=(()=>{let n=class n{constructor(){this.crumbs$=new st([]),this.editable=!0,this.showFavorite=!1,this.spreadCrumbs$=new st([]),this.collapsedCrumbs$=new st([]),this.observer=new ResizeObserver(()=>setTimeout(()=>this.updateCrumbGroups())),this.navigation=new lt,this.edit=new lt,this.favoritePathNavigate=new lt}set data(e){this.crumbs$.next(e),setTimeout(()=>this.updateCrumbGroups())}get path(){return this.crumbs$.value.map(e=>e.$name).join("")}navigate(e,t){t.preventDefault(),this.navigation.emit(e)}updateCrumbGroups(){let e=this.shadow.nativeElement?.children[0];if(!e||this.crumbs$.value.length<2){this.spreadCrumbs$.next(this.crumbs$.value),this.collapsedCrumbs$.next([]);return}let t=e.offsetWidth,i=e.children[1].getBoundingClientRect().left-e.children[0].getBoundingClientRect().left,r=e.children[e.children.length-1].getBoundingClientRect().right,m=Array.from(e.children).slice(1).findIndex((o,u)=>{let v=r-o.getBoundingClientRect().left+(u?i:0);return t>=v});this.spreadCrumbs$.next(this.crumbs$.value.slice(m)),this.collapsedCrumbs$.next(this.crumbs$.value.slice(0,m))}ngAfterViewInit(){this.observer.observe(this.shadow.nativeElement),setTimeout(()=>this.updateCrumbGroups(),500)}ngOnDestroy(){this.observer.disconnect()}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ut({type:n,selectors:[["isp-breadcrumbs"]],viewQuery:function(t,i){if(t&1&&Dt(Mc,5),t&2){let r;It(r=Ot())&&(i.shadow=r.first)}},inputs:{data:"data",editable:"editable",showFavorite:"showFavorite",copiedMessage:"copiedMessage",copyPathMessage:"copyPathMessage",editPathMessage:"editPathMessage"},outputs:{navigation:"navigation",edit:"edit",favoritePathNavigate:"favoritePathNavigate"},decls:9,vars:17,consts:[["content",""],["shadow",""],["dropdown",""],["anchor",""],[1,"breadcrumbs__shadow"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-label","Breadcrumb",1,"breadcrumbs__navbar"],["class","breadcrumbs__more",4,"ngIf","ngIfElse"],["class","breadcrumbs__link","href","#",3,"click",4,"ngFor","ngForOf"],["reportPlacement","right","ispTooltipPosition","top-start","ispTooltipShowDelay","1000",1,"breadcrumbs__button",3,"text","report","ispTooltip"],["name","copy_fm",1,"breadcrumbs__button-icon"],["class","breadcrumbs__button","ispTooltipPosition","top-start","ispTooltipShowDelay","1000",3,"ispTooltip","click",4,"ngIf"],["class","breadcrumbs__fav-paths",3,"currentPath","navigate",4,"ngIf"],[4,"ngIf"],[1,"breadcrumbs__more"],["name","arrow-double-left_s"],["popupClasses","isp-breadcrumbs-collapsed-popup",3,"anchor","anchorOffset","hideOnPopupClick"],[1,"breadcrumbs__collapsed-list","ispui-scrollbar_gray"],["class","breadcrumbs__collapsed-item",3,"click",4,"ngFor","ngForOf"],[1,"breadcrumbs__collapsed-item",3,"click"],["href","#",1,"breadcrumbs__link",3,"click"],["ispTooltipPosition","top-start","ispTooltipShowDelay","1000",1,"breadcrumbs__button",3,"click","ispTooltip"],["name","pencil_s",1,"breadcrumbs__button-icon"],[1,"breadcrumbs__fav-paths",3,"navigate","currentPath"]],template:function(t,i){if(t&1&&(je(0,Vc,9,8,"ng-template",null,0,Ht),Ae(2,"div",4,1),Li(4,5),Ne(5,"async"),Te(),Li(6,5),Ne(7,"async"),Ne(8,"async")),t&2){let r=Ct(1);Ce(4),ge("ngTemplateOutlet",r)("ngTemplateOutletContext",ms(11,Lc,Be(5,4,i.crumbs$),wt(10,kc))),Ce(2),ge("ngTemplateOutlet",r)("ngTemplateOutletContext",ms(14,Ic,Be(7,6,i.spreadCrumbs$),Be(8,8,i.collapsedCrumbs$)))}},dependencies:[ni,Wt,Jt,St,xn,Ho,Yt,Aa,xt,Pa],styles:["[_nghost-%COMP%]{position:relative;display:flex;white-space:nowrap}.breadcrumbs__navbar[_ngcontent-%COMP%]{position:relative;display:inline-flex;max-width:100%;padding:0;margin:0;overflow:hidden;list-style:none}.breadcrumbs__more[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-text-color-main);display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:35px;height:25px;margin-right:5px;overflow:hidden;background:var(--isp-dc-norilsk);border-radius:5px;cursor:pointer}.breadcrumbs__more[_ngcontent-%COMP%]:hover{background:var(--isp-dc-reincarnation)}.breadcrumbs__more[_ngcontent-%COMP%]:active{background:var(--isp-dc-charlie-chaplin)}.breadcrumbs__link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;height:25px;padding:0 10px;margin-right:5px;color:var(--isp-text-color-main);text-decoration:none;background:var(--isp-dc-norilsk);border-radius:5px;cursor:pointer}.breadcrumbs__link[_ngcontent-%COMP%]:hover{background:var(--isp-dc-reincarnation)}.breadcrumbs__link[_ngcontent-%COMP%]:active{background:var(--isp-dc-charlie-chaplin)}.breadcrumbs__link[_ngcontent-%COMP%]:last-of-type{margin-right:0}.breadcrumbs__button[_ngcontent-%COMP%]{margin-left:5px;cursor:pointer}.breadcrumbs__button-icon[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-text-color-main);--isp-icons-fill-color: transparent;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:35px;height:25px;background:var(--isp-dc-norilsk);border-radius:5px;cursor:pointer}.breadcrumbs__button-icon[_ngcontent-%COMP%]:hover{background:var(--isp-dc-reincarnation)}.breadcrumbs__button-icon[_ngcontent-%COMP%]:active{background:var(--isp-dc-charlie-chaplin)}.breadcrumbs__fav-paths[_ngcontent-%COMP%]{margin-left:5px}.breadcrumbs__shadow[_ngcontent-%COMP%]{position:absolute;top:0;left:0;display:flex;width:100%;height:0;overflow:hidden}.breadcrumbs__shadow[_ngcontent-%COMP%] .breadcrumbs__navbar[_ngcontent-%COMP%]{flex-grow:1}.breadcrumbs__collapsed-list[_ngcontent-%COMP%]{max-height:240px;overflow-y:auto}.breadcrumbs__collapsed-item[_ngcontent-%COMP%]{height:30px;padding:0 15px;overflow:hidden;line-height:30px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.breadcrumbs__collapsed-item[_ngcontent-%COMP%]:hover{background:var(--isp-dc-cult)}"],changeDetection:0});let h=n;return h})();var Wc=()=>({width:"60px",height:"60px"}),Uc=()=>({width:"15px",height:"15px"});function Hc(h,n){if(h&1&&(Ke(0,"div",6),Ne(1,"async"),Ne(2,"async"),Ne(3,"async"),Ne(4,"async")),h&2){let _,e,t,i,r=pe();ti("top",((_=Be(1,8,r.draggedOverSubTarget$))==null?null:_.rect.top)+"px")("left",((e=Be(2,10,r.draggedOverSubTarget$))==null?null:e.rect.left)+"px")("height",((t=Be(3,12,r.draggedOverSubTarget$))==null?null:t.rect.height)+"px")("width",((i=Be(4,14,r.draggedOverSubTarget$))==null?null:i.rect.width)+"px")}}var ka=(()=>{let n=class n{constructor(e,t,i,r,m){this.elRef=e,this.appService=t,this.tabService=i,this.fileUploadService=r,this.destroyRef=m,this.filesDropped=new lt,this.draggedOver$=new mn(o=>{let u=0;this.dragOverElement.nativeElement.addEventListener("dragenter",d=>{if([...d.dataTransfer.types].some(v=>v!=="Files"&&v!=="application/x-moz-file")){d.stopPropagation(),d.preventDefault();return}u||o.next(!0),u++}),this.dragOverElement.nativeElement.addEventListener("dragleave",d=>{if([...d.dataTransfer.types].some(v=>v!=="Files"&&v!=="application/x-moz-file")){d.stopPropagation(),d.preventDefault();return}u===1&&o.next(!1),u--}),this.dropped.pipe(ct(this.destroyRef)).subscribe(()=>{u=0,o.next(!1)})}).pipe(ct(this.destroyRef)),this.draggedOverSubTarget$=new mn(o=>{let u=null;this.dragOverElement.nativeElement.addEventListener("dragover",d=>{if([...d.dataTransfer.types].some(M=>M!=="Files"&&M!=="application/x-moz-file")){d.stopPropagation(),d.preventDefault(),o.next(null);return}let v=this.elRef.nativeElement.parentElement.getBoundingClientRect(),T=null,A=null;if(this.subTargets?.forEach(M=>{let F=M.row.getBoundingClientRect();d.clientY>=F.top&&d.clientY<F.top+F.height&&d.clientX>=F.left&&d.clientX<F.left+F.width&&d.clientY>=v.top+this.topOffset&&d.clientY<v.top+v.height-this.bottomOffset&&d.clientX>=v.left&&d.clientX<v.left+v.width&&(A=F,T=M)}),T!==u)if(u=T,u){let M;A.top-v.top<this.topOffset?M=A.height-this.topOffset+(A.top-v.top):A.top-v.top+A.height>v.height-this.bottomOffset?M=v.height-this.bottomOffset-(A.top-v.top):M=A.height,o.next({subTarget:u.row,rect:DOMRect.fromRect({height:M,width:A.width,y:Math.max(A.top-v.top,this.topOffset),x:A.left-v.left}),folderName:u.folderName})}else o.next(null)})}).pipe($r(null),ct(this.destroyRef)),this.dropped$=new mn(o=>{this.dragOverElement.nativeElement.addEventListener("drop",u=>{u.stopPropagation(),u.preventDefault(),![...u.dataTransfer.types].some(d=>d!=="Files"&&d!=="application/x-moz-file")&&(this.dropped.next(),o.next([...u.dataTransfer.items]))},!1)}).pipe(Ei(this.draggedOverSubTarget$),Je(([o,u])=>({fileSubtree:o,folderName:u?.folderName})),ct(this.destroyRef)),this.topOffset=35,this.bottomOffset=32,this.dropped=new Mi}ngOnInit(){this.elRef.nativeElement.style.setProperty("--dragdrop-target_top-offset",`${this.topOffset}px`),this.elRef.nativeElement.style.setProperty("--dragdrop-target_bottom-offset",`${this.bottomOffset}px`),this.dragOverElement.nativeElement.addEventListener("dragover",e=>e.preventDefault()),this.dropped$.pipe(ct(this.destroyRef)).subscribe(e=>{this.emitDropped(e)}),this.draggedOver$.pipe(ct(this.destroyRef)).subscribe(e=>{e?this.elRef.nativeElement.classList.add("dragdrop-target_dragged-over"):this.elRef.nativeElement.classList.remove("dragdrop-target_dragged-over")}),this.draggedOverSubTarget$.pipe(ct(this.destroyRef)).subscribe(e=>{e?this.elRef.nativeElement.classList.add("dragdrop-target_subtarget-highlighted"):this.elRef.nativeElement.classList.remove("dragdrop-target_subtarget-highlighted")})}getMessage(e){return this.appService.getDesktopMessage(e)}emitDropped(e){return Ue(this,null,function*(){let{fileSubtree:t,folderName:i}=e,r=(this.tabService.activeTab.plid+(this.tabService.activeTab.plid==="/"?"":"/")+(i||"")).replace(/\/+/g,"/").replace(/\/+$/,"")||"/",m=!1,o=()=>{m=!0},u=new st({percent:0,size:null,phase:"check",confirmationActions:null,uploadName:this.appService.getDesktopMessage("msg_checking_files"),uploadType:"group",cancelHandler:o});this.fileUploadService.uploads$.next({path:r,state:u});let d=t.map(T=>T.webkitGetAsEntry()).filter(T=>T);if(!d.length){this.dropped.next();return}let v=yield Lo(d);m||this.filesDropped.emit({fileSubtree:v,folderName:r,uploadSubject:u})})}};n.\u0275fac=function(t){return new(t||n)(tt(ci),tt(Di),tt($i),tt(Dn),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-dragdrop-target"]],inputs:{dragOverElement:"dragOverElement",subTargets:"subTargets",folderName:"folderName"},outputs:{filesDropped:"filesDropped"},decls:11,vars:13,consts:[[1,"dragdrop-target__card"],[1,"dragdrop-target__upload-icon"],["name","upload_xl",3,"inSprite","customStyle"],[1,"dragdrop-target__folder-name"],["name","p-bplocal",3,"inSprite","customStyle"],["class","dragdrop-target__subtarget-highlighter",3,"top","left","height","width",4,"ngIf"],[1,"dragdrop-target__subtarget-highlighter"]],template:function(t,i){if(t&1&&(Ae(0,"div",0)(1,"div",1),Ke(2,"isp-icon-provider",2),Te(),Ae(3,"h2"),_t(4),Te(),Ae(5,"span",3),Ke(6,"isp-icon-provider",4),_t(7),Ne(8,"async"),Te()(),je(9,Hc,5,16,"div",5),Ne(10,"async")),t&2){let r;Ce(2),ge("inSprite",!0)("customStyle",wt(11,Wc)),Ce(2),zt(i.getMessage("msg_upload_to_folder")),Ce(2),ge("inSprite",!0)("customStyle",wt(12,Uc)),Ce(),jt(" ",((r=Be(8,7,i.draggedOverSubTarget$))==null?null:r.folderName)||i.folderName," "),Ce(2),ge("ngIf",Be(10,9,i.draggedOverSubTarget$))}},dependencies:[St,zi,xt],styles:["[_nghost-%COMP%]{position:absolute;top:var(--dragdrop-target_top-offset);bottom:var(--dragdrop-target_bottom-offset);left:0;z-index:var(--isp-list-dragdrop-target-z-index);display:none;flex-direction:column;align-items:center;justify-content:flex-end;width:100%;background:var(--isp-c-air);border:var(--isp-c-blue-velvet) 1px solid}.dragdrop-target_dragged-over[_nghost-%COMP%]{display:flex}.dragdrop-target_dragged-over.dragdrop-target_subtarget-highlighted[_nghost-%COMP%]{bottom:calc(var(--dragdrop-target_bottom-offset) + 1px);background:none;border:none}.dragdrop-target_subtarget-highlighted[_nghost-%COMP%] .dragdrop-target__bg[_ngcontent-%COMP%]{display:none}.dragdrop-target__card[_ngcontent-%COMP%]{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;width:330px;padding:20px;margin-bottom:-22px;background:var(--isp-dc-cow);border:var(--isp-dc-charlie-chaplin) 1px solid;border-radius:5px;box-shadow:0 1px 4px #0000004d}.dragdrop-target__card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:18px}.dragdrop-target__upload-icon[_ngcontent-%COMP%]{width:60px;height:60px;margin-bottom:10px}.dragdrop-target__folder-name[_ngcontent-%COMP%]{display:flex;gap:5px;align-items:flex-start;margin-top:10px}.dragdrop-target__subtarget-highlighter[_ngcontent-%COMP%]{position:absolute;margin-top:-35px;background:var(--isp-c-air);border:var(--isp-c-blue-velvet) 1px solid;pointer-events:none}"],changeDetection:0});let h=n;return h})();var La=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,wi]});let h=n;return h})();var pi=(()=>{let n=class n{get filterDoc(){return this.filterDocSubject.value}constructor(e,t,i){this.preloadedActionService=e,this.listService=t,this.tabService=i,this.filterFuncSubject=new st(null),this.filterFunc$=this.filterFuncSubject.pipe(Vt(r=>!!r),Zt()),this.filterDocSubject=new st(null),this.isLoadingSubject=new st(!1),this.filterIsActive$=this.listService.doc$.pipe(Je(r=>nt.isFilterActive(r))),this.filterDoc$=this.filterDocSubject.asObservable(),this.initModel$=this.listService.filterModelSubject.asObservable(),this.isLoading$=this.isLoadingSubject.asObservable(),this.isUpdating$=new st(!1),this.filterButton$=this.listService.doc$.pipe(Je(r=>r?.metadata?.toolbar?.toolgrp?.reduce((m,o)=>[...m,...o.toolbtn||[]],[])?.find(m=>m.$name==="filter"))),this.listService.tab$.pipe(mt(()=>this.isLoadingSubject.next(!0)),Ut(r=>r.doc$),ri(10),Ut(()=>this.getFilter$()),mt(()=>this.isUpdating$.next(!1)),mt(()=>this.isLoadingSubject.next(!1)),ct()).subscribe()}getFilter(e){return this.listService.tab$.pipe(Qt(1),Ut(t=>this.preloadedActionService.getAction(ft({func:e},t?.q?.filter?t.q:{}),{showProgressbar:!1,hideProgressbar:!0})),mt(()=>this.listService.filterModelSubject.next({})),mt(t=>this.filterDocSubject.next(t)))}updateFilter(e,t){this.isUpdating$.next(!0);let i=At(ft({func:e},t),{sok:"ok"});return this.preloadedActionService.postAction(i,{hideProgressbar:!1}).pipe(Ut(()=>(delete this.listService.tab.q?.filter,this.tabService.updateFromServer(this.listService.tab,{hideProgressbar:!1}))))}removeFilter(e,t){let i={func:e,faction:"drop_value",fname:t};return this.preloadedActionService.postAction(i,{hideProgressbar:!1})}ngOnDestroy(){this.filterFuncSubject.complete(),this.filterDocSubject.complete()}getFilter$(){return this.filterFunc$.pipe(Qt(1),Ut(e=>this.getFilter(e)))}applyFilter$(e){return this.filterFunc$.pipe(Qt(1),Ut(t=>this.updateFilter(t,e)))}removeFilter$(e){return this.listService.tab$.pipe(Qt(1),Ei(this.filterFunc$),Ut(([t,i])=>t.q.filter==="on"?(delete t.q.filter,this.tabService.update(t),t.doc$.pipe(Qt(1))):this.removeFilter(i,e)))}resetFilter$(){return this.filterFunc$.pipe(Qt(1),Ut(e=>this.updateFilter(e,{drop:"on"})))}setFilterFunc(e){this.filterFuncSubject.next(e)}getLabel(e){return nt.getMessage(e,this.filterDocSubject.value)}reset(){this.filterDocSubject.next(nt.resetFilter(this.filterDocSubject.value))}};n.\u0275fac=function(t){return new(t||n)(pt(yi),pt($t),pt($i))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var Ai=(()=>{let n=class n{constructor(e){this.filterService=e,this.filterDoc=vo(this.filterService.filterDoc$,{initialValue:null}),this.applyMessage=Ri(()=>nt.getMessage("filterfind",this.filterDoc()))}setDropdownComponent(e){this.dropdownComponent=e}openDropdown(e,t){this.dropdownComponent&&this.dropdownComponent.openFilter(e,t)}closeDropdown(){this.dropdownComponent&&this.dropdownComponent.reset()}getField(e){let t=this.filterDoc(),i=t.metadata.form.field.find(o=>o.$name===e);if(!i)return null;let r=i.input?"input":"select",m={type:r,name:e,label:nt.getMessage(e,t),value:nt.getValue(e,t)};if(r==="select"){let o=nt.getSelectValue(e,t),u=i.select[0].$type===oo.Multiple;m.isMultiple=u,u?m.value=Array.isArray(o)?o:[o]:m.value=o;let d=t.slist.find(v=>v.$name===e).val;m.options=d.map(v=>({text:v.$,value:v.$key}))}return m}applyFilter$(e,t){return this.filterService.applyFilter$({[e]:t})}};n.\u0275fac=function(t){return new(t||n)(pt(pi))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var Xc=h=>({"dragon-filter-wrapper_empty":h}),Ia=h=>({filter:h});function qc(h,n){if(h&1&&Li(0,7),h&2){let _=n.$implicit;pe(2);let e=Ct(3);ge("ngTemplateOutlet",e)("ngTemplateOutletContext",Kt(2,Ia,_))}}function Kc(h,n){if(h&1&&Li(0,7),h&2){let _=n.ngIf;pe(2);let e=Ct(3);ge("ngTemplateOutlet",e)("ngTemplateOutletContext",Kt(2,Ia,_))}}function Yc(h,n){if(h&1){let _=it();Ae(0,"button",8),Ge("click",function(){Re(_);let t=pe(2);return De(t.resetFilter())}),Ke(1,"isp-icon-provider",9),Te()}if(h&2){let _=pe(2);ge("ispTooltip",_.hintRemove()),ki("aria-label",_.hintRemove()),Ce(),ge("inSprite",!0)}}function Qc(h,n){if(h&1&&(Ae(0,"div",2),je(1,qc,1,4,"ng-container",3),Ne(2,"async"),Ae(3,"div",4),je(4,Kc,1,4,"ng-container",5),Ne(5,"async"),je(6,Yc,2,3,"button",6),Te()()),h&2){let _=n.ngIf,e=pe();ge("ngClass",Kt(8,Xc,_.length===0)),Ce(),ge("ngForOf",Be(2,4,e.dragonFiltersInit$)),Ce(3),ge("ngIf",Be(5,6,e.dragonFiltersLast$)),Ce(2),ge("ngIf",_.length>0)}}function Zc(h,n){if(h&1){let _=it();Ae(0,"button",10),Ge("click",function(t){let i=Re(_).filter,r=pe();return De(r.openFilter(i,t))}),Ae(1,"span",11),_t(2),Te(),Ae(3,"span",12),_t(4),Te(),Ae(5,"span",13),_t(6),Te(),Ae(7,"button",14),Ge("click",function(t){let i=Re(_).filter,r=pe();return De(r.removeFilter(i.$name,t))}),Ke(8,"isp-icon-provider",15),Te()()}if(h&2){let _=n.filter;Ce(2),zt(_.title),Ce(2),zt(_.delimiter),Ce(2),zt(_.value),Ce(2),ge("inSprite",!0)}}var Oa=(()=>{let n=class n{constructor(e,t,i){this.listService=e,this.filterService=t,this.columnFilterService=i,this.rawDragonFilters$=this.listService.doc$.pipe(Je(r=>{let m=r.p_dragon_filter?.filter;return m?Array.isArray(m)?m:[m]:[]})),this.dragonFiltersFull$=Ft([this.rawDragonFilters$,this.filterService.filterDoc$,this.filterService.isLoading$]).pipe(Zt(([r,m],[o,u,d])=>lo(o.map(v=>v.$name),r.map(v=>v.$name))&&m?.$func===u?.$func&&d),Je(([r,m,o])=>!r||!m||o?[]:r.map(u=>{let d=m.slist?.find(v=>v.$name===u.$name)?.val.find(v=>v.$key===u.$)?.$||nt.getMessage(u.$,m)||u.$;return At(ft({},u),{delimiter:nt.getMessage(`filter_delimiter_${u.$delimiter}`,m)||u.$delimiter,title:nt.getMessage(u.$name,m)||u.$name,value:Array.isArray(d)?d[0]:d})}))),this.dragonFiltersInit$=this.dragonFiltersFull$.pipe(Je(r=>ho(r))),this.dragonFiltersLast$=this.dragonFiltersFull$.pipe(Je(r=>co(r)))}hintRemove(){return nt.getMessage("filterremove",this.filterService.filterDoc)}openFilter(e,t){t.preventDefault(),t.stopPropagation(),this.columnFilterService.openDropdown(e.$name,t.target.closest(".dragon-filter")||t.target)}removeFilter(e,t){t.stopPropagation(),this.filterService.removeFilter$(e).subscribe(()=>{this.columnFilterService.closeDropdown(),this.listService.reloadTab()})}resetFilter(){this.columnFilterService.closeDropdown(),this.filterService.resetFilter$().subscribe()}};n.\u0275fac=function(t){return new(t||n)(tt($t),tt(pi),tt(Ai))},n.\u0275cmp=ut({type:n,selectors:[["isp-dragon-filter"]],decls:4,vars:3,consts:[["filterButton",""],["class","dragon-filter-wrapper",3,"ngClass",4,"ngIf"],[1,"dragon-filter-wrapper",3,"ngClass"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngFor","ngForOf"],[1,"dragon-filter-sub-wrapper"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],["class","dragon-filter","type","button","ispTooltipPosition","top-start",3,"ispTooltip","click",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["type","button","ispTooltipPosition","top-start",1,"dragon-filter",3,"click","ispTooltip"],["name","p-delete",1,"dragon-filter__close-icon",3,"inSprite"],["type","button",1,"dragon-filter",3,"click"],[1,"dragon-filter__title"],[1,"dragon-filter__delimiter"],[1,"dragon-filter__value"],["type","button",1,"dragon-filter__close-button",3,"click"],["name","close_s",1,"dragon-filter__close-icon",3,"inSprite"]],template:function(t,i){t&1&&(je(0,Qc,7,10,"div",1),Ne(1,"async"),je(2,Zc,9,4,"ng-template",null,0,Ht)),t&2&&ge("ngIf",Be(1,1,i.dragonFiltersFull$))},dependencies:[Cn,Jt,St,xn,ni,zi,xt],styles:[".dragon-filter-wrapper[_ngcontent-%COMP%]{display:flex;flex-flow:row wrap;gap:10px;max-width:100%;margin-bottom:10px}.dragon-filter-wrapper_empty[_ngcontent-%COMP%]{margin-bottom:0}.dragon-filter-sub-wrapper[_ngcontent-%COMP%]{display:flex;gap:10px}.dragon-filter[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-c-grey-weekdays);display:flex;gap:5px;align-items:center;max-width:100%;height:25px;padding:0 10px;margin:0;font-family:inherit;color:var(--isp-dc-fremen);background-color:var(--isp-dc-made-in-heaven);border:none;border-radius:5px;cursor:pointer;transition:background-color .1s ease-in-out}.dragon-filter[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-mass-relay)}.dragon-filter__delimiter[_ngcontent-%COMP%]{color:var(--isp-c-grey-weekdays)}.dragon-filter__value[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dragon-filter__close-button[_ngcontent-%COMP%]{display:flex;place-content:center;padding:3px;margin:0;background:none;border:none;border-radius:50%;cursor:pointer}.dragon-filter__close-button[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-glass)}.dragon-filter__close-icon[_ngcontent-%COMP%], .dragon-filter__tooltip[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let h=n;return h})();var Fa=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,ui,wi]});let h=n;return h})();function Ra(){window.getSelection&&window.getSelection().removeAllRanges()}function th(h,n){if(h&1){let _=it();Ae(0,"isp-field",2)(1,"isp-prefix"),Ke(2,"isp-svg-icon",6),Te(),Ae(3,"input",7),Fi("ngModelChange",function(t){Re(_);let i=pe(2);return Oi(i.value,t)||(i.value=t),De(t)}),Ge("keypress.enter",function(){Re(_);let t=pe(2);return De(t.submit())}),Te()()}if(h&2){let _=pe(2);ge("autofocus",!0),Ce(3),ge("name",_.fieldName()),Ii("ngModel",_.value)}}function ih(h,n){if(h&1){let _=it();Ae(0,"label",8)(1,"input",9),Fi("ngModelChange",function(t){Re(_);let i=pe(3);return Oi(i.value,t)||(i.value=t),De(t)}),Te(),_t(2),Te()}if(h&2){let _=n.$implicit,e=pe(3);Ce(),ge("name",e.fieldName())("value",_.value),Ii("ngModel",e.value),Ce(),jt(" ",_.text," ")}}function nh(h,n){if(h&1&&(Ae(0,"div",3),qr(1,ih,3,4,"label",8,Xr),Te()),h&2){let _=pe(2);Ce(),Kr(_.selectOptions())}}function sh(h,n){if(h&1){let _=it();Ae(0,"isp-dropdown",1),Ge("update",function(t){Re(_);let i=pe();return De(i.onDropdownUpdate(t))}),je(1,th,4,3,"isp-field",2)(2,nh,3,0,"div",3),Ae(3,"div",4)(4,"button",5),Ge("click",function(){Re(_);let t=pe();return De(t.submit())}),_t(5),Te()()()}if(h&2){let _,e=pe();ge("anchor",e.anchor)("initialOpen",!0)("strictDirection",!0),Ce(),Ti((_=e.fieldType())==="input"?1:_==="select"?2:-1),Ce(4),jt(" ",e.applyMessage()," ")}}var Bn=(()=>{let n=class n{constructor(e,t){this.columnFilterService=e,this.injector=t,this.anchor=null,this.isFilterOpen=_n(!1),this.field=_n(null),this.fieldType=Ri(()=>this.field().type),this.fieldName=Ri(()=>this.field().name),this.selectOptions=Ri(()=>this.field().options||[]),this.dropdownComponent=Hr(Yt),this.applyMessage=this.columnFilterService.applyMessage,this.value=_n(""),this.columnFilterService.setDropdownComponent(this)}applyFilter(){this.columnFilterService.applyFilter$(this.fieldName(),this.value()).subscribe(()=>{this.closePopup()})}reset(){this.anchor=null,this.field.set(null),this.value.set(null),this.isFilterOpen.set(!1)}openPopup(){this.isFilterOpen.set(!0)}closePopup(){this.dropdownComponent()?.hide()}openFilter(e,t){if(this.anchor===t){this.closePopup();return}if(this.anchor=t,this.isFilterOpen()){this.closePopup();let r=io(()=>{this.isFilterOpen()||(r.destroy(),setTimeout(()=>{this.openFilter(e,t)}))},{injector:this.injector,allowSignalWrites:!0});return}let i=this.columnFilterService.getField(e);this.field.set(i),this.value.set(i.value),this.openPopup()}submit(){this.applyFilter()}onDropdownUpdate(e){e==="close-end"&&this.reset()}};n.\u0275fac=function(t){return new(t||n)(tt(Ai),tt(jr))},n.\u0275cmp=ut({type:n,selectors:[["isp-column-filter-dropdown"]],viewQuery:function(t,i){t&1&&Qr(i.dropdownComponent,Yt,5),t&2&&Zr()},decls:1,vars:1,consts:[["direction","bottom","alignment","middle","trigger","click","anchorOffset","3","viewportSelector","#layout-main-page","scrollSelector","#layout-main-page","resizeSelector","#layout-main-page","popupClasses","isp-column-filter-popup",3,"anchor","initialOpen","strictDirection"],["direction","bottom","alignment","middle","trigger","click","anchorOffset","3","viewportSelector","#layout-main-page","scrollSelector","#layout-main-page","resizeSelector","#layout-main-page","popupClasses","isp-column-filter-popup",3,"update","anchor","initialOpen","strictDirection"],[1,"form__input",3,"autofocus"],[1,"form__select","ispui-scrollbar_gray"],[1,"form__button-wrapper"],["type","button",1,"form__button",3,"click"],["name","search"],["ispInput","",3,"ngModelChange","keypress.enter","name","ngModel"],[1,"form__select-option"],["type","radio",1,"form__select-input",3,"ngModelChange","name","value","ngModel"]],template:function(t,i){t&1&&je(0,sh,6,5,"isp-dropdown",0),t&2&&Ti(i.isFilterOpen()?0:-1)},dependencies:[po,_o,En,Tn,yo,wo,Co,Wt,Yt],styles:['.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:300px;padding:7px 0 5px}.form__input[_ngcontent-%COMP%]{--isp-field__min-width: 100%;--isp-field__background: var(--isp-dc-cow);padding:0 15px 15px;margin-top:8px}.form__select[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:240px;margin-bottom:7px;overflow-y:auto}.form__select-option[_ngcontent-%COMP%]{display:flex;flex-shrink:0;align-items:center;height:30px;padding:0 15px;cursor:pointer}.form__select-option[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-cult)}.form__select-input[_ngcontent-%COMP%]{display:flex;margin:0;appearance:none}.form__select-input[_ngcontent-%COMP%]:checked:before{display:inline-block;flex-shrink:0;content:"";width:5px;height:5px;margin-right:10px;background:var(--isp-dc-fremen);border-radius:50%}.form__button-wrapper[_ngcontent-%COMP%]{padding-top:7px;border-top:1px solid var(--isp-dc-charlie-chaplin)}.form__button[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:30px;padding:0 15px;font-family:inherit;font-size:14px;color:var(--isp-dc-fremen);background:none;border:none;cursor:pointer}.form__button[_ngcontent-%COMP%]:hover{color:var(--isp-dc-lapis-lazuli);background:var(--isp-dc-cult)}'],changeDetection:0});let h=n;return h})();var Da=ps(Cc());var ji=(()=>{let n=class n{constructor(e,t,i,r,m){this.listService=e,this.filterService=t,this.dateFnsService=i,this.rowSelectionService=r,this.destroyRef=m,this.searchDelay=200,this.searchCache={},this.columns$=Ft([this.listService.doc$,this.listService.columnList$,this.filterService.filterDoc$,this.filterService.isLoading$]).pipe(Je(([o,u,d,v])=>this.mapColumnListUi(o,u,d,v))),this.elementList$=Ft([this.columns$,this.listService.elementList$,this.listService.warnings$]).pipe(mt(()=>this.searchCache={}),Je(([o,u,d])=>this.getRowsFromElemsAndColumnsLists(u,o,d)),mt(o=>this.rowSelectionService.allRowsElids=o.map(u=>u.elid))),this.searchQuery$=this.listService.searchQuery$,this.rowButton$=this.listService.doc$.pipe(Je(o=>o.metadata?.rowbtn?At(ft({},o.metadata.rowbtn),{text:nt.getMessage(`short_${o.metadata.rowbtn.$name}`,o),isRowButton:!0}):null)),this.filterButton$=this.filterService.filterButton$,this.columnList$=this.columns$,this.doc$=this.listService.doc$,this.tab$=this.listService.tab$,this.searchedElementList$=Ft([this.elementList$,this.searchQuery$.pipe(ri(this.searchDelay))]).pipe(Je(([o,u])=>{let d;return u===""?d=o:this.searchCache[u]?d=this.searchCache[u]:(d=this.filterRowListBySearchQuery(u,o),this.searchCache[u]=d),d}),mt(o=>this.rowSelectionService.currentVisibleRowsElids=o.map(u=>u.elid))),this.elementStat$=this.searchedElementList$.pipe(Ei(this.listService.columnList$),Je(([o,u])=>({totalRows:{amount:o.length,localized:`${this.listService.getMessage("msg_total")}: ${o.length}`},columns:this.getColumnsStats(u,o)}))),this.selectionStat$=Ft([this.searchedElementList$,this.rowSelectionService.selectedElidsList$]).pipe(Je(([o,u])=>o.filter(d=>u.includes(d.elid))),Ei(this.listService.columnList$),Je(([o,u])=>({totalRows:{amount:o.length,localized:`${this.listService.getMessage("msg_selected")}: ${o.length}`},columns:this.getColumnsStats(u,o)}))),this.stat$=Ft([this.elementStat$,this.selectionStat$]).pipe(Je(([o,u])=>u.totalRows.amount>0?u:o)),this.rowList$=new st([]),this.pager$=this.listService.doc$.pipe(Je(o=>o?.page?.length>1?{pageSizeList:[10,20,30,50,100],currentPage:Number(o?.p_num?.$),elementsAmount:Number(o?.p_elems?.$),elementsPerPage:Number(o?.p_cnt?.$),msg:{perPage:this.listService.getMessage("pagerline"),of:this.listService.getMessage("pagerfrom")}}:null)),this.startRowList(),this.trackDoc()}trackDoc(){this.doc$.pipe(Zt((e,t)=>nt.compareLists(e,t)),ct(this.destroyRef)).subscribe(()=>{this.rowSelectionService.resetSelection()})}startRowList(){Ft([this.searchedElementList$,this.rowButton$]).pipe(Je(([e,t])=>{let i=[...e],r=i?.[0]?.isRowButton;return t&&!r&&i.unshift(t),!t&&r&&i.shift(),i}),mt(e=>this.rowList$.next(e)),ct(this.destroyRef)).subscribe()}getColumnsWithFilters(e,t){let i=e?.p_possible_filters?.filter,r=new Set(Array.isArray(i)?i.map(v=>v.$name):[i]),m=[],o=e?.p_dragon_filter?.filter;o&&(m=Array.isArray(o)?o:[o]);let u=new Set(m?.map(v=>v.$name));return t.map(v=>(v.hasFilterField=r.has(v.$name),v.isFilterApplied=u.has(v.$name),v))}mapColumnListUi(e,t,i,r){let m=this.getColumnsWithFilters(e,t);if(!i||r)return m;let o=i.metadata.form.field;return m.map(u=>(o.find(v=>v.$name===u.$name)?.select&&u.hasFilterField&&(u.isFastFilter=!0,u.isFastFilterBySelect=!0,u.fastFilterSelectValues=nt.getSelectValue(u.$name,i)),u.$fastfilter==="yes"&&(u.isFastFilter=!0),u))}getIndicatorPercent(e,t){let i=0;if(t.$type===di.Indicate){let r=Bt(e,`${t.$name}_used`)?.$,m=Bt(e,`${t.$name}_total`)?.$;i=Number(r)/Number(m)*100}return Math.min(i,100)}getCellValue(e,t){switch(t.$type){case di.Indicate:{let i=Bt(e,`${t.$name}_used`),r=Bt(e,`${t.$name}_total`);return{value:`${i?.$} / ${r?.$}`}}case di.Data:case di.Msg:{let i=Bt(e,t.$name);return t.$convert==="time"?{value:i?.$?this.dateFnsService.formatDuration(new Date(parseInt(i?.$)*1e3)):"-",origValue:i?.$orig}:{value:i?.$,origValue:i?.$orig}}case di.Toggle:return{value:Bt(e,t.toggle.$name)?.$};default:return{value:""}}}canShowTextData({$type:e}){return e===di.Data||e===di.Msg}getPropList(e,t,i){if(!t.prop)return[];let r=Bt(e,i)?.$;return t.prop.reduce((m,o)=>{if(!e[o.$name])return m;let u=Bt(e,o.$name)?.$,d=Bt(e,"featlist")?.$,v={icon:o.$img,name:o.$name,hint:vs({column:o.$name,value:u,msg:d,doc:this.listService.tab.doc}),elid:r,func:o.$func,type:o.$type,isDisabled:o.hide?aa(e,o.hide):!1,isInteractive:!!o.$func,isActiveHint:o.$activehint==="yes",canShowStat:o.$stat==="yes",inSprite:!!o.$spritesvg,isAnimated:!!o.$animated};return[...m,v]},[])}getTotalPropsAmounts({prop:e=[],xprop:t=[]}){return[...t,...e].filter(i=>i.$total!==void 0&&i.$total!=="0").map(i=>{let r=i.$value;return{icon:i.$img,name:i.$name,hint:vs({column:i.$name,value:r,doc:this.listService.tab.doc}),isDisabled:!0,isInteractive:!1,isActiveHint:!1,total:i.$total,inSprite:!!i.$spritesvg,isAnimated:!!i.$animated}}).sort(this.sortProps())}getColumnsStats(e,t){return t.length===this.listService.getElementsCount()?e.map(i=>({canShow:i.$stat==="yes",props:this.getTotalPropsAmounts(i),textUI:`${i.titleUi}: ${i.$total}`,total:i.$total})):e.map((i,r)=>this.getColumnStats(i,r,t))}getColumnStats(e,t,i){let r=i.reduce((m,o)=>{o.cells[t]?.propList.forEach(v=>{if(!v.canShowStat)return;let T=m.props.find(A=>A.icon===v.icon);T?T.total=Number(T.total)+1:m.props.push({name:v.name,icon:v.icon,hint:v.hint,total:1,isInteractive:!1,isActiveHint:!1,inSprite:v.inSprite,isAnimated:v.isAnimated})});let u=Number(o.cells[t]?.value),d=isNaN(u)?m.total:Number(m.total)+u;return{canShow:m.canShow,total:d,textUI:m.textUI,props:m.props}},{canShow:e.$stat==="yes",total:0,props:[],textUI:""});if(typeof r.total=="number"){let m=r.total.toFixed(2);r.textUI=`${e.titleUi}: ${m}`}else r.textUI=`${e.titleUi}: ${r.total}`;if(r.props=r.props.sort(this.sortProps()),e.$convert==="bytes"&&i.length>1){let m=i.reduce((o,u)=>o+Number(u.cells[t]?.origValue),0);r.textUI=`${e.titleUi}: ${ha(m)}`}else{let m=e.$type===di.Indicate?this.calculateIndicatorStats(t,i):this.calculateDataStats(t,i);m&&(r.textUI=`${e.titleUi}: ${m}`)}return r}calculateDataStats(e,t){let i=new Map;for(let r of t){let m=r.cells[e]?.value,o=m?.replace(/[0-9\s.,-]+/,""),u=m?.replace(o,"").replace(/\s/g,"");if(o)if(i.has(o)){let d=i.get(o),v=this.getDecimalPlaces(d),T=this.getDecimalPlaces(u),A=Math.max(v,T);i.set(o,(parseFloat(d)+parseFloat(u)).toFixed(A))}else i.set(o,u)}return Array.from(i.entries()).map(([r,m])=>`${m} ${r}`).join("; ")}calculateIndicatorStats(e,t){let i=0,r=0;for(let m of t){let o=m.cells[e].value,[u,d]=o.split(" / ");i+=parseFloat(u),r+=parseFloat(d)}return`${i} / ${r}`}getDecimalPlaces(e){let t=/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/.exec(e.toString());return t?Math.max(0,t[1]?t[1].length:0,-(t[2]?+t[2]:0)):0}sortProps(e=1){return(t,i)=>t.name>=i.name?1*e:-1*e}filterRowListBySearchQuery(e,t){let i=ta(e),r=new RegExp(i,"gi");return t.reduce((m,o)=>{let u=ia(r,o.cellsOriginal,v=>{let T=v.value||"";return v.wrap?(0,Da.stripHtml)(T).result:T});if(!u.length)return m;let d=o.cellsOriginal.map(v=>{let T=u.find(M=>M.name===v.name),A=ft({},v);if(T){if(v.noEscaping)A.value=A.value.replace(r,(M,F)=>la(A.value,F)?M:`<mark class="table__highlight">${M}</mark>`);else{let M=A.value.split(r),F=[],S=A.value;M.forEach(b=>{S=S.slice(b.length);let N=new RegExp(`^${i}`,"i").exec(S)?.[0]||"";S=S.slice(N.length),F.push(N)}),A.value=M.reduce((b,N,L)=>{let g=N.replaceAll("<","<"),p=`<mark class="table__highlight">${(F[L]||"").replaceAll("<","<")}</mark>`;return`${b}${g}${p}`},""),A.noEscaping=!0}A.wrap=!0}return A});return[...m,At(ft({},o),{cells:d})]},[])}getElidKey(){return this.listService.getElidKey()}getCellsListAndRowCacheKey(e,t){let i=this.listService.doc,r=nt.getElidColumn(i),m=this.makeRowCacheKey(e);return{cellList:t.map(u=>{let d=[...ca(e,u,i),...this.getPropList(e,u,r)],v=this.getCellValue(e,u),T={value:v.value,origValue:v.origValue,name:u.$name,indicatorPercent:this.getIndicatorPercent(e,u),type:u.$type,canShowProps:!!d.length,canShowText:this.canShowTextData(u),wrap:!!u.$wrap,propList:d,color:Bt(e,u.$name)?.$color,noEscaping:u.$noescaping==="yes",isFastFilterAvailable:u?.isFastFilter,isFastFilterBySelect:u?.isFastFilterBySelect,editFunc:u.$edit,editSelection:u.$selection,buttons:u.buttons?.map(M=>At(ft({},M),{tooltip:nt.getMessage(`hint_${M.$name}`,i)}))};if(T.isFastFilterAvailable&&T.isFastFilterBySelect){let F=this.filterService.filterDoc.slist.find(S=>S?.$name===T.name)?.val.find(S=>S.$===T.value)?.$key;T.isFastFilterAvailable=!!F}if((u.$nestedlist&&Bt(e,u.$name)?.$nestedlist!=="no"||u.$editform)&&(T.link={nestedlist:u.$nestedlist,nestedlistBlank:u.$nestedlist_blank,nestedlistChild:u.$nestedlist_child,editform:u.$editform}),u.$type===di.Toggle&&(T.toggle=At(ft({},u.toggle),{isDisabled:!1,hintOn:nt.getMessage(`toggle_hint_${u.toggle.$name}_on`,i),hintOff:nt.getMessage(`toggle_hint_${u.toggle.$name}_off`,i),hintDisabledOn:nt.getMessage(`toggle_hint_${u.toggle.$name}_disabled_on`,i),hintDisabledOff:nt.getMessage(`toggle_hint_${u.toggle.$name}_disabled_off`,i)}),T.toggle.hide)){let F=(Array.isArray(T.toggle.hide)?T.toggle.hide:[T.toggle.hide]).some(S=>Bt(e,S.$name)?.$===S.$value);T.toggle.isDisabled=F}return T}),cacheKey:m}}makeRowCacheKey(e){let t="";return Object.keys(e).forEach(i=>{t+=nt.getElementValue(i,e)}),t}getRowsFromElemsAndColumnsLists(e,t,i){let r=this.getElidKey();return e.map(o=>{let u=Bt(o,r)?.$,d=null;if(i?.length){let M=i.find(F=>F.$elid===u)?.error?.msg;M&&!Array.isArray(M)&&(d=M.$)}let{cellList:v,cacheKey:T}=this.getCellsListAndRowCacheKey(o,t);return{cacheKey:T,elid:u,cells:v,cellsOriginal:v,color:o.$color,warning:d}})}openTableSettings(){this.listService.openTableSettings()}saveColWidth(e){this.listService.saveColWidth(e)}getSortNumber(e){return ra(this.listService.getColumnMetaList(),e)}handleFastFilter(e){let t=!e.canShowText&&e.canShowProps;if(e.isFastFilterBySelect&&!t){let m=this.filterService.filterDoc.slist.find(o=>o?.$name===e.name)?.val.find(o=>o.$===e.value)?.$key;if(!m)return;this.filterService.applyFilter$({[e.name]:m}).subscribe();return}let i=t?e.propList.find(r=>r.isInteractive).value:e.value;this.filterService.applyFilter$({[e.name]:i}).subscribe()}};n.\u0275fac=function(t){return new(t||n)(pt($t),pt(pi),pt(Jo),pt(Si),pt(Rt))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var $n=(()=>{let n=class n{constructor(e,t){this.tableService=e,this.destroyRef=t,this.COLUMN_MIN_WIDTH_PX=50,this.CHECKBOX_CELL_WIDTH="35px",this.MENU_CELL_WIDTH_PX=60,this.colWidthUI$=new st([this.CHECKBOX_CELL_WIDTH,`${this.MENU_CELL_WIDTH_PX}px`]),this.serverColWidth$=this.tableService.columnList$.pipe(Zt((i,r)=>i.length===r.length&&i.every((m,o)=>m?.$name===r[o]?.$name)),Je(i=>{let r=i.map(({$width:o})=>o);return r.some(o=>o===void 0)?r.map(o=>{}):r.map(o=>parseInt(o||"0")).reduce((o,u)=>o+u,0)>98?r:r.map(o=>{})})),this.subscribeToCheckbox()}fixMinWidth(e){let t=Array.from(e.children).slice(1,-1).map(o=>({w:o?.clientWidth}));if(t.some(o=>!o.w))return;let i=t.reduce((o,u)=>o+u.w,0),r=1e3;for(;r;){let o=t.find(d=>d.w<this.COLUMN_MIN_WIDTH_PX),u=t.filter(d=>d.w>this.COLUMN_MIN_WIDTH_PX).sort((d,v)=>v.w-d.w)[0];if(!o||!u)break;o.w++,u.w--,r--}let m=t.map(o=>`${i/100*o.w}%`);this.setServerColWidth(m)}subscribeToCheckbox(){this.tableService.doc$.pipe(Je(e=>oa(e)?this.CHECKBOX_CELL_WIDTH:"0"),mt(e=>{this.colWidthUI$.next([e,...this.colWidthUI$.value.slice(1)])}),ct(this.destroyRef)).subscribe()}setServerColWidth(e){let t=this.colWidthUI$.value;this.colWidthUI$.next([t[0],...e,t[t.length-1]])}init(e){this.serverColWidth$.pipe(mt(t=>{this.setServerColWidth(t),clearTimeout(this.fitBrowserColumnsTimeoutId),clearTimeout(this.correctBrowserColumnsMinWidthTimeoutId),this.fitBrowserColumnsTimeoutId=setTimeout(()=>{let i=e?.first?.nativeElement;t[0]===void 0&&i&&(this.correctBrowserColumnsMinWidthTimeoutId=this.setColWidthFromBrowser(i))},400)})).subscribe()}setColWidthFromBrowser(e){let t=Array.from(e.children).slice(1,-1),i=t.map(r=>`${r.clientWidth}%`);return this.setServerColWidth(i),setTimeout(()=>{let r=i.map((m,o)=>t[o].clientWidth<50?"50px":m);this.setServerColWidth(r)},100)}updateMenuCellWidth(e){this.colWidthUI$.next([...this.colWidthUI$.value.slice(0,-1),`${this.MENU_CELL_WIDTH_PX-e}px`])}};n.\u0275fac=function(t){return new(t||n)(pt(ji),pt(Rt))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var Wi=(()=>{let n=class n{constructor(e,t){this.listService=e,this.preloadedActionService=t,this.isLoadingSubject=new st(!1),this.docSubject=new st(null),this.isLoading$=this.isLoadingSubject.asObservable(),this.doc$=this.docSubject.asObservable()}getInitFormModel(){let e=this.docSubject.value,t=e.metadata.form,i={},r=m=>{m.forEach(o=>{i[o.$name]=e[o.$name]?.$||""})};return t.page?t.page.forEach(m=>r(m.field)):r(t.field),i}getFieldValue(e,t){let i=this.docSubject.value;return e.type==="select"?i.slist.find(m=>m.$name===t).val.find(m=>m.$key===e.value).$:e.value}getFormField(e){let i=this.docSubject.value.metadata.form;return i.page?i.page.find(m=>m.field.some(o=>o.$name===e)).field.find(m=>m.$name===e):i.field.find(r=>r.$name===e)}getFieldType(e){return e.select?"select":"text"}getEditCellField(e){let t=this.docSubject.value,i=this.getFormField(e),r=this.getFieldType(i),m={type:r,value:t[e].$||""};if(r==="select"){let o=t.slist.find(u=>u.$name===e).val;m.options=o.map(u=>({text:u.$,value:u.$key}))}return m}getForm$(e){if(this.isLoadingSubject.value)return Fr;this.isLoadingSubject.next(!0);let t=this.listService.tab?.doc,i={func:e.func,elid:e.elid,plid:nt.plid(t),scolname:e.columnName,stablename:t?.$func,stylesheet:"editinlist"};return this.preloadedActionService.getAction(i,{showProgressbar:!1}).pipe(mt(r=>this.docSubject.next(r)),Je(()=>this.getEditCellField(e.columnName)),Dr(()=>this.isLoadingSubject.next(!1)))}submitForm$(e,t){let i=this.docSubject.value,r=this.getInitFormModel();r[e.columnName]=t.value;let m=Io({form:r,sok:!0,func:i.$func,elid:nt.elid(i),plid:nt.plid(i)});return this.preloadedActionService.postAction(m).pipe(mt(o=>{if(o?.error)return;let u=nt.elid(o),d=this.getFieldValue(t,e.columnName);this.listService.patchCellValue({elid:e.elid,columnName:e.columnName,value:d,newElid:u})}))}};n.\u0275fac=function(t){return new(t||n)(pt($t),pt(yi))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var ah=["form"],lh=()=>({"--isp-dropdown-z-index":"var(--isp-list-edit-cell-dropdown-popup-z-index)"}),ch=h=>({"--isp-edit-cell-select-popup-width":h});function hh(h,n){if(h&1){let _=it();Ae(0,"isp-input",12),Fi("ngModelChange",function(t){Re(_);let i=pe();return Oi(i.value,t)||(i.value=t),De(t)}),Te()}if(h&2){let _=pe(),e=pe(2);ge("name",e.cellParams.columnName)("autofocus",!0),Ii("ngModel",_.value)}}function dh(h,n){if(h&1){let _=it();Ae(0,"isp-select",13),Fi("ngModelChange",function(t){Re(_);let i=pe();return Oi(i.value,t)||(i.value=t),De(t)}),Te()}if(h&2){let _=pe(),e=pe(2);ge("options",_.options)("name",e.cellParams.columnName)("cssVars",Kt(4,ch,e.popupWidth)),Ii("ngModel",_.value)}}function uh(h,n){if(h&1&&(Ae(0,"div",4),je(1,hh,1,3,"isp-input",10)(2,dh,1,6,"isp-select",11),Te()),h&2){let _;Ce(),Ti((_=n.type)==="text"?1:_==="select"?2:-1)}}function ph(h,n){if(h&1){let _=it();Ae(0,"isp-dropdown",2),Ne(1,"async"),Ge("update",function(t){Re(_);let i=pe();return De(i.onDropdownUpdate(t))}),Ae(2,"form",3,0),Ge("submit",function(t){Re(_);let i=pe();return De(i.submit(t))}),je(4,uh,3,1,"div",4),Ae(5,"div",5)(6,"button",6),Ke(7,"isp-icon-provider",7),Te(),Ae(8,"button",8),Ge("click",function(){Re(_);let t=pe();return De(t.softClosePopup())}),Ke(9,"isp-icon-provider",9),Te()()()()}if(h&2){let _,e=pe();ge("anchor",e.cellElement)("open",Be(1,8,e.isOpen$))("strictDirection",!0)("hideOnScroll",!0)("cssVars",wt(10,lh)),Ce(4),Ti((_=e.formField)?4:-1,_),Ce(3),ge("inSprite",!0),Ce(2),ge("inSprite",!0)}}var Vn=(()=>{let n=class n{constructor(e,t,i,r){this.editCellService=e,this.cdr=t,this.keydownService=i,this.destroyRef=r,this.isOpenSubject=new st(!1),this.isOpen$=this.isOpenSubject.asObservable()}subscribeToKeyboard(){this.isOpen$.pipe(mt(e=>{if(e){if(this.keyboardSubscription)return;this.keyboardSubscription=this.keydownService.listen$({code:["Escape","Enter"],context:"edit-cell-dropdown"}).pipe(ct(this.destroyRef)).subscribe(t=>{t.code==="Escape"&&this.isOpenSubject.value&&this.softClosePopup()})}else this.keyboardSubscription?.unsubscribe(),this.keyboardSubscription=null}),ct(this.destroyRef)).subscribe()}setSelection(e){let t=this.form.nativeElement.getElementsByTagName("input")?.[0];if(t&&e==="file"){let{value:i}=t;i.startsWith(".")||!i.includes(".")?t.setSelectionRange(0,i.length):t.setSelectionRange(0,i.lastIndexOf("."))}}updateFormStyles(e){this.popupWidth=`${this.cellElement.offsetWidth}px`,this.form.nativeElement.style.setProperty("width",this.popupWidth),setTimeout(()=>{this.setSelection(e)},400)}openSelect(){let e=this.form.nativeElement.querySelector(".form__select button");e&&setTimeout(()=>{e.click()})}softClosePopup(){this.isOpenSubject.next(!1)}closePopup(){setTimeout(()=>{this.isOpenSubject.next(!1),this.cellElement=null,this.cellParams=null,this.formField=null,this.cdr.markForCheck()},10)}ngAfterViewInit(){this.subscribeToKeyboard()}openForm({cellElement:e,elid:t,func:i,columnName:r,selection:m}){if(this.isOpenSubject.value){this.isOpen$.pipe(Vt(o=>!o),Nr(),Rr(0)).subscribe(()=>{this.openForm({cellElement:e,elid:t,func:i,columnName:r,selection:m})});return}this.cellElement=e,this.cellParams={elid:t,func:i,columnName:r},this.editCellService.getForm$(this.cellParams).subscribe(o=>{this.formField=o,this.cdr.markForCheck(),setTimeout(()=>{this.isOpenSubject.next(!0),this.updateFormStyles(m),this.openSelect()})})}submit(e){e?.preventDefault(),this.editCellService.submitForm$(this.cellParams,this.formField).subscribe(t=>{t.error||this.softClosePopup()})}onDropdownUpdate(e){e==="close-end"&&this.closePopup()}ngOnDestroy(){this.keyboardSubscription?.unsubscribe(),this.keyboardSubscription=null}};n.\u0275fac=function(t){return new(t||n)(tt(Wi),tt(bi),tt(vi),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-edit-cell-dropdown"]],viewQuery:function(t,i){if(t&1&&Dt(ah,5),t&2){let r;It(r=Ot())&&(i.form=r.first)}},decls:1,vars:1,consts:[["form",""],["anchorOffset","-35","direction","bottom","alignment","start","trigger","parameter","viewportSelector",".table-viewport","scrollSelector",".table-viewport","resizeSelector","#layout-main-page","popupClasses","isp-edit-cell-popup",3,"anchor","open","strictDirection","hideOnScroll","cssVars"],["anchorOffset","-35","direction","bottom","alignment","start","trigger","parameter","viewportSelector",".table-viewport","scrollSelector",".table-viewport","resizeSelector","#layout-main-page","popupClasses","isp-edit-cell-popup",3,"update","anchor","open","strictDirection","hideOnScroll","cssVars"],[1,"form",3,"submit"],[1,"form__field"],[1,"form__buttons"],["type","submit",1,"form__button","form__button_submit"],["name","check_s",1,"form__button-icon",3,"inSprite"],["type","button",1,"form__button","form__button_cancel",3,"click"],["name","close_s",1,"form__button-icon",3,"inSprite"],[1,"form__input",3,"name","autofocus","ngModel"],["popupClasses","isp-edit-cell-select-popup",1,"form__select",3,"options","name","cssVars","ngModel"],[1,"form__input",3,"ngModelChange","name","autofocus","ngModel"],["popupClasses","isp-edit-cell-select-popup",1,"form__select",3,"ngModelChange","options","name","cssVars","ngModel"]],template:function(t,i){t&1&&je(0,ph,10,11,"isp-dropdown",1),t&2&&Ti(i.cellElement?0:-1)},dependencies:[mo,En,fo,Tn,go,zi,Mn,Yt,Mo,xt],styles:[".form[_ngcontent-%COMP%]{display:flex;width:100%;height:100%}.form__field[_ngcontent-%COMP%]{flex-grow:1;max-width:calc(100% - 35px)}.form__input[_ngcontent-%COMP%]{--isp-field__min-width: 100%;--isp-field__background: var(--isp-dc-cow)}.form__select[_ngcontent-%COMP%]{--isp-field__min-width: 100%;--isp-field__background: var(--isp-dc-cow);display:flex}.form__buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center}.form__button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:35px;height:16px;padding:0 0 0 5px;margin:0 0 0 -5px;background-color:var(--isp-dc-monochrome);border:none;cursor:pointer}.form__button[_ngcontent-%COMP%]:hover{--isp-icons-main-color: var(--isp-c-jon-snow);background-color:var(--isp-c-blue-velvet)}.form__button_submit[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-c-grasshopper);border-top-right-radius:5px}.form__button_cancel[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-dc-bright-emotions);border-top:1px solid var(--isp-dc-charlie-chaplin);border-bottom-right-radius:5px}.form__button-icon[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let h=n;return h})();var zn=(()=>{let n=class n{constructor(e,t,i,r,m,o){this.listService=e,this.actionService=t,this.preloadedActionService=i,this.confirmService=r,this.metricService=m,this.appService=o,this.row=null,this.cell=null,this.enableState=null}toggleCell$(e){return this.init(e),this.sendToggleMetrics(),this.openConfirm$().pipe(Vt(t=>t.confirmed),Ut(()=>this.sendRequest$()),mt(t=>{t&&this.listService.patchCellValue({elid:this.row.elid,columnName:this.cell.name,value:this.enableState?"on":"off",silentPatch:!0})}),Je(t=>t?this.enableState:!this.enableState))}init({row:e,cell:t,state:i}){this.row=e,this.cell=t,this.enableState=i}sendToggleMetrics(){let t=`user_click_on_toggle_${this.enableState?"off":"on"}`;this.metricService.append({event:t,data:{}})}openConfirm$(){let e=nt.getElidColumn(this.listService.doc),t=nt.getKeyname(this.listService.doc),i=this.listService.getElementListByElid([this.row.elid])[0],r=(i[t]||i[e]).$||this.row.elid;return this.confirmService.open$(At(ft({},this.getConfirmOptions()),{elnames:[r]}))}sendRequest$(){let e=this.getRequestParams();return this.preloadedActionService.postAction(e).pipe(this.checkDocWarnings())}getRequestParams(){let e=this.listService.handleAdditionalParams({elidList:[]}),t=this.enableState?this.cell.toggle.$onenable:this.cell.toggle.$ondisable;return{elid:this.row.elid,elname:this.row.elid,plid:this.listService.tab.plid,func:t,tconvert:e.additionalParams.tconvert}}checkDocWarnings(){return Or(Je(e=>{let{banner:t,warning:i}=e;return i&&this.listService.addWarning(i),t&&this.actionService.handleNotificationBanners(nt.getNotificationBanners(e)),!(i||t)}))}getConfirmOptions(){let e={on:"off",off:"on"}[this.cell.value]||this.cell.value,t=`${this.cell.name}_${e}`,i=this.listService.doc.plname?.$||"";return{text:this.getMessage(`toggle_confirm_${t}`).replace(/__elname__/,i),header:this.getMessage(`toggle_header_confirm_${t}`),banner:this.getMessage(`toggle_banner_confirm_${t}`),danger:e==="off",ok:this.getMessage(`toggle_ok_confirm_${t}`)||this.appService.getDesktopMessage("msg_ok"),cancel:this.getMessage(`toggle_cancel_confirm_${t}`)||this.appService.getDesktopMessage("msg_cancel")}}getMessage(e){return nt.getMessage(e,this.listService.doc)}};n.\u0275fac=function(t){return new(t||n)(pt($t),pt(Ci),pt(yi),pt(Ro),pt(Vi),pt(Di))},n.\u0275prov=Xt({token:n,factory:n.\u0275fac});let h=n;return h})();var _h=()=>({"--isp-dropdown-z-index":"var(--isp-context-menu-dropdown-z-index)"}),bh=h=>({func:h}),vh=h=>({event:"user_click_action_button_from_popup",data:h});function yh(h,n){if(h&1){let _=it();Ae(0,"div",8),Ne(1,"trust"),Ge("click",function(){let t=Re(_).$implicit,i=pe(3);return De(i.handleMenuClick(t))}),Te()}if(h&2){let _=n.$implicit,e=pe(3);ge("ispMetric",Kt(7,vh,Kt(5,bh,_==null?null:_.$func)))("innerHTML",to(1,2,e.shortCaption(_.$name),"html"),Ji)}}function Ch(h,n){if(h&1&&(Ae(0,"div",6),je(1,yh,2,9,"div",7),Te()),h&2){let _=n.$implicit;Ce(),ge("ngForOf",_.toolbtn)}}function wh(h,n){if(h&1&&(Mt(0),Ke(1,"div",2,0),Ae(3,"isp-dropdown",3)(4,"div",4),je(5,Ch,2,1,"div",5),Te()(),kt()),h&2){let _=n.ngIf,e=Ct(2),t=pe();Ce(3),ge("anchorOffset",5)("viewportOffset",10)("strictDirection",!0)("anchor",e)("hideOnPopupClick",!0)("destroyTrigger",t.getMenuIdentityString(_))("cssVars",wt(8,_h)),Ce(2),ge("ngForOf",_)}}var Va=(()=>{let n=class n{constructor(e,t){this.listService=e,this.actionService=t}shortCaption(e){return this.listService.getMessageSet()[`short_${e}`]}getMenuIdentityString(e){return`${e[0].toolbtn[0].$name}-${e.length}`}getMenuList$(){return Zi(this.listService.getMenuForDropdownByElid(this.elid,this.cacheKey))}handleMenuClick(e){let t=this.listService.handleAdditionalParams({elidList:[this.elid],toolbtn:e,tab:this.listService.tab,doc:this.listService.doc});this.actionService.handleToolBtn(t).subscribe()}};n.\u0275fac=function(t){return new(t||n)(tt($t),tt(Ci))},n.\u0275cmp=ut({type:n,selectors:[["isp-list-item-menu"]],inputs:{elid:"elid",cacheKey:"cacheKey"},decls:2,vars:3,consts:[["kebab",""],[4,"ngIf"],[1,"kebab"],["viewportSelector","#layout-main-page","direction","left","alignment","start","trigger","click","popupClasses","isp-list-item-menu",3,"anchorOffset","viewportOffset","strictDirection","anchor","hideOnPopupClick","destroyTrigger","cssVars"],[1,"list-item-menu__container","ispui-scrollbar_gray"],["class","list-item-menu__item-group",4,"ngFor","ngForOf"],[1,"list-item-menu__item-group"],["class","list-item-menu__item",3,"ispMetric","innerHTML","click",4,"ngFor","ngForOf"],[1,"list-item-menu__item",3,"click","ispMetric","innerHTML"]],template:function(t,i){t&1&&(je(0,wh,6,9,"ng-container",1),Ne(1,"async")),t&2&&ge("ngIf",Be(1,1,i.getMenuList$()))},dependencies:[Jt,St,Fn,Yt,xt,To],styles:[`.list-item-menu__container[_ngcontent-%COMP%]{overflow-y:auto}.list-item-menu__item[_ngcontent-%COMP%]{display:flex;flex-shrink:0;align-items:center;height:30px;padding:0 15px;white-space:nowrap;cursor:pointer}.list-item-menu__item[_ngcontent-%COMP%]:hover{background:var(--isp-dc-cult)}@document url-prefix(){.list-item-menu__item[_ngcontent-%COMP%]:after{flex-shrink:0;content:"";width:10px;height:100%}}.list-item-menu__item-group[_ngcontent-%COMP%]{padding:0}.list-item-menu__item-group[_ngcontent-%COMP%]:not(:last-child){position:relative;padding-bottom:15px}.list-item-menu__item-group[_ngcontent-%COMP%]:not(:last-child):after{position:absolute;bottom:7px;content:"";width:100%;height:1px;background:var(--isp-dc-charlie-chaplin)}.kebab[_ngcontent-%COMP%]{position:relative;display:inline-block;width:25px;height:25px;border-radius:50%;cursor:pointer;transition:background-color .1s ease-in-out}.kebab[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-mass-relay)}.kebab[_ngcontent-%COMP%]:after{position:absolute;inset:5px;content:"";background-color:var(--isp-dc-highway-star);-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='15' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='9' y='6' width='3' height='3' rx='1.5' transform='rotate(90 9 6)' fill='%231F3347'/%3E%3Crect x='3' y='6' width='3' height='3' rx='1.5' transform='rotate(90 3 6)' fill='%231F3347'/%3E%3Crect x='15' y='6' width='3' height='3' rx='1.5' transform='rotate(90 15 6)' fill='%231F3347'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='15' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='9' y='6' width='3' height='3' rx='1.5' transform='rotate(90 9 6)' fill='%231F3347'/%3E%3Crect x='3' y='6' width='3' height='3' rx='1.5' transform='rotate(90 3 6)' fill='%231F3347'/%3E%3Crect x='15' y='6' width='3' height='3' rx='1.5' transform='rotate(90 15 6)' fill='%231F3347'/%3E%3C/svg%3E")}`],changeDetection:0});let h=n;return h})();var xh=["anchor"],Ah=()=>({"--isp-dropdown-z-index":"var(--isp-list-filter-z-index)"}),Ph=()=>[0,1,2,3,4];function Eh(h,n){h&1&&Ke(0,"isp-loader",7)}function Th(h,n){h&1&&Ke(0,"isp-svg-icon",8)}function Mh(h,n){if(h&1&&Ke(0,"isp-skeleton",16),h&2){let _=n.$implicit;ge("index",_+1)}}function kh(h,n){h&1&&(Ae(0,"div",9),Ke(1,"isp-skeleton",10),Ae(2,"div",11),je(3,Mh,1,1,"isp-skeleton",12),Te(),Ae(4,"div",13),Ke(5,"isp-skeleton",14)(6,"isp-skeleton",15),Te()()),h&2&&(Ce(3),ge("ngForOf",wt(1,Ph)))}function Lh(h,n){if(h&1){let _=it();Ae(0,"isp-new-dynamic-form",18),Ne(1,"async"),Ge("buttonClick",function(t){Re(_);let i=pe(2);return De(i.handleButtonClick(t))}),Te()}if(h&2){let _=pe(2);ge("id","list-filter-form")("doc",Be(1,3,_.filterDoc$))("place","filter")}}function Ih(h,n){if(h&1&&(je(0,Lh,2,5,"isp-new-dynamic-form",17),Ne(1,"async")),h&2){let _=pe();ge("ngIf",Be(1,1,_.renderForm$))}}var ja=(()=>{let n=class n{set filterFunc(e){this.filterService.setFilterFunc(e)}constructor(e,t){this.filterService=e,this.destroyRef=t,this.renderForm$=new st(!1),this.filterIsActive$=this.filterService.filterIsActive$,this.filterIconName$=this.filterIsActive$.pipe(Je(i=>`filter_table_multy${i?"_filled":""}`)),this.filterDoc$=this.filterService.filterDoc$,this.isLoadingForm$=this.filterService.isLoading$,this.isUpdating$=this.filterService.isUpdating$}resetForm(){this.filterService.reset()}handleButtonClick(e){e.button.$type===so.Ok?this.applyFilter(e.model):this.resetForm()}onDropdownUpdate(e){e==="open-start"&&this.renderForm$.next(!0),e==="close-end"&&this.renderForm$.next(!1)}applyFilter(e){this.filterService.applyFilter$(e).pipe(ct(this.destroyRef)).subscribe(),this.anchor.nativeElement.click()}};n.\u0275fac=function(t){return new(t||n)(tt(pi),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-filter-button"]],viewQuery:function(t,i){if(t&1&&Dt(xh,5),t&2){let r;It(r=Ot())&&(i.anchor=r.first)}},inputs:{filterFunc:"filterFunc"},decls:12,vars:16,consts:[["anchor",""],["icon",""],["form",""],["type","button",1,"filter__button"],["class","filter__button-loader","loading","","type","spinner",4,"ngIf","ngIfElse"],["trigger","click","anchorOffset","3","direction","left","alignment","start","viewportSelector","[isp-layout-content]","popupClasses","isp-filter-button-popup",3,"update","anchor","hideOnDocumentClick","cssVars"],["class","skeleton",4,"ngIf","ngIfElse"],["loading","","type","spinner",1,"filter__button-loader"],["name","filter_table_multy",1,"filter__button-icon"],[1,"skeleton"],["width","200px","height","25px"],[1,"skeleton__body"],["width","calc((100% - 20px) / 2)","height","20px",3,"index",4,"ngFor","ngForOf"],[1,"skeleton__footer"],["width","100px","height","35px"],["width","80px","height","20px"],["width","calc((100% - 20px) / 2)","height","20px",3,"index"],["class","filter__form ispui-scrollbar_gray",3,"id","doc","place","buttonClick",4,"ngIf"],[1,"filter__form","ispui-scrollbar_gray",3,"buttonClick","id","doc","place"]],template:function(t,i){if(t&1){let r=it();Ae(0,"button",3,0),Ne(2,"async"),je(3,Eh,1,0,"isp-loader",4),Ne(4,"async"),je(5,Th,1,0,"ng-template",null,1,Ht),Te(),Ae(7,"isp-dropdown",5),Ge("update",function(o){return Re(r),De(i.onDropdownUpdate(o))}),je(8,kh,7,2,"div",6),Ne(9,"async"),je(10,Ih,2,3,"ng-template",null,2,Ht),Te()}if(t&2){let r=Ct(1),m=Ct(6),o=Ct(11);oi("filter__button_active",Be(2,9,i.filterIsActive$)),Ce(3),ge("ngIf",Be(4,11,i.isUpdating$))("ngIfElse",m),Ce(4),ge("anchor",r)("hideOnDocumentClick",!0)("cssVars",wt(15,Ah)),Ce(),ge("ngIf",Be(9,13,i.isLoadingForm$))("ngIfElse",o)}},dependencies:[Jt,St,Wt,Yt,Bi,Vo,Qo,xt],styles:[".filter__button[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-c-grey-weekdays);display:inline-flex;align-items:center;justify-content:center;height:25px;padding:0 3px;font-family:inherit;color:var(--isp-c-grey-weekdays);background:none;border:none;border-radius:5px;cursor:pointer;transition:background-color .1s ease-in-out}.filter__button[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-norilsk)}.filter__button_active[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-dc-fremen);color:var(--isp-dc-fremen);background-color:var(--isp-dc-norilsk)}.filter__button-icon[_ngcontent-%COMP%]{display:flex}.filter__button-loader[_ngcontent-%COMP%]{--isp-loader__background: none;--isp-loader__size: 10px;--isp-loader__color: var(--isp-dc-highway-star)}.filter__form[_ngcontent-%COMP%]{--isp-field__background: var(--isp-dc-cow);display:block;overflow-y:auto}.skeleton[_ngcontent-%COMP%]{display:flex;flex-flow:column;gap:30px;padding:20px}.skeleton__body[_ngcontent-%COMP%]{display:flex;flex-flow:row wrap;gap:20px}.skeleton__footer[_ngcontent-%COMP%]{display:flex;gap:15px;align-items:center}"],changeDetection:0});let h=n;return h})();function Fh(h,n){if(h&1){let _=it();Ae(0,"button",7),Ge("click",function(){Re(_);let t=pe().$implicit,i=pe(2);return De(i.buttonClick.emit(t))}),_t(1),Te()}if(h&2){let _=pe().$implicit;ge("ispTooltip",_.hint)("ispTooltipDisabled",!_.hint),Ce(),jt(" ",_.text," ")}}function Rh(h,n){if(h&1){let _=it();Ae(0,"span",8),Ge("click",function(){Re(_);let t=pe().$implicit,i=pe(2);return De(i.buttonClick.emit(t))}),_t(1),Te()}if(h&2){let _=pe().$implicit;ge("ispTooltip",_.hint)("ispTooltipDisabled",!_.hint),Ce(),zt(_.text)}}function Dh(h,n){if(h&1&&(Mt(0),je(1,Fh,2,3,"button",5)(2,Rh,2,3,"span",6),kt()),h&2){let _=n.$implicit;Ce(),ge("ngIf",_.$type==="button"),Ce(),ge("ngIf",_.$type==="link")}}function Nh(h,n){if(h&1&&(Mt(0),Ae(1,"div",3),_t(2),Te(),je(3,Dh,3,2,"ng-container",4),kt()),h&2){let _=n.ngIf;Ce(2),zt(_.title),Ce(),ge("ngForOf",_.buttons)}}var Wa=(()=>{let n=class n{set doc(e){let t=null;e.metadata.emptybuttons&&(t={title:nt.getMessage("empty_list",e),buttons:[e.metadata.emptybuttons.button].flat().filter(i=>!!i).map(i=>At(ft({},i),{text:nt.getMessage(`emptybuttons_${i.$name}`,e),hint:i.$hint?nt.getMessage(`hint_${i.$name}`,e):void 0}))}),this.actionBar$.next(t)}constructor(e){this.appService=e,this.buttonClick=new lt,this.actionBar$=new st(null),this.emptyListMessage$=this.appService.desktop$.pipe(Je(()=>this.appService.getDesktopMessage("msg_empty_list")||""))}};n.\u0275fac=function(t){return new(t||n)(tt(Di))},n.\u0275cmp=ut({type:n,selectors:[["isp-empty-list-stub"]],inputs:{doc:"doc"},outputs:{buttonClick:"buttonClick"},decls:6,vars:6,consts:[["type","empty-list",1,"stub__pic"],[1,"stub__caption"],[4,"ngIf"],[1,"stub__action-bar-title"],[4,"ngFor","ngForOf"],["type","button","class","isp-button isp-button_theme_primary stub__action-bar-button","ispTooltipPosition","top-middle",3,"ispTooltip","ispTooltipDisabled","click",4,"ngIf"],["class","isp-link stub__action-bar-button","ispTooltipPosition","top-middle",3,"ispTooltip","ispTooltipDisabled","click",4,"ngIf"],["type","button","ispTooltipPosition","top-middle",1,"isp-button","isp-button_theme_primary","stub__action-bar-button",3,"click","ispTooltip","ispTooltipDisabled"],["ispTooltipPosition","top-middle",1,"isp-link","stub__action-bar-button",3,"click","ispTooltip","ispTooltipDisabled"]],template:function(t,i){t&1&&(Ke(0,"isp-illustration",0),Ae(1,"div",1),_t(2),Ne(3,"async"),Te(),je(4,Nh,4,2,"ng-container",2),Ne(5,"async")),t&2&&(Ce(2),zt(Be(3,2,i.emptyListMessage$)),Ce(2),ge("ngIf",Be(5,4,i.actionBar$)))},dependencies:[Jt,St,ea,ni,xt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center}.stub__pic[_ngcontent-%COMP%]{margin-top:70px}.stub__caption[_ngcontent-%COMP%]{margin-top:10px;font-size:18px;font-weight:var(--isp-font-weight-bold);text-align:center}.stub__action-bar-title[_ngcontent-%COMP%]{width:400px;margin-top:10px;font-size:14px;line-height:18px}.stub__action-bar-button[_ngcontent-%COMP%]{margin-top:15px}"],changeDetection:0});let h=n;return h})();var jn=(()=>{let n=class n{constructor(){this.disabled=!1,this.checked=!1,this.checkedChange=new lt}onChange(e){this.checked=e.target.checked,this.checkedChange.emit(this.checked)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ut({type:n,selectors:[["isp-toggle"]],hostVars:4,hostBindings:function(t,i){t&2&&oi("disabled",i.disabled)("checked",i.checked)},inputs:{disabled:"disabled",checked:"checked"},outputs:{checkedChange:"checkedChange"},standalone:!0,features:[yn],decls:5,vars:2,consts:[[1,"label"],["type","checkbox",1,"visually-hidden",3,"click","change","checked","disabled"],[1,"label__thumb"],["name","check_xs",1,"label__icon","label__icon_check"],["name","close_xs",1,"label__icon","label__icon_close"]],template:function(t,i){t&1&&(Ae(0,"label",0)(1,"input",1),Ge("click",function(m){return m.stopPropagation()})("change",function(m){return i.onChange(m)}),Te(),Ae(2,"div",2),Ke(3,"isp-svg-icon",3)(4,"isp-svg-icon",4),Te()()),t&2&&(Ce(),ge("checked",i.checked)("disabled",i.disabled))},dependencies:[ii,Wt],styles:["[_nghost-%COMP%]{position:relative;display:inline-block;width:30px;min-width:30px;height:17px;min-height:17px}.disabled[_nghost-%COMP%]{opacity:.5}.label[_ngcontent-%COMP%]{position:absolute;inset:0;background-color:var(--isp-dc-monochrome);border-radius:10px;box-shadow:inset 0 0 0 1px var(--isp-c-grey-weekdays);transition-property:background-color,box-shadow;transition-duration:.15s;transition-timing-function:ease-in-out}[_nghost-%COMP%]:not(.disabled) .label[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%]:not(.disabled) .label[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-mimic)}.label__thumb[_ngcontent-%COMP%]{position:absolute;top:2px;left:2px;display:flex;align-items:center;justify-content:center;width:13px;height:13px;transition:transform .35s cubic-bezier(0,1.81,.38,.86);transform:translate(0)}.label__icon[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-dc-monochrome);display:flex;align-items:center;justify-content:center;width:11px;height:11px;background-color:var(--isp-c-grey-weekdays);border-radius:50%;transition-property:width,height,background-color;transition-duration:50ms,50ms,.15s;transition-timing-function:ease-in-out}.label__icon_check[_ngcontent-%COMP%]{display:none}.label__icon_close[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%]:not(.disabled) .label[_ngcontent-%COMP%]:hover .label__icon[_ngcontent-%COMP%]{width:13px;height:13px}.checked[_nghost-%COMP%] .label[_ngcontent-%COMP%]{background-color:var(--isp-c-blue-velvet);box-shadow:none}.checked[_nghost-%COMP%] .label__thumb[_ngcontent-%COMP%]{transform:translate(13px)}.checked[_nghost-%COMP%] .label__icon[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-c-blue-velvet);background-color:var(--isp-c-jon-snow)}.checked[_nghost-%COMP%] .label__icon_check[_ngcontent-%COMP%]{display:flex}.checked[_nghost-%COMP%] .label__icon_close[_ngcontent-%COMP%]{display:none}.checked[_nghost-%COMP%]:not(.disabled) .label[_ngcontent-%COMP%]:hover{background-color:var(--isp-c-deep)}"],changeDetection:0});let h=n;return h})();var Wn=(()=>{let n=class n{get isChanged(){return this.cellStartWidth!==this.cellNewWidth}get isMinWidth(){return this.cellNewWidth<=this.minWidth}constructor(e){this.host=e}activateResizingState(e,t){this.minWidth=e,this.bodyHeight=t,this.cell=this.host.nativeElement,this.lever=this.cell.querySelector(".isp-table-resizer__lever"),this.cellStartWidth=this.cell.clientWidth,this.cellMinWidth=Math.min(this.cell.clientWidth,this.minWidth),this.cellNewWidth=this.cell.clientWidth,this.cellIsRelative=this.cell.classList.contains("isp-table-resizer__control-th_relative"),this.cellIsFixed=this.cell.classList.contains("isp-table-resizer__control-th_fixed"),this.leverDefaultRight=this.lever?this.cell.clientWidth-(this.lever.offsetLeft+this.lever.offsetWidth):0}setLeverAlert(e){e&&this.setLeverInfo(!1),clearTimeout(this.alertTimeout),this.lever?.classList.toggle("isp-table-resizer__lever_alert",e)}setLeverInfo(e){e&&this.setLeverAlert(!1),this.lever?.classList.toggle("isp-table-resizer__lever_info",e)}showLeverAlertTemporarily(){this.setLeverAlert(!0),this.toggleBodyLever(!0),this.alertTimeout=setTimeout(()=>{this.setLeverAlert(!1),this.toggleBodyLever(!1)},500)}setDraggingState(e){this.cell?.classList.toggle("isp-table-resizer__control-th_dragging",e)}toggleBodyLever(e){e?this.lever?.style.setProperty("--isp-table-resizer__splitter-height",`${this.bodyHeight}px`):this.lever?.style.removeProperty("--isp-table-resizer__splitter-height")}setLeverRight(e){this.lever&&(this.lever.style.right=e===null?"":`${e+this.leverDefaultRight}px`)}resetNewWidth(){this.cellNewWidth=this.cellStartWidth}};n.\u0275fac=function(t){return new(t||n)(tt(ci))},n.\u0275dir=Vr({type:n,selectors:[["","ispTableResizerTh",""]],standalone:!0});let h=n;return h})();var zh=["*"],Ua=(()=>{let n=class n{get el(){return this.host.nativeElement}constructor(e,t){this.host=e,this.destroyRef=t,this.minWidth=50,this.columnResize=new lt,this.DBL_CLICK_THRESHOLD_MS=500,this.CASCADE_RESIZE_GAP=15,this.tbodyHeight=0,this.leftResizableCells=[],this.rightResizableCells=[],this.lastMousedownTime=0,this.isMoving$=new st(!1),this.mouseDownHandler=i=>{let m=i.target?.closest(".isp-table-resizer__lever")?.closest("th, td");if(!m)return;this.tbodyHeight=this.getVisibleTBodyHeight(m),this.cells.forEach(v=>v.activateResizingState(this.minWidth,this.tbodyHeight));let o=this.cells.find(v=>v.cell===m);if(!o)return;let u=Array.from(this.cells);this.activeCell=o,this.activeCellIndex=u.indexOf(o),this.leftResizableCells=u.slice(0,this.activeCellIndex+1).reverse().filter(v=>!v.cellIsFixed).slice(),this.rightResizableCells=u.slice(this.activeCellIndex+1).filter(v=>!v.cellIsFixed).slice(),this.activeCell.setLeverAlert(!1),this.activeCell.setLeverInfo(!1);let d=Date.now();if(d-this.lastMousedownTime<=this.DBL_CLICK_THRESHOLD_MS){this.leverDblMousedownHandler();return}if(this.lastMousedownTime=d,this.isMoving$.next(!0),this.toggleBodyPointer(!1),o.setDraggingState(!0),o.toggleBodyLever(!0),document.addEventListener("mouseup",this.mouseupHandler,{once:!0}),!this.leftResizableCells.length||!this.rightResizableCells.length||this.leftResizableCells.every(v=>v.isMinWidth)&&this.rightResizableCells.every(v=>v.isMinWidth)){o.setLeverAlert(!0);return}this.lastX=i.clientX,this.startX=i.clientX,document.addEventListener("mousemove",this.mousemoveHandler)},this.mousemoveHandler=i=>{if(!i.movementX||this.lastX===i.clientX)return;this.lastX=i.clientX,this.cells.forEach(o=>o.resetNewWidth());let{inCascadeGap:r,restDeltaX:m}=this.resizeCells(this.lastX-this.startX,this.leftResizableCells,this.rightResizableCells,this.CASCADE_RESIZE_GAP);this.cells.reduce((o,u)=>{let d=o+(u.cellStartWidth-u.cellNewWidth),v=!!d||u===this.activeCell;return u.lever&&(u.setDraggingState(v),u.toggleBodyLever(v),u.setLeverAlert(!r&&v&&!!m),u.setLeverInfo(r&&v&&!!m),u.setLeverRight(d||null)),d},0)},this.mouseupHandler=()=>{document.removeEventListener("mousemove",this.mousemoveHandler),this.toggleBodyPointer(!0),this.isMoving$.next(!1);let i=!1;if(this.cells.forEach(r=>{i||=r.isChanged,r.lever&&(r.setDraggingState(!1),r.setLeverAlert(!1),r.setLeverInfo(!1),r.toggleBodyLever(!1),r.setLeverRight(null))}),i){this.setNewCellsWidth();let r=Array.from(this.cells);this.columnResize.emit({leverColIndex:r.indexOf(this.activeCell),colWidths:r.map(m=>m.cell.style.width)})}this.activeCell=null,this.activeCellIndex=-1,this.leftResizableCells=[],this.rightResizableCells=[],this.tbodyHeight=0},document.addEventListener("mousedown",this.mouseDownHandler),this.isMoving$.pipe(ct(this.destroyRef)).subscribe(i=>{this.el.classList.toggle("isp-table-resizer_resizing",i)})}getVisibleTBodyHeight(e){let t=this.el.querySelector("tbody");if(!t)return 0;let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();return Math.max(0,r.bottom-i.bottom)}leverDblMousedownHandler(){if(!this.activeCell||this.activeCell.cellIsFixed)return;let e=this.activeCell;if(!this.rightResizableCells.length){e.showLeverAlertTemporarily();return}let t=0;this.el.querySelectorAll("table").forEach(m=>{let o;if(m.contains(e.cell))o=e.cell;else{let T=[`td:nth-child(${this.activeCellIndex+1}):not([colspan])`,`th:nth-child(${this.activeCellIndex+1}):not([colspan])`,`td:nth-child(${this.activeCellIndex+1})[colspan="${e.cell.colSpan}"]`,`th:nth-child(${this.activeCellIndex+1})[colspan="${e.cell.colSpan}"]`];e.cell.colSpan!==1&&T.splice(0,2),o=m.querySelector(T.join(", "))}if(!o)return;let u=m.style.tableLayout,d=m.style.maxWidth,v=m.style.minWidth;m.style.tableLayout="auto",m.style.maxWidth="0",m.style.minWidth="0",t=Math.max(t,o.getBoundingClientRect().width),m.style.tableLayout=u,m.style.maxWidth=d,m.style.minWidth=v});let i=t-e.cellStartWidth,{restDeltaX:r}=this.resizeCells(i,[e],this.rightResizableCells);e.isChanged?(this.setNewCellsWidth(),this.columnResize.emit({leverColIndex:this.activeCellIndex,colWidths:this.cells.map(m=>m.cell.style.width)})):i&&i===r&&e.showLeverAlertTemporarily(),this.activeCell=null,this.activeCellIndex=-1,this.leftResizableCells=[],this.rightResizableCells=[],this.tbodyHeight=0}resizeCells(e,t,i,r=0){if(!e)return{restDeltaX:0,inCascadeGap:!1};let m=e<0?t:i,o=e<0?i:t,u=e<0?-e:e,d=m.slice(),v=o[0];for(;u;){let T=d[0];if(!T)break;if(T.isMinWidth){if(d.splice(0,1),r&&m[0]===T&&d.some(M=>!M.isMinWidth)){if(u<=r)return{restDeltaX:u,inCascadeGap:!0};u-=r}continue}let A=Math.min(u,T.cellNewWidth-T.cellMinWidth);T.cellNewWidth-=A,v.cellNewWidth+=A,u-=A}return{restDeltaX:u,inCascadeGap:!1}}setNewCellsWidth(){let e=this.cells.reduce((t,i)=>t+(i.cellIsRelative?i.cellNewWidth:0),0);this.cells.forEach(t=>{let i=t.cellIsRelative?`${t.cellNewWidth*100/e}%`:`${t.cellNewWidth}px`;t.cell.style.width=i})}toggleBodyPointer(e){document.body.classList.toggle("isp-table-resizer-mute-pointer-activity",!e)}ngOnDestroy(){document.removeEventListener("mousedown",this.mouseDownHandler)}};n.\u0275fac=function(t){return new(t||n)(tt(ci),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-table-resizer"]],contentQueries:function(t,i,r){if(t&1&&Yr(r,Wn,5),t&2){let m;It(m=Ot())&&(i.cells=m)}},inputs:{minWidth:"minWidth"},outputs:{columnResize:"columnResize"},standalone:!0,features:[yn],ngContentSelectors:zh,decls:1,vars:0,template:function(t,i){t&1&&(bn(),vn(0))},styles:[`.isp-table-resizer-mute-pointer-activity{-webkit-user-select:none;user-select:none;cursor:ew-resize}.isp-table-resizer-mute-pointer-activity *{pointer-events:none}.isp-table-resizer__control-th{position:relative}.isp-table-resizer__control-th_dragging{z-index:var(--isp-table-resizer__control-th_dragging-z-index, 10)}.isp-table-resizer__lever{--lever-color: var(--isp-dc-charlie-chaplin);--splitter-color: var(--isp-dc-charlie-chaplin);position:absolute;top:0;right:0;bottom:0;width:5px;background-image:linear-gradient(0deg,var(--lever-color),var(--lever-color));background-repeat:no-repeat;background-position:center;background-size:1px 60%;pointer-events:auto;-webkit-user-select:none;user-select:none;cursor:ew-resize}.isp-table-resizer__lever:after{position:absolute;top:calc(100% + 1px);left:calc(50% - .5px);content:"";width:1px;height:var(--isp-table-resizer__splitter-height, 0);background-image:repeating-linear-gradient(transparent 0,transparent 10px,var(--splitter-color) 10px,var(--splitter-color) 20px)}.isp-table-resizer__lever:hover,.isp-table-resizer__control-th_dragging .isp-table-resizer__lever{background-size:1px 100%}.isp-table-resizer__lever_info{--lever-color: var(--isp-dc-fremen);--splitter-color: var(--isp-dc-fremen);display:block;background-size:1px 100%}.isp-table-resizer__lever_alert{--lever-color: var(--isp-dc-bright-emotions);--splitter-color: var(--isp-dc-bright-emotions);display:block;background-size:1px 100%}
`],encapsulation:2,changeDetection:0});let h=n;return h})();var Wh=["ispCellButton",""];function Uh(h,n){h&1&&Ke(0,"isp-loader",2)}function Hh(h,n){if(h&1&&Ke(0,"isp-svg-icon",4),h&2){let _=pe(2);ge("name",_.icon)}}function Gh(h,n){if(h&1&&je(0,Hh,1,1,"isp-svg-icon",3),h&2){let _=pe();ge("ngIf",_.icon)}}var Ha=(()=>{let n=class n{constructor(){this.loading=!1}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ut({type:n,selectors:[["button","ispCellButton",""]],inputs:{icon:"icon",loading:"loading"},attrs:Wh,decls:3,vars:2,consts:[["btnIcon",""],["class","loader","loading","","type","spinner",4,"ngIf","ngIfElse"],["loading","","type","spinner",1,"loader"],["class","icon",3,"name",4,"ngIf"],[1,"icon",3,"name"]],template:function(t,i){if(t&1&&je(0,Uh,1,0,"isp-loader",1)(1,Gh,1,1,"ng-template",null,0,Ht),t&2){let r=Ct(2);ge("ngIf",i.loading)("ngIfElse",r)}},dependencies:[St,Wt,Bi],styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center;justify-content:center;height:25px;padding:0 3px;margin-left:2px;font-family:inherit;color:var(--isp-c-grey-weekdays);background:none;border:none;border-radius:5px;cursor:pointer;transition:background-color .1s ease-in-out}[_nghost-%COMP%]:hover{background-color:var(--isp-dc-mass-relay)}.icon[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-text-color-main);display:flex}.loader[_ngcontent-%COMP%]{--isp-loader__background: none;--isp-loader__size: 10px;--isp-loader__color: var(--isp-text-color-main)}"],changeDetection:0});let h=n;return h})();var Un=(()=>{let n=class n{transform(e,t,i="color"){return`${t}_${i}_${e}`}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=li({name:"colorMod",type:n,pure:!0});let h=n;return h})();var Ga=(()=>{let n=class n{constructor(e){this.colorModPipe=e}transform(e){let t="";return e&&(t=this.colorModPipe.transform(e,"table__cell")),t}};n.\u0275fac=function(t){return new(t||n)(tt(Un,16))},n.\u0275pipe=li({name:"cellColor",type:n,pure:!0});let h=n;return h})();var Xa=(()=>{let n=class n{transform(e){return e?"top-end":"top-start"}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=li({name:"getTooltipPosition",type:n,pure:!0});let h=n;return h})();var qa=(()=>{let n=class n{transform(e){return(e??"").replace(/<br\s*[/]?>/gi,`
`).replace(/(<([^>]+)>)/gi,"")}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=li({name:"hintHtmlFilter",type:n,pure:!0});let h=n;return h})();var Zh=["hiddenHead"],Jh=["*"],Ka=()=>({}),ed=h=>({event:"user_click_on_select_all_rows_by_checkbox",data:h}),td=h=>({event:"user_click_on_open_table_settings",data:h}),id=h=>({"table-th__filter-button_active":h}),nd=()=>["sort","msort"],sd=()=>({width:"15px",height:"15px"}),nn=()=>["top","bottom"],Ya=h=>({"table__cell-container__wrapped":h});function rd(h,n){if(h&1&&(Ke(0,"isp-visual-checkbox",24),Ne(1,"async"),Ne(2,"async")),h&2){let _=pe(3);ge("checked",Be(1,2,_.hasSomeSelection$))("minus",Be(2,4,_.hasPartSelection$))}}function od(h,n){if(h&1){let _=it();Ae(0,"button",30),Ge("click",function(t){Re(_);let i=pe().$implicit,r=pe(3);return De(r.openFilterDropdown(t,i.$name))}),Ke(1,"isp-svg-icon",31),Te()}if(h&2){let _=pe().$implicit;ge("ngClass",Kt(1,id,_.isFilterApplied))}}function ad(h,n){if(h&1&&(Ke(0,"isp-session-tip",33),Ne(1,"async")),h&2){let _=n.$implicit,e=pe(5);ge("name",_)("doc",Be(1,2,e.doc$))}}function ld(h,n){h&1&&(Mt(0),je(1,ad,2,4,"isp-session-tip",32),kt()),h&2&&(Ce(),ge("ngForOf",wt(1,nd)))}function cd(h,n){h&1&&Ke(0,"div",34)}function hd(h,n){if(h&1){let _=it();Ae(0,"th",25)(1,"span",26)(2,"isp-sort-indicator",27),Ne(3,"getTooltipPosition"),Ge("sortChange",function(t){Re(_);let i=pe(3);return De(i.handleSortEvent(t))}),je(4,od,2,3,"button",28),Te(),je(5,ld,2,2,"ng-container",9),Te(),je(6,cd,1,0,"div",29),Te()}if(h&2){let _=n.$implicit,e=n.last,t=n.index,i=pe().ngIf,r=pe(2);ti("width",r.editingColumn===_.$name&&r.expandEditingColumn?r.EDITING_COLUMN_MIN_WIDTH+"px":i[t+1])("min-width",_.$name===r.editingColumn?r.EDITING_COLUMN_MIN_WIDTH:r.colMinWidth,"px"),Ce(2),ge("sortable",_.$sort)("columnTitle",_.titleUi)("sortField",_.$name)("sortType",r.getSortType(_))("sortNumber",r.getSortNumber(_))("columnTooltip",_.hintUi)("columnTooltipPosition",Be(3,14,e)),Ce(2),ge("ngIf",_.hasFilterField),Ce(),ge("ngIf",t===1),Ce(),ge("ngIf",!e)}}function dd(h,n){if(h&1&&(Ke(0,"isp-filter-button",35),Ne(1,"async")),h&2){let _=n.ngIf,e=pe(3);ge("ispTooltip",Be(1,2,e.tableFiltersHint$))("filterFunc",_.$func)}}function ud(h,n){if(h&1&&Ke(0,"th",39),h&2){let _=n.$implicit,e=n.index,t=pe(3).ngIf,i=pe(2);ti("width",i.editingColumn===_.$name&&i.expandEditingColumn?i.EDITING_COLUMN_MIN_WIDTH+"px":t[e+1])("min-width",_.$name===i.editingColumn?i.EDITING_COLUMN_MIN_WIDTH:i.colMinWidth,"px")}}function pd(h,n){if(h&1){let _=it();Ae(0,"td",44),Ge("dblclick",function(t){Re(_);let i=pe().$implicit,r=pe(5);return De(r.handleRowButtonClick(t,i))}),Ae(1,"div",45),Ke(2,"isp-svg-icon",46),Ae(3,"span",47),_t(4),Te()()()}if(h&2){let _=pe().$implicit;Ce(2),ge("name",_.$img)("customStyle",wt(3,sd)),Ce(2),zt(_.text)}}function fd(h,n){if(h&1&&Ke(0,"isp-visual-checkbox",53),h&2){let _=pe(2).$implicit,e=pe(5);ge("checked",e.isSelected(_.elid))}}function gd(h,n){if(h&1&&(Ae(0,"div",64)(1,"div",65),Ke(2,"isp-svg-icon",66),Te()()),h&2){let _=pe(3).$implicit;Ce(),ge("ispTooltip",_.warning)("ispTooltipDirectionOrder",wt(2,nn))}}function md(h,n){if(h&1){let _=it();Mt(0),Ae(1,"isp-prop-list",67),Ne(2,"getTooltipPosition"),Ne(3,"async"),Ge("propClick",function(t){Re(_);let i=pe(8);return De(i.handlePropClick(t))}),Te(),kt()}if(h&2){let _=pe(),e=_.$implicit,t=_.last,i=pe(7);Ce(),ge("propList",e.propList)("tooltipPosition",Be(2,3,t))("func",Be(3,5,i.func$))}}function _d(h,n){if(h&1){let _=it();Ae(0,"a",68),Ne(1,"hintHtmlFilter"),Ge("click",function(){Re(_);let t=pe().$implicit,i=pe(2).$implicit,r=pe(5);return De(r.handleCellValueLinkClick(i.elid,t))}),Ke(2,"span",69),Te()}if(h&2){let _=pe().$implicit;ge("ispTooltip",Be(1,3,_.value))("ispTooltipDirectionOrder",wt(5,nn)),Ce(2),ge("innerHtml",_.value,Ji)}}function bd(h,n){if(h&1){let _=it();Mt(0),Ae(1,"isp-toggle",70,7),Ne(3,"getTooltipPosition"),Ge("click",function(t){Re(_);let i=Ct(2),r=pe().$implicit,m=pe(2).$implicit,o=pe(5);return De(o.handleToggleClick(t,i,m,r))}),Te(),kt()}if(h&2){let _=pe(),e=_.$implicit,t=_.last;Ce(),ge("ispTooltip",e.toggle.isDisabled?e.value==="on"?e.toggle.hintDisabledOn:e.toggle.hintDisabledOff:e.value==="on"?e.toggle.hintOn:e.toggle.hintOff)("ispTooltipPosition",Be(3,5,t))("ispTooltipDirectionOrder",wt(7,nn))("checked",e.value==="on")("disabled",e.toggle.isDisabled)}}function vd(h,n){if(h&1&&(Ke(0,"span",71),Ne(1,"cellColor"),Ne(2,"hintHtmlFilter")),h&2){let _=pe().$implicit;gs("table__data ",Be(1,7,_.color)," noescaping"),ge("ngClass",Kt(11,Ya,_.wrap))("innerHTML",_.value,Ji)("ispTooltip",Be(2,9,_.value))("ispTooltipDirectionOrder",wt(13,nn))}}function yd(h,n){if(h&1&&(Ae(0,"span",72),Ne(1,"cellColor"),Ne(2,"hintHtmlFilter"),_t(3),Te()),h&2){let _=pe().$implicit;gs("table__data ",Be(1,7,_.color),""),ge("ngClass",Kt(11,Ya,_.wrap))("ispTooltip",Be(2,9,_.value))("ispTooltipDirectionOrder",wt(13,nn)),Ce(3),zt(_.value)}}function Cd(h,n){if(h&1){let _=it();Ae(0,"button",77),Ne(1,"async"),Ge("click",function(t){Re(_);let i=pe(2).$implicit,r=Ct(1),m=pe(2).$implicit,o=pe(5);return De(o.openEditCell(t,m,i,r))}),Te()}if(h&2){let _=pe(9);ge("loading",Be(1,1,_.isEditCellLoading$))}}function wd(h,n){if(h&1){let _=it();Ae(0,"button",78),Ge("click",function(){Re(_);let t=pe(2).$implicit,i=pe(7);return De(i.handleFastFilter(t))}),Te()}}function Sd(h,n){if(h&1){let _=it();Mt(0),Ae(1,"button",79),Ge("click",function(){let t=Re(_).$implicit,i=pe(4).$implicit,r=pe(5);return De(r.handleCellButtonClick(i.elid,t))}),Te(),kt()}if(h&2){let _=n.$implicit;Ce(),ge("ispTooltip",_.tooltip)("icon",_.$img)}}function xd(h,n){if(h&1){let _=it();Ae(0,"span",73),Ge("dblclick",function(t){return Re(_),De(t.stopPropagation())}),je(1,Cd,2,3,"button",74)(2,wd,1,0,"button",75)(3,Sd,2,2,"ng-container",76),Te()}if(h&2){let _=pe().$implicit;Ce(),ge("ngIf",_.editFunc),Ce(),ge("ngIf",_.isFastFilterAvailable),Ce(),ge("ngForOf",_.buttons)}}function Ad(h,n){if(h&1&&Ke(0,"div",80),h&2){let _=pe().$implicit;Jr("--isp-table-indicator-width","",_.indicatorPercent,"%")}}function Pd(h,n){if(h&1&&(Ae(0,"td",54,6)(2,"div",55),je(3,gd,3,3,"div",56)(4,md,4,7,"ng-container",9),Mt(5,57),je(6,_d,3,6,"a",58)(7,bd,4,8,"ng-container",59)(8,vd,3,14,"span",60)(9,yd,4,14,"span",61),kt(),je(10,xd,4,3,"span",62),Te(),je(11,Ad,1,3,"div",63),Te()),h&2){let _=n.$implicit,e=n.last,t=n.first,i=pe(2).$implicit;oi("table__last_cell",e&&!t)("isp-table__td__wrapped",_.wrap),Ce(3),ge("ngIf",i.warning&&t),Ce(),ge("ngIf",_.canShowProps),Ce(),ge("ngSwitch",!0),Ce(),ge("ngSwitchCase",!!_.link),Ce(),ge("ngSwitchCase",!!_.toggle),Ce(),ge("ngSwitchCase",_.noEscaping),Ce(2),ge("ngIf",_.editFunc||_.isFastFilterAvailable||_.buttons),Ce(),ge("ngIf",_.indicatorPercent)}}function Ed(h,n){if(h&1){let _=it();Ae(0,"td",48),Ge("mousedown",function(t){Re(_);let i=pe().$implicit,r=pe(5);return De(r.handleItemCheckboxClick(i.elid,t))})("dblclick",function(t){return Re(_),De(t.stopPropagation())}),je(1,fd,1,1,"isp-visual-checkbox",49),Te(),je(2,Pd,12,12,"td",50),Ae(3,"td",51),Ke(4,"isp-list-item-menu",52),Te()}if(h&2){let _=pe().$implicit,e=pe(3).ngIf,t=pe(2);Ce(),ge("ngIf",e[0]!=="0"),Ce(),ge("ngForOf",_.cells)("ngForTrackBy",t.trackByFnCell),Ce(),ti("--isp-table__td_last_padding-x",10,"px"),Ce(),ge("elid",_.elid)("cacheKey",_.cacheKey)}}function Td(h,n){if(h&1){let _=it();Ae(0,"tr",42),Ge("mousedown",function(t){let i=Re(_).$implicit,r=pe(5);return De(!i.isRowButton&&i.elid&&r.select(i.elid,t))})("dblclick",function(t){let i=Re(_).$implicit,r=pe(5);return De(!i.isRowButton&&r.handleDbClickByRow(i.elid,t))}),je(1,pd,5,4,"td",43)(2,Ed,5,7,"ng-template",null,5,Ht),Te()}if(h&2){let _=n.$implicit,e=Ct(3),t=pe(5);Gr("table__row isp-table__row isp-table__row_bg_"+_.color),oi("isp-table__row_chosen",t.isSelected(_.elid)),ki("foldername",t.getFolderName(_)),Ce(),ge("ngIf",_.isRowButton)("ngIfElse",e)}}function Md(h,n){if(h&1){let _=it();Mt(0),Ae(1,"cdk-virtual-scroll-viewport",37),Ge("scrolledIndexChange",function(t){Re(_);let i=pe(4);return De(i.handleScrolledIndexChange(t))}),Ae(2,"div",null,3)(4,"table",38)(5,"thead")(6,"tr",null,4),Ke(8,"th",39),je(9,ud,1,4,"th",40),Ke(10,"th",39),Te()(),Ae(11,"tbody"),je(12,Td,4,7,"tr",41),Te()()()(),kt()}if(h&2){let _=pe().ngIf,e=pe().ngIf,t=pe().ngIf,i=pe();Ce(),ge("itemSize",i.itemSize)("minBufferPx",i.minBufferPx)("maxBufferPx",i.maxBufferPx),Ce(3),ti("--isp-table__border-radius",0,"px"),oi("isp-table_layout-auto",e[1]===void 0),Ce(4),ti("width",e[0]),Ce(),ge("ngForOf",t)("ngForTrackBy",i.trackByFnHeader),Ce(),ti("width",e[e.length-1]),Ce(2),ge("cdkVirtualForOf",_)("cdkVirtualForTemplateCacheSize",250)("cdkVirtualForTrackBy",i.trackByFn)}}function kd(h,n){if(h&1){let _=it();Ae(0,"table",83)(1,"tbody")(2,"tr",84),Ge("dblclick",function(t){let i=Re(_).ngIf,r=pe(5);return De(r.handleRowButtonClick(t,i))}),Ae(3,"td",85)(4,"div",45),Ke(5,"isp-svg-icon",86),Ae(6,"span",47),_t(7),Te()()()()()()}if(h&2){let _=n.ngIf;ti("--isp-table__border-radius",0,"px")("border-bottom","1px solid var(--isp-dc-charlie-chaplin)"),Ce(5),ge("name",_.$img),Ce(2),zt(_.text)}}function Ld(h,n){if(h&1){let _=it();je(0,kd,8,6,"table",81),Ae(1,"isp-empty-list-stub",82),Ne(2,"async"),Ge("buttonClick",function(t){Re(_);let i=pe(4);return De(i.emptyButtonClick.emit(t))}),Te()}if(h&2){let _=pe().ngIf,e=pe(3);ge("ngIf",_[0]),Ce(),ge("doc",Be(2,2,e.doc$))}}function Id(h,n){if(h&1&&(Mt(0),je(1,Md,13,16,"ng-container",36)(2,Ld,3,4,"ng-template",null,2,Ht),kt()),h&2){let _=n.ngIf,e=Ct(3),t=pe(3);Ce(),ge("ngIf",t.hasNormalRows(_))("ngIfElse",e)}}function Od(h,n){if(h&1){let _=it();Ae(0,"isp-table-resizer",13),Ge("columnResize",function(t){Re(_);let i=pe(2);return De(i.handleColResize(t))}),Ae(1,"div",14),Ne(2,"async"),Ae(3,"table",15)(4,"thead",16)(5,"tr",17)(6,"th",18),Ge("mousedown",function(){Re(_);let t=pe(2);return De(t.handleHeadCheckboxClick())}),je(7,rd,3,6,"isp-visual-checkbox",19),Te(),je(8,hd,7,16,"th",20),Ae(9,"th",21),je(10,dd,2,4,"isp-filter-button",22),Ne(11,"async"),Ae(12,"isp-svg-icon",23),Ne(13,"async"),Ge("click",function(){Re(_);let t=pe(2);return De(t.openTableSettings())}),Te()()()()()(),je(14,Id,4,2,"ng-container",9),Ne(15,"async"),Te()}if(h&2){let _=n.ngIf,e=pe().ngIf,t=pe();Ce(),ti("padding-right",Be(2,14,t.scrollBarWidthPx$),"px"),Ce(5),ti("width",_[0]),ge("ispMetric",Kt(23,ed,wt(22,Ka))),Ce(),ge("ngIf",_[0]!=="0"),Ce(),ge("ngForOf",e)("ngForTrackBy",t.trackByFnHeader),Ce(),ti("width",_[_.length-1]),Ce(),ge("ngIf",Be(11,16,t.filterButton$)),Ce(2),ge("ispTooltip",Be(13,18,t.tableSettingsHint$))("ispMetric",Kt(26,td,wt(25,Ka))),Ce(2),ge("ngIf",Be(15,20,t.rowList$))}}function Fd(h,n){if(h&1&&Ke(0,"isp-prop-list",88),h&2){let _=pe().$implicit;ge("propList",_.props)("showTooltip",!1)}}function Rd(h,n){if(h&1&&(Ae(0,"span",90),_t(1),Te()),h&2){let _=pe(2).$implicit;Ce(),jt(" ",_.textUI," ")}}function Dd(h,n){if(h&1&&je(0,Rd,2,1,"span",89),h&2){let _=pe().$implicit;ge("ngIf",_.canShow)}}function Nd(h,n){if(h&1&&(Mt(0),je(1,Fd,1,2,"isp-prop-list",87)(2,Dd,1,1,"ng-template",null,8,Ht),kt()),h&2){let _=n.$implicit,e=Ct(3);Ce(),ge("ngIf",_.props.length)("ngIfElse",e)}}function Bd(h,n){if(h&1&&(Ae(0,"div"),_t(1),je(2,Nd,4,2,"ng-container",76),Te()),h&2){let _=n.ngIf;Ce(),jt(" ",_.totalRows.localized," "),Ce(),ge("ngForOf",_.columns)}}function $d(h,n){if(h&1){let _=it();Ae(0,"isp-pagination",91),Ge("pageChange",function(t){Re(_);let i=pe(2);return De(i.handlePageEvent(t))}),Te()}if(h&2){let _=n.ngIf;ge("autoCurrPage",!1)("length",_.elementsAmount)("pageSizeList",_.pageSizeList)("pageSize",_.elementsPerPage)("currPage",_.currentPage)("perPageLabel",_.msg.perPage)("ofLabel",_.msg.of)}}function Vd(h,n){if(h&1&&(Mt(0),je(1,Od,16,28,"isp-table-resizer",10),Ne(2,"async"),Ae(3,"div",11),je(4,Bd,3,2,"div",9),Ne(5,"async"),je(6,$d,1,7,"isp-pagination",12),Ne(7,"async"),Te(),kt()),h&2){let _=pe();Ce(),ge("ngIf",Be(2,3,_.colWidthUI$)),Ce(3),ge("ngIf",Be(5,5,_.stat$)),Ce(2),ge("ngIf",Be(7,7,_.pager$))}}var Qa=(()=>{let n=class n{get scrollViewport$(){return(this.scrollViewportList.first?Zi(this.scrollViewportList):this.scrollViewportList.changes).pipe(Je(e=>e.first),Vt(e=>!!e))}constructor(e,t,i,r,m,o,u,d,v,T){this.tableService=e,this.colWidthService=t,this.cdr=i,this.metric=r,this.editCellService=m,this.columnFilterService=o,this.rowSelectionService=u,this.keydownService=d,this.tableToggleService=v,this.destroyRef=T,this.colMinWidth=this.colWidthService.COLUMN_MIN_WIDTH_PX,this.editingColumn="",this.expandEditingColumn=!1,this.EDITING_COLUMN_MIN_WIDTH=150,this.scrollBarWidthPx$=new st(0),this.colWidthUI$=this.colWidthService.colWidthUI$,this.doc$=this.tableService.doc$,this.func$=this.doc$.pipe(Je(A=>A?.$func)),this.filterButton$=this.tableService.filterButton$,this.columnList$=this.tableService.columnList$,this.tableSettingsHint$=this.doc$.pipe(Je(A=>nt.getMessage("msg_tsetting",A))),this.tableFiltersHint$=this.doc$.pipe(Je(A=>nt.getMessage("hint_filter",A))),this.isEditCellLoading$=this.editCellService.isLoading$,this.tab$=this.tableService.tab$,this.rowList$=this.tableService.rowList$,this.hasPartSelection$=this.rowSelectionService.hasPartSelection$,this.hasSomeSelection$=this.rowSelectionService.hasSomeSelection$,this.stat$=this.tableService.stat$,this.pager$=this.tableService.pager$,this.minBufferPx=1e3,this.maxBufferPx=1500,this.itemSize=35,this.rowButtonsNumber=0,this.rowButtonClick=new lt,this.propClick=new lt,this.sort=new lt,this.pager=new lt,this.rowDbClick=new lt,this.cellValueLinkClick=new lt,this.scrolledIndexChange=new lt,this.emptyButtonClick=new lt}updateBufferPx(){let e=document.body.offsetHeight,t=60,i=2;this.minBufferPx=e-t,this.maxBufferPx=this.minBufferPx+Math.round(this.minBufferPx/i)}bindHotkeys(){this.keydownService.listen$({code:"KeyA",ctrl:!0,shift:!0,context:"table"}).pipe(ct(this.destroyRef)).subscribe(e=>{e.preventDefault(),this.rowSelectionService.selectAllRows(),this.cdr.markForCheck()})}bindEnterKey(){this.keydownService.listen$({code:"Enter",context:"table"}).pipe(ct(this.destroyRef)).subscribe(e=>{e.preventDefault();let t=this.rowSelectionService.selectedElidsList;t.length===1&&this.rowDbClick.emit(t[0])})}bindArrowKeys(){Ft([this.keydownService.listen$({code:"ArrowUp",context:"table"}),this.scrollViewport$]).pipe(ct(this.destroyRef)).subscribe(([e,t])=>{e.preventDefault(),this.rowSelectionService.selectPreviousRow(e.shiftKey),this.scrollToTopLastSelectedRow(t),this.cdr.markForCheck()}),Ft([this.keydownService.listen$({code:"ArrowDown",context:"table"}),this.scrollViewport$]).pipe(ct(this.destroyRef)).subscribe(([e,t])=>{e.preventDefault(),this.rowSelectionService.selectNextRow(e.shiftKey),this.scrollToBottomLastSelectedRow(t),this.cdr.markForCheck()})}scrollToTopLastSelectedRow(e){e.checkViewportSize();let t=e.measureScrollOffset(),i=Math.ceil(t/this.itemSize)-this.rowButtonsNumber,r=this.rowSelectionService.lastSelectedRowIndex;r<=i&&e.scrollToIndex(i<=0?0:r+this.rowButtonsNumber)}scrollToBottomLastSelectedRow(e){e.checkViewportSize();let t=Math.floor(e.getViewportSize()/this.itemSize)-this.rowButtonsNumber,i=e.measureScrollOffset(),r=t*this.itemSize,m=Math.floor((i+r)/this.itemSize),o=this.rowSelectionService.lastSelectedRowIndex;o>=m&&e.scrollToOffset(this.itemSize*(o+1)-r)}subscribeWindowResize(){Ft([this.scrollViewport$,Tt(window,"resize")]).pipe(ri(20),ct(this.destroyRef)).subscribe(([e])=>{this.updateBufferPx(),this.updateScrollbarWidth(e.elementRef.nativeElement),setTimeout(()=>{let t=this.hiddenHead.first?.nativeElement;t&&this.colWidthService.fixMinWidth(t)},200)})}updateScrollbarWidth(e){let t=e.offsetWidth-2-e.clientWidth;this.scrollBarWidthPx$.next(t),this.colWidthService.updateMenuCellWidth(t)}subscribeRowListResize(){Ft([this.scrollViewport$,this.rowList$.pipe(Zt((e,t)=>e.length===t.length))]).pipe(ri(20),ct(this.destroyRef)).subscribe(([e])=>{this.updateBufferPx(),this.updateScrollbarWidth(e.elementRef.nativeElement)})}subscribeToTabScroll(){Ft([this.tab$.pipe(Je(e=>e.state.listScroll),Zt()),this.scrollViewport$,this.rowList$]).subscribe(([e,t])=>{t.scrollToIndex(e>0?e:0)})}ngOnInit(){this.bindHotkeys(),this.bindEnterKey(),this.updateBufferPx(),this.rowList$.pipe(mt(e=>{this.rowButtonsNumber=e.filter(t=>t.isRowButton).length}),Zt((e,t)=>e.length===t.length),ct(this.destroyRef)).subscribe()}initColWidthService(){(this.hiddenHead.first?Zi(this.hiddenHead):this.hiddenHead.changes).pipe(Qt(1),mt(()=>this.colWidthService.init(this.hiddenHead)),ct(this.destroyRef)).subscribe()}ngAfterViewInit(){this.subscribeWindowResize(),this.subscribeRowListResize(),this.bindArrowKeys(),this.subscribeToTabScroll(),this.initColWidthService()}openTableSettings(){this.tableService.openTableSettings()}handleRowButtonClick(e,t){this.rowButtonClick.emit({target:e.target,btn:t})}handleToggleClick(e,t,i,r){if(e.preventDefault(),e.stopPropagation(),t.disabled)return;let m=r.value==="on";this.tableToggleService.toggleCell$({row:i,cell:r,state:!m}).subscribe(o=>{r.value=o?"on":"off",t.checked=o,this.cdr.detectChanges(),this.rowSelectionService.checkAndUpdateSelection()})}handleFastFilter(e){this.tableService.handleFastFilter(e)}hasNormalRows(e){return e.length>1||e.length===1&&!e[0].isRowButton}handleColResize(e){let t=e.colWidths.slice(1,-1);this.tableService.saveColWidth(t.map(i=>parseFloat(i))),this.colWidthService.setServerColWidth(t),this.tab$.pipe(Je(i=>i.func),Qt(1)).subscribe(i=>{this.metric.append({event:"user_resize_column_on_table",data:{func:i,colIndex:e.leverColIndex}})})}handleDbClickByRow(e,t){Ra(),t.preventDefault(),this.rowDbClick.emit(e)}handleSortEvent(e){this.sort.emit(e)}handlePageEvent(e){e.isFromUI&&this.pager.emit(e)}handlePropClick(e){this.propClick.emit(e)}handleCellButtonClick(e,t){this.propClick.emit({prop:t,elid:e})}getSortType(e){return sa(e)}getSortNumber(e){return this.tableService.getSortNumber(e)}isSelected(e){return this.rowSelectionService.isRowSelected(e)}handleItemCheckboxClick(e,t){t.stopPropagation(),this.rowSelectionService.selectRow(e,!0)}select(e,t){let i=t.ctrlKey||t.metaKey,r=t.shiftKey;this.rowSelectionService.selectRow(e,i,r),(i||r)&&(t.stopPropagation(),t.preventDefault())}trackByFn(e,t){return`${t.elid}${t.cacheKey}${e}`}trackByFnHeader(e,t){return`${t.$name}${e}`}trackByFnCell(e,t){return`${t.name}${t.type}${e}`}handleScrolledIndexChange(e){this.scrolledIndexChange.emit(e)}handleCellValueLinkClick(e,t){this.cellValueLinkClick.next({elid:e,cell:t})}handleHeadCheckboxClick(){this.rowSelectionService.selectAllRows()}openEditCell(e,t,i,r){this.editingColumn=i.name,r.offsetWidth<this.EDITING_COLUMN_MIN_WIDTH&&(this.expandEditingColumn=!0),this.cdr.markForCheck(),this.editCellDropdown.openForm({cellElement:e.target.closest("td.isp-table__td"),elid:t.elid,func:i.editFunc,columnName:i.name,selection:i.editSelection}),this.editCellDropdown.isOpen$.pipe(Br(),Vt(([m,o])=>m&&!o)).subscribe(()=>{this.editingColumn="",this.expandEditingColumn=!1,this.cdr.markForCheck()})}openFilterDropdown(e,t){e.preventDefault(),this.columnFilterService.openDropdown(t,e.target.closest(".table-th__filter-button"))}getFolderName(e){return e.cells?.reduce((t,i)=>t||(i.propList?.some(r=>r.value==="dir"||r.value==="linkdir")?e.elid:void 0),void 0)}};n.\u0275fac=function(t){return new(t||n)(tt(ji),tt($n),tt(bi),tt(Vi),tt(Wi),tt(Ai),tt(Si),tt(vi),tt(zn),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-table"]],viewQuery:function(t,i){if(t&1&&(Dt(Vn,5),Dt(Bn,5),Dt(Zh,5),Dt(kn,5)),t&2){let r;It(r=Ot())&&(i.editCellDropdown=r.first),It(r=Ot())&&(i.columnFilterDropdown=r.first),It(r=Ot())&&(i.hiddenHead=r),It(r=Ot())&&(i.scrollViewportList=r)}},outputs:{rowButtonClick:"rowButtonClick",propClick:"propClick",sort:"sort",pager:"pager",rowDbClick:"rowDbClick",cellValueLinkClick:"cellValueLinkClick",scrolledIndexChange:"scrolledIndexChange",emptyButtonClick:"emptyButtonClick"},features:[eo([$n])],ngContentSelectors:Jh,decls:7,vars:3,consts:[["editCellDropdown",""],["columnDropdown",""],["stub",""],["bodyTableWrapper",""],["hiddenHead",""],["normalRow",""],["bodyCell",""],["toggle",""],["total",""],[4,"ngIf"],["class","table-container table-container_overflow-hidden",3,"columnResize",4,"ngIf"],[1,"isp-table-footer","table__footer"],["class","table__pagination",3,"autoCurrPage","length","pageSizeList","pageSize","currPage","perPageLabel","ofLabel","pageChange",4,"ngIf"],[1,"table-container","table-container_overflow-hidden",3,"columnResize"],[1,"table__head-container"],[1,"isp-table","table__head-table"],[1,"isp-table__head"],[1,"isp-table__head-row","isp-table-resizer__control-head-row"],["ispTableResizerTh","",1,"isp-table__th","table__checkbox-cell","isp-table-resizer__control-th_fixed",3,"mousedown","ispMetric"],["class","table__checkbox",3,"checked","minus",4,"ngIf"],["ispTableResizerTh","","class","isp-table__th isp-table-resizer__control-th isp-table-resizer__control-th_relative table-th",3,"width","minWidth",4,"ngFor","ngForOf","ngForTrackBy"],["ispTableResizerTh","",1,"isp-table__th","isp-table__th_align-right","table-th_last","isp-table-resizer__control-th_fixed"],["class","table-th__main-filters-button","ispTooltipPosition","top-end",3,"ispTooltip","filterFunc",4,"ngIf"],["name","miniset-grey","ispTooltipPosition","top-end",1,"table__settings-icon",3,"click","ispTooltip","ispMetric"],[1,"table__checkbox",3,"checked","minus"],["ispTableResizerTh","",1,"isp-table__th","isp-table-resizer__control-th","isp-table-resizer__control-th_relative","table-th"],[1,"table-th__content"],[1,"table-th__sort-indicator",3,"sortChange","sortable","columnTitle","sortField","sortType","sortNumber","columnTooltip","columnTooltipPosition"],["class","table-th__filter-button","type","button",3,"ngClass","click",4,"ngIf"],["class","isp-table-resizer__lever",4,"ngIf"],["type","button",1,"table-th__filter-button",3,"click","ngClass"],["name","filter"],["resizeSelector","#layout-main-page","class","table-th__sort-tip",3,"name","doc",4,"ngFor","ngForOf"],["resizeSelector","#layout-main-page",1,"table-th__sort-tip",3,"name","doc"],[1,"isp-table-resizer__lever"],["ispTooltipPosition","top-end",1,"table-th__main-filters-button",3,"ispTooltip","filterFunc"],[4,"ngIf","ngIfElse"],[1,"table-viewport","table-body-tooltip-parent","ispui-scrollbar_gray",3,"scrolledIndexChange","itemSize","minBufferPx","maxBufferPx"],[1,"isp-table","isp-table_no-footer","table__table"],[1,"isp-table__hidden-th"],["class","isp-table__hidden-th",3,"width","minWidth",4,"ngFor","ngForOf","ngForTrackBy"],[3,"class","isp-table__row_chosen","mousedown","dblclick",4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTemplateCacheSize","cdkVirtualForTrackBy"],[3,"mousedown","dblclick"],["class","table__single-button-td isp-table__td","colspan","20",3,"dblclick",4,"ngIf","ngIfElse"],["colspan","20",1,"table__single-button-td","isp-table__td",3,"dblclick"],[1,"table__single-button-wrapper"],[3,"name","customStyle"],[1,"table__single-button-text"],[1,"isp-table__td","table__checkbox-cell",3,"mousedown","dblclick"],["class","table__checkbox",3,"checked",4,"ngIf"],["class","isp-table__td",3,"table__last_cell","isp-table__td__wrapped",4,"ngFor","ngForOf","ngForTrackBy"],[1,"isp-table__td","isp-table__td_align-right"],[1,"table__item-menu",3,"elid","cacheKey"],[1,"table__checkbox",3,"checked"],[1,"isp-table__td"],[1,"table__cell-container"],["class","table__row-warning",4,"ngIf"],[3,"ngSwitch"],["ispTooltipEllipsis","","ispTooltipViewportSelector",".table-body-tooltip-parent","class","table__data table__link","type","default-hover",3,"ispTooltip","ispTooltipDirectionOrder","click",4,"ngSwitchCase"],[4,"ngSwitchCase"],["ispTooltipEllipsis","","ispTooltipViewportSelector",".table-body-tooltip-parent",3,"class","ngClass","innerHTML","ispTooltip","ispTooltipDirectionOrder",4,"ngSwitchCase"],["ispTooltipEllipsis","","ispTooltipViewportSelector",".table-body-tooltip-parent",3,"class","ngClass","ispTooltip","ispTooltipDirectionOrder",4,"ngSwitchDefault"],["class","table__cell-buttons",3,"dblclick",4,"ngIf"],["class","table__indicator",3,"--isp-table-indicator-width",4,"ngIf"],[1,"table__row-warning"],["ispTooltipViewportSelector",".table-body-tooltip-parent",3,"ispTooltip","ispTooltipDirectionOrder"],["name","p-error"],[1,"table__row-proplist",3,"propClick","propList","tooltipPosition","func"],["ispTooltipEllipsis","","ispTooltipViewportSelector",".table-body-tooltip-parent","type","default-hover",1,"table__data","table__link",3,"click","ispTooltip","ispTooltipDirectionOrder"],[3,"innerHtml"],["ispTooltipViewportSelector",".table-body-tooltip-parent",3,"click","ispTooltip","ispTooltipPosition","ispTooltipDirectionOrder","checked","disabled"],["ispTooltipEllipsis","","ispTooltipViewportSelector",".table-body-tooltip-parent",3,"ngClass","innerHTML","ispTooltip","ispTooltipDirectionOrder"],["ispTooltipEllipsis","","ispTooltipViewportSelector",".table-body-tooltip-parent",3,"ngClass","ispTooltip","ispTooltipDirectionOrder"],[1,"table__cell-buttons",3,"dblclick"],["ispCellButton","","icon","pencil","type","button",3,"loading","click",4,"ngIf"],["ispCellButton","","icon","filter","type","button",3,"click",4,"ngIf"],[4,"ngFor","ngForOf"],["ispCellButton","","icon","pencil","type","button",3,"click","loading"],["ispCellButton","","icon","filter","type","button",3,"click"],["ispCellButton","","ispTooltipPosition","top-middle","type","button",3,"click","ispTooltip","icon"],[1,"table__indicator"],["class","isp-table isp-table_no-footer",3,"--isp-table__border-radius","borderBottom",4,"ngIf"],[3,"buttonClick","doc"],[1,"isp-table","isp-table_no-footer"],[1,"isp-table__row",3,"dblclick"],["colspan","20",1,"table__single-button-td","isp-table__td"],[3,"name"],["class","table__stat table__stat_vertically-corrected",3,"propList","showTooltip",4,"ngIf","ngIfElse"],[1,"table__stat","table__stat_vertically-corrected",3,"propList","showTooltip"],["class","table__stat",4,"ngIf"],[1,"table__stat"],[1,"table__pagination",3,"pageChange","autoCurrPage","length","pageSizeList","pageSize","currPage","perPageLabel","ofLabel"]],template:function(t,i){t&1&&(bn(),je(0,Vd,8,9,"ng-container",9),Ne(1,"async"),Ke(2,"isp-edit-cell-dropdown",null,0)(4,"isp-column-filter-dropdown",null,1),vn(6)),t&2&&ge("ngIf",Be(1,1,i.columnList$))},dependencies:[Cn,Jt,St,wn,Sn,no,Va,xo,Ao,kn,Wt,pa,jo,ja,Wa,Fn,Vn,Bn,ua,da,Eo,ni,jn,Ua,Wn,Ha,xt,Ga,Xa,qa],styles:['.table__filter-button[_ngcontent-%COMP%]{position:relative;display:inline-block}.table__single-button-td[_ngcontent-%COMP%]{padding-left:10px;border-bottom:1px solid var(--isp-dc-charlie-chaplin)}.table__single-button-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;margin-left:5px}.table__single-button-text[_ngcontent-%COMP%]{margin-left:12px;color:var(--isp-dc-fremen);cursor:default}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .table__cell_color_red[_ngcontent-%COMP%]{color:var(--isp-dc-bright-emotions)}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .table__cell_color_green[_ngcontent-%COMP%]{color:var(--isp-c-grasshopper)}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .table__cell_color_blue[_ngcontent-%COMP%]{color:var(--isp-dc-fremen)}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .table__cell_color_yellow[_ngcontent-%COMP%]{color:var(--isp-c-c-3po)}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .table__cell_color_cyan[_ngcontent-%COMP%]{color:var(--isp-c-grasshopper)}.table__link[_ngcontent-%COMP%]{color:var(--isp-dc-highway-star);text-decoration:underline}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .table__link[_ngcontent-%COMP%]{color:var(--isp-dc-fremen)}.table__cell-container[_ngcontent-%COMP%]{display:flex;align-items:center;overflow:hidden}.table__data[_ngcontent-%COMP%]:not(:first-child):not(:empty):not([hidden] + *)[_ngcontent-%COMP%]{margin-left:10px}.table__last_cell[_ngcontent-%COMP%] .table__toggle[_ngcontent-%COMP%]{display:block;width:max-content}.table__cell-container__wrapped[_ngcontent-%COMP%]{padding-top:8px;padding-bottom:8px;white-space:pre-line}.table__item-menu[_ngcontent-%COMP%]{position:relative;top:2px}.table__cell-buttons[_ngcontent-%COMP%]{position:absolute;display:flex;margin-left:auto;-webkit-user-select:none;user-select:none;visibility:hidden}.isp-table__td[_ngcontent-%COMP%]:hover .table__cell-buttons[_ngcontent-%COMP%]{position:relative;visibility:visible}.table__checkbox-cell[_ngcontent-%COMP%]{padding-right:0;padding-left:15px}.table__checkbox-cell[_ngcontent-%COMP%]:empty{padding-left:0}.table__checkbox-cell[_ngcontent-%COMP%]:empty + .isp-table__th[_ngcontent-%COMP%], .table__checkbox-cell[_ngcontent-%COMP%]:empty + .isp-table__td[_ngcontent-%COMP%]{padding-left:15px}.table__checkbox[_ngcontent-%COMP%]{--isp-visual-checkbox-unchecked-bc: var(--isp-dc-monochrome);cursor:pointer}.table-footer[_ngcontent-%COMP%]{position:relative;width:100%;background:var(--isp-c-jon-snow)}.table-footer[_ngcontent-%COMP%]:before{position:absolute;top:0;left:-40px;content:"";width:calc(100vw - var(--isp-full-sidebar-width));height:1px;background-color:var(--isp-c-inconspicuous)}.table__pagination[_ngcontent-%COMP%]{margin-left:auto}.table__stat[_ngcontent-%COMP%]{--isp-prop-list__column-gap: 10px;margin-left:10px}.table__stat_vertically-corrected[_ngcontent-%COMP%]{position:relative;top:3px;display:inline-flex}.table__indicator[_ngcontent-%COMP%]{position:relative;width:45%;height:4px;margin-top:5px;background-color:var(--isp-dc-charlie-chaplin);border-radius:var(--isp-border-radius-main)}.table__indicator[_ngcontent-%COMP%]:before{position:absolute;display:block;content:"";width:var(--isp-table-indicator-width, 0);height:4px;background-color:var(--isp-dc-bright-emotions);border-radius:var(--isp-border-radius-main)}[_nghost-%COMP%] .cdk-virtual-scroll-content-wrapper{will-change:contents;max-width:100%}.table__table[_ngcontent-%COMP%]{border:none;border-color:var(--isp-dc-charlie-chaplin)}.table-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-grow:1;height:100%}.table-viewport[_ngcontent-%COMP%]{flex-grow:1;width:100%;height:100%;min-height:300px;overflow-x:hidden;overflow-y:auto;border:1px solid var(--isp-dc-charlie-chaplin);border-top:none;border-bottom:none;will-change:scroll-position}.isp-table-settings-container[_ngcontent-%COMP%]{position:relative;display:flex}.table-container_overflow-hidden[_ngcontent-%COMP%]{overflow:hidden}.table__row-warning[_ngcontent-%COMP%]{position:relative;top:3px;display:inline-block}.table__row-proplist[_ngcontent-%COMP%]{display:inline-flex} .table__highlight{background-color:var(--isp-c-happy-bob)}.table-body-tooltip-parent[_ngcontent-%COMP%]{position:relative}.table-tooltip-wrapper[_ngcontent-%COMP%]{display:contents}.table__settings-icon[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-c-grey-weekdays);display:inline-flex;align-items:center;justify-content:center;height:25px;padding:0 3px;margin-left:2px;font-family:inherit;color:var(--isp-c-grey-weekdays);background:none;border:none;border-radius:5px;cursor:pointer;transition:background-color .1s ease-in-out}.table__settings-icon[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-norilsk)}.table-th[_ngcontent-%COMP%]{white-space:nowrap}.table-th__content[_ngcontent-%COMP%]{display:flex;align-items:center;max-width:100%;overflow:hidden}.table-th__title[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.table-th__title[_ngcontent-%COMP%]:focus-visible{border-bottom:1px dashed currentColor;outline:none}.table-th__filter-button[_ngcontent-%COMP%]{--isp-icons-main-color: currentColor;display:inline-flex;align-items:center;justify-content:center;height:25px;padding:0 3px;font-family:inherit;color:inherit;background:none;border:none;border-radius:5px;cursor:pointer;transition:background-color .1s ease-in-out}.table-th__filter-button[_ngcontent-%COMP%]:hover{background-color:var(--isp-dc-norilsk)}.table-th__filter-button_active[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-dc-fremen);color:var(--isp-dc-fremen);background-color:var(--isp-dc-norilsk)}.table-th__filter-button[_ngcontent-%COMP%]:not(.table-th__filter-button_active){width:0;padding:0;opacity:0}.table-th__sort-indicator[_ngcontent-%COMP%]:hover .table-th__filter-button[_ngcontent-%COMP%], .table-th__sort-indicator[_ngcontent-%COMP%] .table-th__filter-button[_ngcontent-%COMP%]:focus-visible{width:auto;padding:0 3px;opacity:1}.table-th__sort-tip[_ngcontent-%COMP%]{position:absolute;bottom:3px;left:0;width:100%;height:0}.table-th_last[_ngcontent-%COMP%]{padding-left:0;white-space:nowrap}.table-th__main-filters-button[_ngcontent-%COMP%], .table-th__settings-button[_ngcontent-%COMP%]{position:relative;display:inline-block}.table-th__settings-button[_ngcontent-%COMP%]{margin-left:2px}.table__head-container[_ngcontent-%COMP%]{--isp-table__border: none;border:1px solid var(--isp-dc-charlie-chaplin);border-bottom:none;border-radius:5px 5px 0 0}'],changeDetection:0});let h=n;return h})();var jd=()=>({ctrl:!0,shift:!0,code:"KeyF"}),Za=(()=>{let n=class n{constructor(e,t,i){this.messageBusService=e,this.cdr=t,this.destroyRef=i,this.searchType=new lt,this.value="",this.minimumQueryLength=2}ngOnInit(){this.messageBusService.on$("update-list-search-value").pipe(ct(this.destroyRef)).subscribe(e=>{this.value=e.payload,this.cdr.markForCheck()})}handleType(e){let t=e.length<this.minimumQueryLength?"":e;this.searchType.emit(t)}};n.\u0275fac=function(t){return new(t||n)(tt(Pn),tt(bi),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-list-searchbar"]],outputs:{searchType:"searchType"},decls:1,vars:3,consts:[["placeholder","Ctrl + Shift + F",3,"customInput","focusShortcut","value"]],template:function(t,i){t&1&&(Ae(0,"isp-searchbar",0),Ge("customInput",function(m){return i.handleType(m)}),Te()),t&2&&ge("focusShortcut",wt(2,jd))("value",i.value)},dependencies:[Zo],styles:["[_nghost-%COMP%]{--isp-searchbar-bc: var(--isp-dc-norilsk)}"],changeDetection:0});let h=n;return h})();var Ja=(()=>{let n=class n{set item(e){this.src$.next(`/mancgi/${e.cgi}?elid=${e.path}`),this.img&&(this.toggleImgVisibility(!1),this.toggleSizeTransition(!1),this.img.style.maxWidth="100%",this.img.style.maxHeight="calc(100% - var(--isp-gallery-footer-height))")}constructor(){this.ZOOM_MULTIPLIER_BIG=1.2,this.ZOOM_MULTIPLIER_SMALL=1.1,this.FOOTER_HEIGHT=60,this.isImageDragging=!1,this.zoomAnchor={x:0,y:0},this.imgCursorPositionPC={x:0,y:0},this.imgMousedownOffset={x:0,y:0},this.imgMouseDragOffsetLimits={minX:0,maxX:0,minY:0,maxY:0},this.imgMousedownCursorPosition={x:0,y:0},this.src$=new st(""),this.encodedSrc$=this.src$.pipe(Je(e=>e.replace(/#/g,"%23"))),this.load=new lt,this.zoomInLock=new lt,this.zoomOutLock=new lt,this.mouseMoveHandler=e=>{if(this.isImageDragging){this.handleImageDrag(e);return}this.updateZoomPoints(e)},this.mouseUpHandler=()=>{this.isImageDragging=!1,this.img&&(this.img.style.cursor="default")},this.imgResizeObserver=new ResizeObserver(e=>{e.forEach(t=>this.handleImageResize(t.target))}),document.addEventListener("mouseup",this.mouseUpHandler),document.addEventListener("mousemove",this.mouseMoveHandler)}handleImageDrag(e){let t={x:e.clientX-this.imgMousedownCursorPosition.x,y:e.clientY-this.imgMousedownCursorPosition.y},i=this.imgMouseDragOffsetLimits,r={x:Math.max(i.minX,Math.min(i.maxX,t.x)),y:Math.max(i.minY,Math.min(i.maxY,t.y))},m={x:this.imgMousedownOffset.x+r.x,y:this.imgMousedownOffset.y+r.y};this.img.style.setProperty("--isp-gallery-image-view-image-offset-x",`${m.x}px`),this.img.style.setProperty("--isp-gallery-image-view-image-offset-y",`${m.y}px`)}updateZoomPoints(e){if(!this.img)return;e.target===this.img?(this.zoomAnchor.x=e.clientX,this.zoomAnchor.y=e.clientY):this.setAutoZoomAnchor();let t=this.img.getBoundingClientRect();this.imgCursorPositionPC.x=(this.zoomAnchor.x-t.left)*100/t.width,this.imgCursorPositionPC.y=(this.zoomAnchor.y-t.top)*100/t.height}handleImageResize(e){let t=e.getBoundingClientRect(),i={x:t.left+t.width/100*this.imgCursorPositionPC.x,y:t.top+t.height/100*this.imgCursorPositionPC.y},r={x:this.zoomAnchor.x-i.x,y:this.zoomAnchor.y-i.y},m=getComputedStyle(e),o=parseFloat(m.getPropertyValue("--isp-gallery-image-view-image-offset-x"))||0,u=parseFloat(m.getPropertyValue("--isp-gallery-image-view-image-offset-y"))||0;e.style.setProperty("--isp-gallery-image-view-image-offset-x",`${o+r.x}px`),e.style.setProperty("--isp-gallery-image-view-image-offset-y",`${u+r.y}px`);let d=e.parentElement.getBoundingClientRect();if(t.width<=d.width&&t.height<=d.height-this.FOOTER_HEIGHT){let v="isp-gallery-image-view__image_transition_position";e.classList.add(v),e.style.setProperty("--isp-gallery-image-view-image-offset-x","0.1px"),e.style.setProperty("--isp-gallery-image-view-image-offset-y","0.1px"),e.addEventListener("transitionend",()=>e.classList.remove(v),{once:!0})}}handleWheelEvent(e){e.deltaY<0?this.zoomIn(!1):this.zoomOut(!1)}setAutoZoomAnchor(){if(!this.img)return;let e=this.img.parentElement.getBoundingClientRect();this.zoomAnchor.x=e.left+e.width/2,this.zoomAnchor.y=e.top+(e.height-this.FOOTER_HEIGHT)/2}togglePending(e){this.toggleImgVisibility(!e),this.toggleSizeTransition(!e)}handleLoad(e){this.load.emit(),this.img=e,this.setAutoZoomAnchor(),this.imgCursorPositionPC.x=50,this.imgCursorPositionPC.y=50,this.togglePending(!1),this.imgResizeObserver.observe(e),this.zoomInLock.emit(e.width>=e.naturalWidth),this.zoomOutLock.emit(!0)}toggleSizeTransition(e){this.img?.classList?.[e?"add":"remove"]("isp-gallery-image-view__image_transition_size")}toggleImgVisibility(e){this.img?.classList?.[e?"remove":"add"]("isp-gallery-image-view__image_transparent")}zoomIn(e=!0){this.toggleSizeTransition(e);let t=this.ZOOM_MULTIPLIER_BIG;e||(t=this.ZOOM_MULTIPLIER_SMALL);let i=Math.min(this.img.width*t,this.img.naturalWidth),r=Math.min(this.img.height*t,this.img.naturalHeight);this.img.style.maxWidth=`${i}px`,this.img.style.maxHeight=`${r}px`,this.zoomInLock.emit(i===this.img.naturalWidth),this.zoomOutLock.emit(!1)}zoomOut(e=!0){this.toggleSizeTransition(e);let t=this.ZOOM_MULTIPLIER_BIG;e||(t=this.ZOOM_MULTIPLIER_SMALL);let i=this.img.parentElement.offsetHeight-this.FOOTER_HEIGHT,r=this.img.parentElement.offsetWidth,m=Math.max(this.img.width/t,r),o=Math.max(this.img.height/t,i);this.img.style.maxWidth=`${m}px`,this.img.style.maxHeight=`${o}px`,this.zoomInLock.emit(!1),this.zoomOutLock.emit(o===i&&m===r)}ngOnDestroy(){this.imgResizeObserver.disconnect(),document.removeEventListener("mouseup",this.mouseUpHandler),document.removeEventListener("mousemove",this.mouseMoveHandler)}handleImgMousedown(e){let t=e.target,i=t.getBoundingClientRect(),r=t.parentElement.getBoundingClientRect();this.imgMouseDragOffsetLimits={minX:Math.min(r.right-i.right,0),maxX:Math.max(r.left-i.left,0),minY:Math.min(r.bottom-i.bottom,0),maxY:Math.max(r.top-i.top,0)},this.isImageDragging=!0,this.imgMousedownCursorPosition={x:e.clientX,y:e.clientY};let m=getComputedStyle(t);this.imgMousedownOffset={x:parseFloat(m.getPropertyValue("--isp-gallery-image-view-image-offset-x"))||0,y:parseFloat(m.getPropertyValue("--isp-gallery-image-view-image-offset-y"))||0},t.style.cursor="move"}handleZoomIn(){this.zoomIn(!0)}handleZoomOut(){this.zoomOut(!0)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ut({type:n,selectors:[["isp-gallery-image-view"]],hostBindings:function(t,i){t&1&&Ge("wheel",function(m){return i.handleWheelEvent(m)})},inputs:{item:"item"},outputs:{load:"load",zoomInLock:"zoomInLock",zoomOutLock:"zoomOutLock"},decls:3,vars:3,consts:[["img",""],["draggable","false","alt","",1,"isp-gallery-image-view__image",3,"load","mousedown","src"]],template:function(t,i){if(t&1){let r=it();Ae(0,"img",1,0),Ne(2,"async"),Ge("load",function(){Re(r);let o=Ct(1);return De(i.handleLoad(o))})("mousedown",function(o){return Re(r),De(i.handleImgMousedown(o))}),Te()}t&2&&ge("src",Be(2,1,i.encodedSrc$),Ur)},dependencies:[xt],styles:["[_nghost-%COMP%]{-webkit-user-select:none;user-select:none}.isp-gallery-image-view__image[_ngcontent-%COMP%]{position:absolute;top:calc(50% - var(--isp-gallery-footer-height) / 2 + var(--isp-gallery-image-view-image-offset-y, 0px));left:calc(50% + var(--isp-gallery-image-view-image-offset-x, 0px));max-width:100%;max-height:calc(100% - var(--isp-gallery-footer-height));transform:translate3d(-50%,-50%,0)}.isp-gallery-image-view__image_transition_size[_ngcontent-%COMP%]{transition-property:max-width,max-height;transition-duration:.5s}.isp-gallery-image-view__image_transition_position[_ngcontent-%COMP%]{transition-property:top,left;transition-duration:.3s;transition-timing-function:ease-in}.isp-gallery-image-view__image_transparent[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0});let h=n;return h})();var qt=ps(Ol(),1),Gt=ps(sc(),1);var Hd=["pdfViewerContainer"];function Gd(h,n){let _=new h.EventBus;return Xd(_,n),_}function Xd(h,n){Tt(h,"documentload").pipe(Pt(n)).subscribe(()=>{let _=document.createEvent("CustomEvent");_.initCustomEvent("documentload",!0,!0,{}),window.dispatchEvent(_)}),Tt(h,"pagerendered").pipe(Pt(n)).subscribe(({pageNumber:_,cssTransform:e,source:t})=>{let i=document.createEvent("CustomEvent");i.initCustomEvent("pagerendered",!0,!0,{pageNumber:_,cssTransform:e}),t.div.dispatchEvent(i)}),Tt(h,"textlayerrendered").pipe(Pt(n)).subscribe(({pageNumber:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("textlayerrendered",!0,!0,{pageNumber:_}),e.textLayerDiv?.dispatchEvent(t)}),Tt(h,"pagechanging").pipe(Pt(n)).subscribe(({pageNumber:_,source:e})=>{let t=document.createEvent("UIEvents");t.initEvent("pagechanging",!0,!0),t.pageNumber=_,e.container.dispatchEvent(t)}),Tt(h,"pagesinit").pipe(Pt(n)).subscribe(({source:_})=>{let e=document.createEvent("CustomEvent");e.initCustomEvent("pagesinit",!0,!0,null),_.container.dispatchEvent(e)}),Tt(h,"pagesloaded").pipe(Pt(n)).subscribe(({pagesCount:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("pagesloaded",!0,!0,{pagesCount:_}),e.container.dispatchEvent(t)}),Tt(h,"scalechange").pipe(Pt(n)).subscribe(({scale:_,presetValue:e,source:t})=>{let i=document.createEvent("UIEvents");i.initEvent("scalechange",!0,!0),i.scale=_,i.presetValue=e,t.container.dispatchEvent(i)}),Tt(h,"updateviewarea").pipe(Pt(n)).subscribe(({location:_,source:e})=>{let t=document.createEvent("UIEvents");t.initEvent("updateviewarea",!0,!0),t.location=_,e.container.dispatchEvent(t)}),Tt(h,"find").pipe(Pt(n)).subscribe(({source:_,type:e,query:t,phraseSearch:i,caseSensitive:r,highlightAll:m,findPrevious:o})=>{if(_===window)return;let u=document.createEvent("CustomEvent");u.initCustomEvent("find"+e,!0,!0,{query:t,phraseSearch:i,caseSensitive:r,highlightAll:m,findPrevious:o}),window.dispatchEvent(u)}),Tt(h,"attachmentsloaded").pipe(Pt(n)).subscribe(({attachmentsCount:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("attachmentsloaded",!0,!0,{attachmentsCount:_}),e.container.dispatchEvent(t)}),Tt(h,"sidebarviewchanged").pipe(Pt(n)).subscribe(({view:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("sidebarviewchanged",!0,!0,{view:_}),e.outerContainer.dispatchEvent(t)}),Tt(h,"pagemode").pipe(Pt(n)).subscribe(({mode:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("pagemode",!0,!0,{mode:_}),e.pdfViewer.container.dispatchEvent(t)}),Tt(h,"namedaction").pipe(Pt(n)).subscribe(({action:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("namedaction",!0,!0,{action:_}),e.pdfViewer.container.dispatchEvent(t)}),Tt(h,"presentationmodechanged").pipe(Pt(n)).subscribe(({active:_,switchInProgress:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("presentationmodechanged",!0,!0,{active:_,switchInProgress:e}),window.dispatchEvent(t)}),Tt(h,"outlineloaded").pipe(Pt(n)).subscribe(({outlineCount:_,source:e})=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("outlineloaded",!0,!0,{outlineCount:_}),e.container.dispatchEvent(t)})}function Mr(h,n,_){h[n]=_}function gn(){return typeof window>"u"}gn()||Mr(qt,"verbosity",qt.VerbosityLevel.INFOS);var kr=function(h){return h[h.DISABLED=0]="DISABLED",h[h.ENABLED=1]="ENABLED",h[h.ENHANCED=2]="ENHANCED",h}(kr||{}),rc=(()=>{let n=class n{constructor(e,t){qe(this,"element");qe(this,"ngZone");qe(this,"pdfViewerContainer");qe(this,"eventBus");qe(this,"pdfLinkService");qe(this,"pdfFindController");qe(this,"pdfViewer");qe(this,"isVisible",!1);qe(this,"_cMapsUrl",typeof qt<"u"?`https://unpkg.com/pdfjs-dist@${qt.version}/cmaps/`:null);qe(this,"_imageResourcesPath",typeof qt<"u"?`https://unpkg.com/pdfjs-dist@${qt.version}/web/images/`:void 0);qe(this,"_renderText",!0);qe(this,"_renderTextMode",kr.ENABLED);qe(this,"_stickToPage",!1);qe(this,"_originalSize",!0);qe(this,"_pdf");qe(this,"_page",1);qe(this,"_zoom",1);qe(this,"_zoomScale","page-width");qe(this,"_rotation",0);qe(this,"_showAll",!0);qe(this,"_canAutoResize",!0);qe(this,"_fitToPage",!1);qe(this,"_externalLinkTarget","blank");qe(this,"_showBorders",!1);qe(this,"lastLoaded");qe(this,"_latestScrolledPage");qe(this,"pageScrollTimeout",null);qe(this,"isInitialized",!1);qe(this,"loadingTask");qe(this,"destroy$",new Mi);qe(this,"afterLoadComplete",new lt);qe(this,"pageRendered",new lt);qe(this,"pageInitialized",new lt);qe(this,"textLayerRendered",new lt);qe(this,"onError",new lt);qe(this,"onProgress",new lt);qe(this,"pageChange",new lt(!0));qe(this,"src");if(this.element=e,this.ngZone=t,gn())return;let i,r=qt.version,m=window[`pdfWorkerSrc${r}`];m?i=m:window.hasOwnProperty("pdfWorkerSrc")&&typeof window.pdfWorkerSrc=="string"&&window.pdfWorkerSrc?i=window.pdfWorkerSrc:i=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${r}/legacy/build/pdf.worker.min.js`,Mr(qt.GlobalWorkerOptions,"workerSrc",i)}set cMapsUrl(e){this._cMapsUrl=e}set page(e){e=parseInt(e,10)||1;let t=e;this._pdf&&(e=this.getValidPageNumber(e)),this._page=e,t!==e&&this.pageChange.emit(e)}set renderText(e){this._renderText=e}set renderTextMode(e){this._renderTextMode=e}set originalSize(e){this._originalSize=e}set showAll(e){this._showAll=e}set stickToPage(e){this._stickToPage=e}set zoom(e){e<=0||(this._zoom=e)}get zoom(){return this._zoom}set zoomScale(e){this._zoomScale=e}get zoomScale(){return this._zoomScale}set rotation(e){if(!(typeof e=="number"&&e%90===0)){console.warn("Invalid pages rotation angle.");return}this._rotation=e}set externalLinkTarget(e){this._externalLinkTarget=e}set autoresize(e){this._canAutoResize=!!e}set fitToPage(e){this._fitToPage=!!e}set showBorders(e){this._showBorders=!!e}static getLinkTarget(e){switch(e){case"blank":return Gt.LinkTarget.BLANK;case"none":return Gt.LinkTarget.NONE;case"self":return Gt.LinkTarget.SELF;case"parent":return Gt.LinkTarget.PARENT;case"top":return Gt.LinkTarget.TOP}return null}ngAfterViewChecked(){if(this.isInitialized)return;let e=this.pdfViewerContainer.nativeElement.offsetParent;if(this.isVisible===!0&&e==null){this.isVisible=!1;return}this.isVisible===!1&&e!=null&&(this.isVisible=!0,setTimeout(()=>{this.initialize(),this.ngOnChanges({src:this.src})}))}ngOnInit(){this.initialize(),this.setupResizeListener()}ngOnDestroy(){this.clear(),this.destroy$.next(),this.loadingTask=null}ngOnChanges(e){if(!(gn()||!this.isVisible)){if("src"in e)this.loadPDF();else if(this._pdf){if(("renderText"in e||"showAll"in e)&&(this.setupViewer(),this.resetPdfDocument()),"page"in e){let{page:t}=e;if(t.currentValue===this._latestScrolledPage)return;this.pdfViewer.scrollPageIntoView({pageNumber:this._page})}this.update()}}}updateSize(){fs(this._pdf.getPage(this.pdfViewer.currentPageNumber)).pipe(Pt(this.destroy$)).subscribe({next:e=>{let t=this._rotation+e.rotate,i=e.getViewport({scale:this._zoom,rotation:t}).width*n.CSS_UNITS,r=this._zoom,m=!0;if(!this._originalSize||this._fitToPage&&i>this.pdfViewerContainer.nativeElement.clientWidth){let o=e.getViewport({scale:1,rotation:t});r=this.getScale(o.width,o.height),m=!this._stickToPage}this.pdfViewer.pagesPromise?.then(()=>{this.pdfViewer.currentScale=r,m&&this.pdfViewer.scrollPageIntoView({pageNumber:e.pageNumber,ignoreDestinationZoom:!0})})}})}clear(){this.loadingTask&&!this.loadingTask.destroyed&&this.loadingTask.destroy(),this._pdf&&(this._latestScrolledPage=0,this._pdf.destroy(),this._pdf=void 0),this.pdfViewer&&this.pdfViewer.setDocument(null),this.pdfLinkService&&this.pdfLinkService.setDocument(null,null),this.pdfFindController&&this.pdfFindController.setDocument(null)}getPDFLinkServiceConfig(){let e=n.getLinkTarget(this._externalLinkTarget);return e?{externalLinkTarget:e}:{}}initEventBus(){this.eventBus=Gd(Gt,this.destroy$),Tt(this.eventBus,"pagerendered").pipe(Pt(this.destroy$)).subscribe(e=>{this.pageRendered.emit(e)}),Tt(this.eventBus,"pagesinit").pipe(Pt(this.destroy$)).subscribe(e=>{this.pageInitialized.emit(e)}),Tt(this.eventBus,"pagechanging").pipe(Pt(this.destroy$)).subscribe(({pageNumber:e})=>{this.pageScrollTimeout&&clearTimeout(this.pageScrollTimeout),this.pageScrollTimeout=window.setTimeout(()=>{this._latestScrolledPage=e,this.pageChange.emit(e)},100)}),Tt(this.eventBus,"textlayerrendered").pipe(Pt(this.destroy$)).subscribe(e=>{this.textLayerRendered.emit(e)})}initPDFServices(){this.pdfLinkService=new Gt.PDFLinkService(ft({eventBus:this.eventBus},this.getPDFLinkServiceConfig())),this.pdfFindController=new Gt.PDFFindController({eventBus:this.eventBus,linkService:this.pdfLinkService})}getPDFOptions(){return{eventBus:this.eventBus,container:this.element.nativeElement.querySelector("div"),removePageBorders:!this._showBorders,linkService:this.pdfLinkService,textLayerMode:this._renderText?this._renderTextMode:kr.DISABLED,findController:this.pdfFindController,l10n:new Gt.GenericL10n("en"),imageResourcesPath:this._imageResourcesPath,annotationEditorMode:qt.AnnotationEditorType.DISABLE}}setupViewer(){Mr(qt,"disableTextLayer",!this._renderText),this.initPDFServices(),this._showAll?this.pdfViewer=new Gt.PDFViewer(this.getPDFOptions()):this.pdfViewer=new Gt.PDFSinglePageViewer(this.getPDFOptions()),this.pdfLinkService.setViewer(this.pdfViewer),this.pdfViewer._currentPageNumber=this._page}getValidPageNumber(e){return e<1?1:e>this._pdf.numPages?this._pdf.numPages:e}getDocumentParams(){let e=typeof this.src;if(!this._cMapsUrl)return this.src;let t={cMapUrl:this._cMapsUrl,cMapPacked:!0,enableXfa:!0};return t.isEvalSupported=!1,e==="string"?t.url=this.src:e==="object"&&(this.src.byteLength!==void 0?t.data=this.src:Object.assign(t,this.src)),t}loadPDF(){if(!this.src)return;if(this.lastLoaded===this.src){this.update();return}this.clear(),this.setupViewer(),this.loadingTask=qt.getDocument(this.getDocumentParams()),this.loadingTask.onProgress=t=>{this.onProgress.emit(t)};let e=this.src;fs(this.loadingTask.promise).pipe(Pt(this.destroy$)).subscribe({next:t=>{this._pdf=t,this.lastLoaded=e,this.afterLoadComplete.emit(t),this.resetPdfDocument(),this.update()},error:t=>{this.lastLoaded=null,this.onError.emit(t)}})}update(){this.page=this._page,this.render()}render(){this._page=this.getValidPageNumber(this._page),(this._rotation!==0||this.pdfViewer.pagesRotation!==this._rotation)&&setTimeout(()=>{this.pdfViewer.pagesRotation=this._rotation}),this._stickToPage&&setTimeout(()=>{this.pdfViewer.currentPageNumber=this._page}),this.updateSize()}getScale(e,t){let i=this._showBorders?2*n.BORDER_WIDTH:0,r=this.pdfViewerContainer.nativeElement.clientWidth-i,m=this.pdfViewerContainer.nativeElement.clientHeight-i;if(m===0||t===0||r===0||e===0)return 1;let o=1;switch(this._zoomScale){case"page-fit":o=Math.min(m/t,r/e);break;case"page-height":o=m/t;break;case"page-width":default:o=r/e;break}return this._zoom*o/n.CSS_UNITS}resetPdfDocument(){this.pdfLinkService.setDocument(this._pdf,null),this.pdfFindController.setDocument(this._pdf),this.pdfViewer.setDocument(this._pdf)}initialize(){gn()||!this.isVisible||(this.isInitialized=!0,this.initEventBus(),this.setupViewer())}setupResizeListener(){gn()||this.ngZone.runOutsideAngular(()=>{Tt(window,"resize").pipe(ri(100),Vt(()=>this._canAutoResize&&!!this._pdf),Pt(this.destroy$)).subscribe(()=>{this.updateSize()})})}};qe(n,"CSS_UNITS",96/72),qe(n,"BORDER_WIDTH",9),qe(n,"\u0275fac",function(t){return new(t||n)(tt(ci),tt(Wr))}),qe(n,"\u0275cmp",ut({type:n,selectors:[["pdf-viewer"]],viewQuery:function(t,i){if(t&1&&Dt(Hd,5),t&2){let r;It(r=Ot())&&(i.pdfViewerContainer=r.first)}},inputs:{src:"src",cMapsUrl:[0,"c-maps-url","cMapsUrl"],page:"page",renderText:[0,"render-text","renderText"],renderTextMode:[0,"render-text-mode","renderTextMode"],originalSize:[0,"original-size","originalSize"],showAll:[0,"show-all","showAll"],stickToPage:[0,"stick-to-page","stickToPage"],zoom:"zoom",zoomScale:[0,"zoom-scale","zoomScale"],rotation:"rotation",externalLinkTarget:[0,"external-link-target","externalLinkTarget"],autoresize:"autoresize",fitToPage:[0,"fit-to-page","fitToPage"],showBorders:[0,"show-borders","showBorders"]},outputs:{afterLoadComplete:"after-load-complete",pageRendered:"page-rendered",pageInitialized:"pages-initialized",textLayerRendered:"text-layer-rendered",onError:"error",onProgress:"on-progress",pageChange:"pageChange"},features:[zr],decls:3,vars:0,consts:[["pdfViewerContainer",""],[1,"ng2-pdf-viewer-container"],[1,"pdfViewer"]],template:function(t,i){t&1&&(Ae(0,"div",1,0),Ke(2,"div",2),Te())},styles:[`.ng2-pdf-viewer-container[_ngcontent-%COMP%]{overflow-x:auto;position:absolute;height:100%;width:100%;-webkit-overflow-scrolling:touch}[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] {--pdfViewer-padding-bottom: 0;--page-margin: 1px auto -8px;--page-border: 9px solid transparent;--spreadHorizontalWrapped-margin-LR: -3.5px;--viewer-container-height: 0;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--xfa-unfocused-field-background: var( --annotation-unfocused-field-background );--page-border-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAA1ElEQVQ4jbWUWw6EIAxFy2NFs/8NzR4UJhpqLsdi5mOmSSMUOfYWqv3S0gMr4XlYH/64gZa/gN3ANYA7KAXALt4ktoQ5MI9YxqaG8bWmsIysMuT6piSQCa4whZThCu8CM4zP9YJaKci9jicPq3NcBWYoPMGUlhG7ivtkB+gVyFY75wXghOvh8t5mto1Mdim6e+MBqH6XsY+YAwjpq3vGF7weTWQptLEDVCZvPTMl5JZZsdh47FHW6qFMyvLYqjcnmdFfY9Xk/KDOlzCusX2mi/ofM7MPkzBcSp4Q1/wAAAAASUVORK5CYII=) 9 9 repeat;--scale-factor: 1;--focus-outline: solid 2px blue;--hover-outline: dashed 2px blue;--freetext-line-height: 1.35;--freetext-padding: 2px;--editorInk-editing-cursor: pointer}@media screen and (forced-colors: active){[_nghost-%COMP%] {--pdfViewer-padding-bottom: 9px;--page-margin: 8px auto -1px;--page-border: 1px solid CanvasText;--page-border-image: none;--spreadHorizontalWrapped-margin-LR: 3.5px}}@media (forced-colors: active){[_nghost-%COMP%] {--focus-outline: solid 3px ButtonText;--hover-outline: dashed 3px ButtonText}}[_nghost-%COMP%] .textLayer{position:absolute;text-align:initial;inset:0;overflow:hidden;opacity:.2;line-height:1;-webkit-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none}[_nghost-%COMP%] .textLayer span, [_nghost-%COMP%] .textLayer br{color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%}[_nghost-%COMP%] .textLayer span.markedContent{top:0;height:0}[_nghost-%COMP%] .textLayer .highlight{margin:-1px;padding:1px;background-color:#b400aa;border-radius:4px}[_nghost-%COMP%] .textLayer .highlight.appended{position:initial}[_nghost-%COMP%] .textLayer .highlight.begin{border-radius:4px 0 0 4px}[_nghost-%COMP%] .textLayer .highlight.end{border-radius:0 4px 4px 0}[_nghost-%COMP%] .textLayer .highlight.middle{border-radius:0}[_nghost-%COMP%] .textLayer .highlight.selected{background-color:#006400}[_nghost-%COMP%] .textLayer ::selection{background:rgb(0,0,255)}[_nghost-%COMP%] .textLayer br::selection{background:transparent}[_nghost-%COMP%] .textLayer .endOfContent{display:block;position:absolute;inset:100% 0 0;z-index:-1;cursor:default;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .textLayer .endOfContent.active{top:0}@media (forced-colors: active){[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:required, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:required, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:required{outline:1.5px solid selectedItem}}[_nghost-%COMP%] .annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0}[_nghost-%COMP%] .annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0}[_nghost-%COMP%] .annotationLayer .linkAnnotation>a, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>canvas{width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .linkAnnotation>a:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>a:hover{opacity:.2;background:rgb(255,255,0);box-shadow:0 2px 10px #ff0}[_nghost-%COMP%] .annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{background-image:var(--annotation-unfocused-field-background);border:1px solid transparent;box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:required, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:required, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:required{outline:1.5px solid red}[_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select option{padding:0}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea{resize:none}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input[disabled], [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea[disabled], [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select[disabled], [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled], [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled]{background:none;border:1px solid transparent;cursor:not-allowed}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:hover, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:hover, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:hover{border:1px solid rgb(0,0,0)}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:focus, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:focus, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:1px solid transparent}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input :focus, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea :focus, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select :focus, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox :focus, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton :focus{background-image:none;background-color:transparent;outline:auto}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{-webkit-appearance:none;appearance:none}[_nghost-%COMP%] .annotationLayer .popupTriggerArea{height:100%;width:100%}[_nghost-%COMP%] .annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}[_nghost-%COMP%] .annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}[_nghost-%COMP%] .annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .popup h1{display:inline-block}[_nghost-%COMP%] .annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .popupContent{border-top:1px solid rgb(51,51,51);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .highlightAnnotation, [_nghost-%COMP%] .annotationLayer .underlineAnnotation, [_nghost-%COMP%] .annotationLayer .squigglyAnnotation, [_nghost-%COMP%] .annotationLayer .strikeoutAnnotation, [_nghost-%COMP%] .annotationLayer .freeTextAnnotation, [_nghost-%COMP%] .annotationLayer .lineAnnotation svg line, [_nghost-%COMP%] .annotationLayer .squareAnnotation svg rect, [_nghost-%COMP%] .annotationLayer .circleAnnotation svg ellipse, [_nghost-%COMP%] .annotationLayer .polylineAnnotation svg polyline, [_nghost-%COMP%] .annotationLayer .polygonAnnotation svg polygon, [_nghost-%COMP%] .annotationLayer .caretAnnotation, [_nghost-%COMP%] .annotationLayer .inkAnnotation svg polyline, [_nghost-%COMP%] .annotationLayer .stampAnnotation, [_nghost-%COMP%] .annotationLayer .fileAttachmentAnnotation{cursor:pointer}[_nghost-%COMP%] .annotationLayer section svg{position:absolute;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;user-select:none;pointer-events:none}[_nghost-%COMP%] .annotationLayer .annotationTextContent span{width:100%;display:inline-block}@media (forced-colors: active){[_nghost-%COMP%] .xfaLayer *:required{outline:1.5px solid selectedItem}}[_nghost-%COMP%] .xfaLayer .highlight{margin:-1px;padding:1px;background-color:#efcbed;border-radius:4px}[_nghost-%COMP%] .xfaLayer .highlight.appended{position:initial}[_nghost-%COMP%] .xfaLayer .highlight.begin{border-radius:4px 0 0 4px}[_nghost-%COMP%] .xfaLayer .highlight.end{border-radius:0 4px 4px 0}[_nghost-%COMP%] .xfaLayer .highlight.middle{border-radius:0}[_nghost-%COMP%] .xfaLayer .highlight.selected{background-color:#cbdfcb}[_nghost-%COMP%] .xfaLayer ::selection{background:rgb(0,0,255)}[_nghost-%COMP%] .xfaPage{overflow:hidden;position:relative}[_nghost-%COMP%] .xfaContentarea{position:absolute}[_nghost-%COMP%] .xfaPrintOnly{display:none}[_nghost-%COMP%] .xfaLayer{position:absolute;text-align:initial;top:0;left:0;transform-origin:0 0;line-height:1.2}[_nghost-%COMP%] .xfaLayer *{color:inherit;font:inherit;font-style:inherit;font-weight:inherit;font-kerning:inherit;letter-spacing:-.01px;text-align:inherit;text-decoration:inherit;box-sizing:border-box;background-color:transparent;padding:0;margin:0;pointer-events:auto;line-height:inherit}[_nghost-%COMP%] .xfaLayer *:required{outline:1.5px solid red}[_nghost-%COMP%] .xfaLayer div{pointer-events:none}[_nghost-%COMP%] .xfaLayer svg{pointer-events:none}[_nghost-%COMP%] .xfaLayer svg *{pointer-events:none}[_nghost-%COMP%] .xfaLayer a{color:#00f}[_nghost-%COMP%] .xfaRich li{margin-left:3em}[_nghost-%COMP%] .xfaFont{color:#000;font-weight:400;font-kerning:none;font-size:10px;font-style:normal;letter-spacing:0;text-decoration:none;vertical-align:0}[_nghost-%COMP%] .xfaCaption{overflow:hidden;flex:0 0 auto}[_nghost-%COMP%] .xfaCaptionForCheckButton{overflow:hidden;flex:1 1 auto}[_nghost-%COMP%] .xfaLabel{height:100%;width:100%}[_nghost-%COMP%] .xfaLeft{display:flex;flex-direction:row;align-items:center}[_nghost-%COMP%] .xfaRight{display:flex;flex-direction:row-reverse;align-items:center}[_nghost-%COMP%] .xfaLeft>.xfaCaption, [_nghost-%COMP%] .xfaLeft>.xfaCaptionForCheckButton, [_nghost-%COMP%] .xfaRight>.xfaCaption, [_nghost-%COMP%] .xfaRight>.xfaCaptionForCheckButton{max-height:100%}[_nghost-%COMP%] .xfaTop{display:flex;flex-direction:column;align-items:flex-start}[_nghost-%COMP%] .xfaBottom{display:flex;flex-direction:column-reverse;align-items:flex-start}[_nghost-%COMP%] .xfaTop>.xfaCaption, [_nghost-%COMP%] .xfaTop>.xfaCaptionForCheckButton, [_nghost-%COMP%] .xfaBottom>.xfaCaption, [_nghost-%COMP%] .xfaBottom>.xfaCaptionForCheckButton{width:100%}[_nghost-%COMP%] .xfaBorder{background-color:transparent;position:absolute;pointer-events:none}[_nghost-%COMP%] .xfaWrapped{width:100%;height:100%}[_nghost-%COMP%] .xfaTextfield:focus, [_nghost-%COMP%] .xfaSelect:focus{background-image:none;background-color:transparent;outline:auto;outline-offset:-1px}[_nghost-%COMP%] .xfaCheckbox:focus, [_nghost-%COMP%] .xfaRadio:focus{outline:auto}[_nghost-%COMP%] .xfaTextfield, [_nghost-%COMP%] .xfaSelect{height:100%;width:100%;flex:1 1 auto;border:none;resize:none;background-image:var(--xfa-unfocused-field-background)}[_nghost-%COMP%] .xfaTop>.xfaTextfield, [_nghost-%COMP%] .xfaTop>.xfaSelect, [_nghost-%COMP%] .xfaBottom>.xfaTextfield, [_nghost-%COMP%] .xfaBottom>.xfaSelect{flex:0 1 auto}[_nghost-%COMP%] .xfaButton{cursor:pointer;width:100%;height:100%;border:none;text-align:center}[_nghost-%COMP%] .xfaLink{width:100%;height:100%;position:absolute;top:0;left:0}[_nghost-%COMP%] .xfaCheckbox, [_nghost-%COMP%] .xfaRadio{width:100%;height:100%;flex:0 0 auto;border:none}[_nghost-%COMP%] .xfaRich{white-space:pre-wrap;width:100%;height:100%}[_nghost-%COMP%] .xfaImage{object-position:left top;object-fit:contain;width:100%;height:100%}[_nghost-%COMP%] .xfaLrTb, [_nghost-%COMP%] .xfaRlTb, [_nghost-%COMP%] .xfaTb{display:flex;flex-direction:column;align-items:stretch}[_nghost-%COMP%] .xfaLr{display:flex;flex-direction:row;align-items:stretch}[_nghost-%COMP%] .xfaRl{display:flex;flex-direction:row-reverse;align-items:stretch}[_nghost-%COMP%] .xfaTb>div{justify-content:left}[_nghost-%COMP%] .xfaPosition{position:relative}[_nghost-%COMP%] .xfaArea{position:relative}[_nghost-%COMP%] .xfaValignMiddle{display:flex;align-items:center}[_nghost-%COMP%] .xfaTable{display:flex;flex-direction:column;align-items:stretch}[_nghost-%COMP%] .xfaTable .xfaRow{display:flex;flex-direction:row;align-items:stretch}[_nghost-%COMP%] .xfaTable .xfaRlRow{display:flex;flex-direction:row-reverse;align-items:stretch;flex:1}[_nghost-%COMP%] .xfaTable .xfaRlRow>div{flex:1}[_nghost-%COMP%] .xfaNonInteractive input, [_nghost-%COMP%] .xfaNonInteractive textarea, [_nghost-%COMP%] .xfaDisabled input, [_nghost-%COMP%] .xfaDisabled textarea, [_nghost-%COMP%] .xfaReadOnly input, [_nghost-%COMP%] .xfaReadOnly textarea{background:initial}@media print{[_nghost-%COMP%] .xfaTextfield, [_nghost-%COMP%] .xfaSelect{background:transparent}[_nghost-%COMP%] .xfaSelect{-webkit-appearance:none;appearance:none;text-indent:1px;text-overflow:""}}[_nghost-%COMP%] [data-editor-rotation="90"]{transform:rotate(90deg)}[_nghost-%COMP%] [data-editor-rotation="180"]{transform:rotate(180deg)}[_nghost-%COMP%] [data-editor-rotation="270"]{transform:rotate(270deg)}[_nghost-%COMP%] .annotationEditorLayer{background:transparent;position:absolute;top:0;left:0;font-size:calc(100px * var(--scale-factor));transform-origin:0 0}[_nghost-%COMP%] .annotationEditorLayer .selectedEditor{outline:var(--focus-outline);resize:none}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor{position:absolute;background:transparent;border-radius:3px;padding:calc(var(--freetext-padding) * var(--scale-factor));resize:none;width:auto;height:auto;z-index:1;transform-origin:0 0;touch-action:none}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal{background:transparent;border:none;top:0;left:0;overflow:visible;white-space:nowrap;resize:none;font:10px sans-serif;line-height:var(--freetext-line-height)}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .overlay{position:absolute;display:none;background:transparent;top:0;left:0;width:100%;height:100%}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .overlay.enabled{display:block}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal:empty:before{content:attr(default-content);color:gray}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal:focus{outline:none}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.disabled{resize:none}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.disabled.selectedEditor{resize:horizontal}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor:hover:not(.selectedEditor), [_nghost-%COMP%] .annotationEditorLayer .inkEditor:hover:not(.selectedEditor){outline:var(--hover-outline)}[_nghost-%COMP%] .annotationEditorLayer .inkEditor{position:absolute;background:transparent;border-radius:3px;overflow:auto;width:100%;height:100%;z-index:1;transform-origin:0 0;cursor:auto}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.editing{resize:none;cursor:var(--editorInk-editing-cursor),pointer}[_nghost-%COMP%] .annotationEditorLayer .inkEditor .inkEditorCanvas{position:absolute;top:0;left:0;width:100%;height:100%;touch-action:none}[_nghost-%COMP%] [data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[_nghost-%COMP%] [data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[_nghost-%COMP%] [data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}[_nghost-%COMP%] .pdfViewer{padding-bottom:var(--pdfViewer-padding-bottom)}[_nghost-%COMP%] .pdfViewer .canvasWrapper{overflow:hidden}[_nghost-%COMP%] .pdfViewer .page{direction:ltr;width:816px;height:1056px;margin:var(--page-margin);position:relative;overflow:visible;border:var(--page-border);border-image:var(--page-border-image);background-clip:content-box;background-color:#fff}[_nghost-%COMP%] .pdfViewer .dummyPage{position:relative;width:0;height:var(--viewer-container-height)}[_nghost-%COMP%] .pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}[_nghost-%COMP%] .pdfViewer.singlePageView{display:inline-block}[_nghost-%COMP%] .pdfViewer.singlePageView .page{margin:0;border:none}[_nghost-%COMP%] .pdfViewer.scrollHorizontal, [_nghost-%COMP%] .pdfViewer.scrollWrapped, [_nghost-%COMP%] .spread{margin-left:3.5px;margin-right:3.5px;text-align:center}[_nghost-%COMP%] .pdfViewer.scrollHorizontal, [_nghost-%COMP%] .spread{white-space:nowrap}[_nghost-%COMP%] .pdfViewer.removePageBorders, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .spread, [_nghost-%COMP%] .pdfViewer.scrollWrapped .spread{margin-left:0;margin-right:0}[_nghost-%COMP%] .spread .page, [_nghost-%COMP%] .spread .dummyPage, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.scrollWrapped .page, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .spread, [_nghost-%COMP%] .pdfViewer.scrollWrapped .spread{display:inline-block;vertical-align:middle}[_nghost-%COMP%] .spread .page, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.scrollWrapped .page{margin-left:var(--spreadHorizontalWrapped-margin-LR);margin-right:var(--spreadHorizontalWrapped-margin-LR)}[_nghost-%COMP%] .pdfViewer.removePageBorders .spread .page, [_nghost-%COMP%] .pdfViewer.removePageBorders.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.removePageBorders.scrollWrapped .page{margin-left:5px;margin-right:5px}[_nghost-%COMP%] .pdfViewer .page canvas{margin:0;display:block}[_nghost-%COMP%] .pdfViewer .page canvas[hidden]{display:none}[_nghost-%COMP%] .pdfViewer .page .loadingIcon{position:absolute;display:block;inset:0;background:url(data:image/gif;base64,R0lGODlhGAAYAPQQAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/ilPcHRpbWl6ZWQgd2l0aCBodHRwczovL2V6Z2lmLmNvbS9vcHRpbWl6ZQAh+QQJBwAQACwAAAAAGAAYAAAFmiAkjiTkOGVaBgjZNGSgkgKjjM8zLoI8iy+BKCdiCX8iBeMAhEEIPRXLxViYUE9CbCQoFAzFhHY3zkaT3oPvBz1zE4UBsr1eWZH4vAowOBwGAHk8AoQLfH6Agm0Ed3qOAXWOIgQKiWyFJQgDgJEpdG+WEACNEFNFmKVlVzJQk6qdkwqBoi1mebJ3ALNGeIZHtGSwNDS1RZKueCEAIfkECQcAEAAsAAAAABgAGAAABZcgJI4kpChlWgYCWRQkEKgjURgjw4zOg9CjVwuiEyEeO6CxkBC9nA+HiuUqLEyoBZI0Mx4SAFFgQCDZuguBoGv6Dtg0gvpqdhxQQDkBzuUr/4A1JwMKP39pc2mDhYCIc4GQYn6QCwCMeY91l0p6dBAEJ0OfcFRimZ91Mwt0alxxAIZyRmuAsKxDLKKvZbM1tJxmvGKRpn8hACH5BAkHABAALAAAAAAYABgAAAWhICSOJGQYZVoGAnkcJBKoI3EAY1GMCtPSosSBINKJBIwGkHdwBGGQA0OhYpEGQxNqkYzNIITBACEKKBaxxNfBeOCO4vMy0Hg8nDHFeCktkKtfNAtoS4UqAicKBj9zBAKPC4iKi4aRkISGmWWBmjUIAIyHkCUEAKCVo2WmREecVqoCgZhgP4NHrGWCj7e3szSpuxAsoVWxnp6cVV4kyZW+KSEAIfkECQcAEAAsAAAAABgAGAAABZkgJI4kBABlWgYEOQykEKgjMSDjcYxG0dKi108nEhQKQN4rCIMkCgbawjWYnSCLY2yGVSgEooBhWqsGGwxc0RtNBgoMhmJ1QgETjANYFeBKyUmBKQQIdT9JDmgPDQ6EhoKJD4sOgpWWgiwChyqEBH5hmptSoSOZgJ4kLKWkYTF7C2SaqaM/hEWygay4mYG8t6uffFuzl1iANCEAIfkECQcAEAAsAAAAABgAGAAABZ0gJI4khCBlmhKkopBCoI6LIozDMAIHO4uuBVBnOiR+I4FrCDwAZsKdQnaCLIwwmRUA8JmioprWUCjcwlwUMnAoG0qL03k2KCS8cC0UjOzDCQKBfHQFDAwFU4CCfgqFhy9+kZJWgzSKSAcPZn+BfQENDw8OljGWJAFeDoZPYTBnC1GdSXqnsoBolSulX2GyP6hgvnG0KrS3NJNhuSQhACH5BAkHABAALAAAAAAYABgAAAWaICSOJCQIZZoupGGQRKCOC0CMijIiwz2LABtQZxoMfjQhxAXszWQ7gOwECRhh0MCJJRJARTUoIHFAgbfI6uBwAJS01J/i4PClVYHvfV8lbLlIBmwFbQt+aGmChG18jXeGT4dICQxlb4g/AQUMDER9XjR6BAdiDQwINDBmkAsPDVh4cX4imw53iLKuaVqAcUsPqEiidkt6j4AzIQAh+QQJBwAQACwAAAAAGAAYAAAFmSAkjiREEGWaBiSCtCoZCMsIAKOg1LEo0KKbaKFQ9EYLoOkFuQlirNxzCQkUW9GZ0hQd4nyDAWr4G/esYSbyZFYZwu3jqiuvr8u8I2BwOAwASXh1e31/doeHC3klWnElfAlTd46MfQUGk2stCVEGBQWSdCciDg5VDAVYKoEiDQ0iBwxGcj9RDw8+qHIzebc2DJJQJK6qiKVyIQAh+QQJBwAQACwAAAAAGAAYAAAFmSAkjiS0LGWaBiRBtCoZCKgoCCMB1DF0sz6cCQDo5W62l28XAyZFpyECBv3lnCbhUqHMIo0Qg4Jbmn1jRCa4iV27TzfXGjEecOFWMN1OdvvfPGUuXSoKBw6EXokrAwcHRVU0UAeEBANAAAmUI1gNDyhjJgUHLW0iDg8FIqOnBQZrDA9TELE2rEYIDw4jta2LMpCrqld/YQpgIQAh+QQJBwAQACwAAAAAGAAYAAAFmyAkjiS0LGWaBiRBkKw6BgIqCsJcyyMe4yJajhcEml5H26o1PN2QQd3uFiv2AADlAgflIbDdZLgkABOJgep5LfWty4p4zeU+w+XsvJWXliEKDwdEBgMKYQ4PDw1qK3EDCCMAiQ5BCV0LCj+FSDQkgCgGBiYHAy2MIgoMghAHqw4HAGsNDEMFBTekdgwKI7aRB2MwkL2rVHoQoWchACH5BAkHABAALAAAAAAYABgAAAWWICSOJLQsZZoGJEGQrDoGAioKwlzLIx7jIlqOFwSaXkfbqjU83ZBB3e4WK0qrCxyU55peid0qcUwuixyNx6PhILsAcAJazXYj4lvz2MkLiFsHDAlEcABKZwwMBX8pBgoKQxAIigpBA1sLBj+PSDQkB4uSACYDlTMyBgWDEKVnl2QFBUigN61gBQYjtLV5JZ4jtlR6omMhACH5BAkHABAALAAAAAAYABgAAAWaICSOJLQsZZoGJEGQrDoGAioKwlzLIx7jIlqOFwSaXkdbidYanm7I4AjwYDh6saJuJ3JUG1mZi9srPA7EcRimJLrfJYWZUVC8TziXnEG3u/E+cIJaPAFrPQl1aQAIbRAGBZGHJQiMUQKRBkEKbQsAPZaEXQcslSYKmjMyAAdXj34ACkNEiUgDA5t+PAQHn6Ogjkuzry2DNwhuIQAh+QQFBwAQACwAAAAAGAAYAAAFnCAkjiS0LGVaBgBJEGSguo8zCsK4CPIsMg+ECCcKEH0ix6MwhJl4KiOp8UCdmrEbo6EoHpxF8A6aBBZ6vhf5dmAkkGr0CoWs21WGQ2FvsI9xC3l7B311fy93iWGKJQQOhHCAJQB6A3IqcWwJLU90i2FkUiMKlhBELEI6MwgDXRAGhQgAYD6tTqRFAJxpA6mvrqazSKJJhUWMpjlIIQA7) center no-repeat}[_nghost-%COMP%] .pdfViewer .page .loadingIcon.notVisible{background:none}[_nghost-%COMP%] .pdfViewer.enablePermissions .textLayer span{-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}[_nghost-%COMP%] .pdfPresentationMode .pdfViewer{padding-bottom:0}[_nghost-%COMP%] .pdfPresentationMode .spread{margin:0}[_nghost-%COMP%] .pdfPresentationMode .pdfViewer .page{margin:0 auto;border:2px solid transparent}`]}));let h=n;return h})(),oc=(()=>{let n=class n{};qe(n,"\u0275fac",function(t){return new(t||n)}),qe(n,"\u0275mod",yt({type:n})),qe(n,"\u0275inj",vt({}));let h=n;return h})();var Kd=["viewer"];function Yd(h,n){if(h&1){let _=it();Ae(0,"pdf-viewer",3,0),Ne(2,"async"),Ge("after-load-complete",function(){Re(_);let t=pe();return De(t.handleLoad())})("on-progress",function(t){Re(_);let i=pe();return De(i.handleProgress(t))}),Te()}if(h&2){let _=n.ngIf,e=pe();ge("src",_)("original-size",!0)("zoom",Be(2,3,e.zoom$))}}function Qd(h,n){if(h&1&&(Ae(0,"div",4),_t(1),Te()),h&2){let _=n.ngIf;Ce(),jt(" ",_,`
`)}}var ac=(()=>{let n=class n{constructor(){this.MIN_ZOOM=.2,this.MAX_ZOOM=3,this.DEFAULT_ZOOM=1,this.ZOOM_STEP=.21,this.src$=new st(""),this.encodedSrc$=this.src$.pipe(Je(e=>e.replace(/#/g,"%23"))),this.fileSize=0,this.load=new lt,this.zoomInLock=new lt,this.zoomOutLock=new lt,this.progress$=new st(""),this.zoom$=new st(this.DEFAULT_ZOOM)}set item(e){this.fileSize=e.size||0,this.src$.next(""),this.zoom$.next(this.DEFAULT_ZOOM),this.zoomInLock.emit(!0),this.zoomOutLock.emit(!0),setTimeout(()=>this.src$.next(`/mancgi/${e.cgi}?elid=${e.path}`),50)}handleLoad(){this.load.emit(),this.zoomInLock.emit(!1),this.zoomOutLock.emit(!1)}handleProgress(e){if(!this.fileSize)return;let t;e.loaded>=this.fileSize?t="":t=`${Math.floor(e.loaded*100/this.fileSize)}%`,this.progress$.next(t)}handleZoomIn(){return Ue(this,null,function*(){this.zoomInLock.emit(!0),this.zoomOutLock.next(!1);let e=Math.min(this.zoom$.value+this.ZOOM_STEP,this.MAX_ZOOM);yield this.setZoom(e),this.zoomInLock.emit(e===this.MAX_ZOOM)})}handleZoomOut(){return Ue(this,null,function*(){this.zoomInLock.next(!1),this.zoomOutLock.emit(!0);let e=Math.max(this.zoom$.value-this.ZOOM_STEP,this.MIN_ZOOM);yield this.setZoom(e),this.zoomOutLock.emit(e===this.MIN_ZOOM)})}setZoom(e){return Ue(this,null,function*(){let t=this.viewer.pdfViewerContainer?.nativeElement,i=t.getBoundingClientRect(),m=Array.from(t.querySelectorAll(".page[data-page-number]")).find(v=>v.getBoundingClientRect().bottom>i.top),o=m.getBoundingClientRect(),u=(i.top-o.top)*100/o.height;this.zoom$.next(e);let d=()=>{t.scrollTo({top:m.offsetTop+m.clientHeight/100*u})};d(),yield new Promise(v=>setTimeout(v,50)),d(),yield new Promise(v=>setTimeout(v,100))})}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=ut({type:n,selectors:[["isp-gallery-pdf-view"]],viewQuery:function(t,i){if(t&1&&Dt(Kd,5),t&2){let r;It(r=Ot())&&(i.viewer=r.first)}},inputs:{item:"item"},outputs:{load:"load",zoomInLock:"zoomInLock",zoomOutLock:"zoomOutLock"},decls:4,vars:6,consts:[["viewer",""],["class","isp-gallery-pdf-view__viewer",3,"src","original-size","zoom","after-load-complete","on-progress",4,"ngIf"],["class","isp-gallery-pdf-view__progress",4,"ngIf"],[1,"isp-gallery-pdf-view__viewer",3,"after-load-complete","on-progress","src","original-size","zoom"],[1,"isp-gallery-pdf-view__progress"]],template:function(t,i){t&1&&(je(0,Yd,3,5,"pdf-viewer",1),Ne(1,"async"),je(2,Qd,2,1,"div",2),Ne(3,"async")),t&2&&(ge("ngIf",Be(1,2,i.encodedSrc$)),Ce(2),ge("ngIf",Be(3,4,i.progress$)))},dependencies:[St,rc,xt],styles:[".isp-gallery-pdf-view__viewer[_ngcontent-%COMP%]{max-width:100%;height:100%} .ng2-pdf-viewer-container{scrollbar-color:var(--isp-scrollbar-thumb-bg, var(--isp-c-grey-weekdays)) var(--isp-scrollbar-track-bg, var(--isp-dc-charlie-chaplin));scrollbar-width:thin} .ng2-pdf-viewer-container::-webkit-scrollbar, .ng2-pdf-viewer-container::-webkit-scrollbar-track, .ng2-pdf-viewer-container::-webkit-scrollbar-thumb{width:5px;border-radius:10px} .ng2-pdf-viewer-container::-webkit-scrollbar, .ng2-pdf-viewer-container::-webkit-scrollbar-track{background-color:var(--isp-dc-charlie-chaplin)} .ng2-pdf-viewer-container::-webkit-scrollbar-thumb{background-color:var(--isp-c-grey-weekdays)} .ng2-pdf-viewer-container::-webkit-scrollbar-thumb:hover{background-color:var(--isp-c-blue-velvet)} .ng2-pdf-viewer-container::-webkit-scrollbar-button{display:none} .pdfViewer{padding-top:1px} .page{box-shadow:0 0 0 1px var(--isp-dc-charlie-chaplin)}.isp-gallery-pdf-view__progress[_ngcontent-%COMP%]{position:absolute;top:calc(50% - 30px);left:50%;transform:translate3d(-50%,-50%,0)}"],changeDetection:0});let h=n;return h})();var Jd=["view"];function eu(h,n){if(h&1){let _=it();Ae(0,"div",19)(1,"button",20),Ge("click",function(){Re(_);let t=pe();return De(t.delete.emit(t.activeItem.elid))}),Ke(2,"isp-svg-icon",21),Te(),Ae(3,"button",20),Ge("click",function(){Re(_);let t=pe();return De(t.download.emit(t.activeItem.elid))}),Ke(4,"isp-svg-icon",22),Te()()}if(h&2){let _=n.ngIf;Ce(),ge("ispTooltip",_.deleteHint),Ce(2),ge("ispTooltip",_.downloadHint)}}function tu(h,n){if(h&1){let _=it();Ae(0,"isp-gallery-image-view",23,0),Ge("load",function(){Re(_);let t=pe();return De(t.isLoading$.next(!1))})("zoomInLock",function(t){Re(_);let i=pe();return De(i.lockZoomIn$.next(t))})("zoomOutLock",function(t){Re(_);let i=pe();return De(i.lockZoomOut$.next(t))}),Te()}if(h&2){let _=pe();ge("item",_.activeItem)}}function iu(h,n){if(h&1){let _=it();Ae(0,"isp-gallery-pdf-view",24,0),Ge("load",function(){Re(_);let t=pe();return De(t.isLoading$.next(!1))})("zoomInLock",function(t){Re(_);let i=pe();return De(i.lockZoomIn$.next(t))})("zoomOutLock",function(t){Re(_);let i=pe();return De(i.lockZoomOut$.next(t))}),Te()}if(h&2){let _=pe();ge("item",_.activeItem)}}function nu(h,n){if(h&1){let _=it();Ae(0,"button",25),Ge("click",function(){Re(_);let t=pe();return De(t.switch(!1))}),Ke(1,"isp-svg-icon",26),Te()}}function su(h,n){if(h&1){let _=it();Ae(0,"button",27),Ge("click",function(){Re(_);let t=pe();return De(t.switch(!0))}),Ke(1,"isp-svg-icon",28),Te()}}var lc=(()=>{let n=class n{set items(e){this.items$.next(e),this.isLoading$.next(!0)}set activeIndex(e){this.activeItemIndex=e}get hasPrev(){return!!this.items$.value[this.activeItemIndex-1]}get hasNext(){return!!this.items$.value[this.activeItemIndex+1]}get activeItem(){return this.items$.value[this.activeItemIndex]}get fileType(){return this.activeItem.type}constructor(e,t){this.listService=e,this.cdr=t,this.keydownHandler=i=>{["ArrowRight","Right"].includes(i.code)&&(i.preventDefault(),this.hasNext&&this.switch(!0)),["ArrowLeft","Left"].includes(i.code)&&(i.preventDefault(),this.hasPrev&&this.switch(!1)),i.code==="Escape"&&(i.preventDefault(),this.close.emit()),["Plus","Equal"].includes(i.code)&&(i.preventDefault(),i.ctrlKey&&this.view.handleZoomIn()),i.code==="Minus"&&(i.preventDefault(),i.ctrlKey&&this.view.handleZoomOut())},this.folderPath="",this.items$=new st([]),this.activeItemIndex=0,this.close=new lt,this.delete=new lt,this.download=new lt,this.isLoading$=new st(!0),this.lockZoomIn$=new st(!0),this.lockZoomOut$=new st(!0),this.messages$=this.listService.doc$.pipe(Je(i=>({deleteHint:nt.getMessage("short_delete",i),downloadHint:nt.getMessage("short_download",i)}))),document.addEventListener("keydown",this.keydownHandler)}switch(e){this.isLoading$.next(!0),this.activeItemIndex=this.activeItemIndex+(e?1:-1),this.cdr.markForCheck()}ngOnDestroy(){document.removeEventListener("keydown",this.keydownHandler)}};n.\u0275fac=function(t){return new(t||n)(tt($t),tt(bi))},n.\u0275cmp=ut({type:n,selectors:[["isp-gallery"]],viewQuery:function(t,i){if(t&1&&Dt(Jd,5),t&2){let r;It(r=Ot())&&(i.view=r.first)}},inputs:{folderPath:"folderPath",items:"items",activeIndex:"activeIndex"},outputs:{close:"close",delete:"delete",download:"download"},decls:24,vars:18,consts:[["view",""],[1,"isp-gallery__header"],["type","button",1,"isp-gallery-button","isp-gallery-button_round",3,"click"],["name","close_m"],[1,"isp-gallery__title"],["class","isp-gallery__action-bar",4,"ngIf"],[1,"isp-gallery__body"],["type","spinner",1,"isp-gallery__loader",3,"loading"],[3,"ngSwitch"],["class","isp-gallery__view isp-gallery__view_image",3,"item","load","zoomInLock","zoomOutLock",4,"ngSwitchCase"],["class","isp-gallery__view isp-gallery__view_pdf",3,"item","load","zoomInLock","zoomOutLock",4,"ngSwitchCase"],["class","isp-gallery-button isp-gallery-button_round isp-gallery__switch-button","type","button",3,"click",4,"ngIf"],["class","isp-gallery-button isp-gallery-button_round isp-gallery__switch-button isp-gallery__switch-button_right","type","button",3,"click",4,"ngIf"],[1,"isp-gallery__footer"],[1,"isp-gallery__scale"],["type","button",1,"isp-gallery-button","isp-gallery-button_wide",3,"click","disabled"],["name","plus_s"],[1,"isp-gallery__scale-buttons-divider"],["name","minus_s"],[1,"isp-gallery__action-bar"],["ispTooltipPosition","top-middle","type","button",1,"isp-gallery-button","isp-gallery__action-bar-button",3,"click","ispTooltip"],["name","p-delete"],["name","download_s"],[1,"isp-gallery__view","isp-gallery__view_image",3,"load","zoomInLock","zoomOutLock","item"],[1,"isp-gallery__view","isp-gallery__view_pdf",3,"load","zoomInLock","zoomOutLock","item"],["type","button",1,"isp-gallery-button","isp-gallery-button_round","isp-gallery__switch-button",3,"click"],["name","arrow_left_s"],["type","button",1,"isp-gallery-button","isp-gallery-button_round","isp-gallery__switch-button","isp-gallery__switch-button_right",3,"click"],["name","arrow_right_s"]],template:function(t,i){t&1&&(Ae(0,"div",1)(1,"button",2),Ge("click",function(){return i.close.emit()}),Ke(2,"isp-svg-icon",3),Te(),Ae(3,"div",4),_t(4),Te(),je(5,eu,5,2,"div",5),Ne(6,"async"),Te(),Ae(7,"div",6),Ke(8,"isp-loader",7),Ne(9,"async"),Mt(10,8),je(11,tu,2,1,"isp-gallery-image-view",9)(12,iu,2,1,"isp-gallery-pdf-view",10),kt(),je(13,nu,2,0,"button",11)(14,su,2,0,"button",12),Te(),Ae(15,"div",13)(16,"div",14)(17,"button",15),Ne(18,"async"),Ge("click",function(){return i.view.handleZoomIn()}),Ke(19,"isp-svg-icon",16),Te(),Ke(20,"div",17),Ae(21,"button",15),Ne(22,"async"),Ge("click",function(){return i.view.handleZoomOut()}),Ke(23,"isp-svg-icon",18),Te()()()),t&2&&(Ce(4),zt(i.activeItem.path),Ce(),ge("ngIf",Be(6,10,i.messages$)),Ce(3),ge("loading",Be(9,12,i.isLoading$)),Ce(2),ge("ngSwitch",i.fileType),Ce(),ge("ngSwitchCase","image"),Ce(),ge("ngSwitchCase","pdf"),Ce(),ge("ngIf",i.hasPrev),Ce(),ge("ngIf",i.hasNext),Ce(3),ge("disabled",Be(18,14,i.lockZoomIn$)),Ce(4),ge("disabled",Be(22,16,i.lockZoomOut$)))},dependencies:[St,wn,Sn,Wt,ni,Bi,Ja,ac,xt],styles:["[_nghost-%COMP%]{--isp-gallery-footer-height: 60px;position:relative;display:flex;flex-direction:column;height:100%}.isp-gallery__header[_ngcontent-%COMP%]{display:flex;flex-shrink:0;align-items:center;padding:20px 0 15px}.isp-gallery__title[_ngcontent-%COMP%]{margin-left:15px}.isp-gallery__action-bar[_ngcontent-%COMP%]{display:flex;margin-left:auto}.isp-gallery-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:25px;height:25px;padding:0;background:var(--isp-dc-norilsk);border:none;border-radius:5px;-webkit-user-select:none;user-select:none;cursor:pointer}.isp-gallery-button[_ngcontent-%COMP%]:hover{background:var(--isp-dc-reincarnation)}.isp-gallery-button_round[_ngcontent-%COMP%]{border-radius:50%}.isp-gallery-button_wide[_ngcontent-%COMP%]{width:35px}.isp-gallery-button[_ngcontent-%COMP%]:disabled{--isp-icons-main-color: var(--isp-c-grey-weekdays);color:var(--isp-c-grey-weekdays);pointer-events:none}.isp-gallery__action-bar-button[_ngcontent-%COMP%]{margin-left:5px}.isp-gallery__body[_ngcontent-%COMP%]{position:relative;flex-grow:1}.isp-gallery__loader[_ngcontent-%COMP%]{--isp-loader__background: none;--isp-loader__size: 60px;position:absolute;top:calc(50% - var(--isp-gallery-footer-height) / 2);left:50%;z-index:1;display:block;transform:translate3d(-50%,-50%,0)}.isp-gallery__view[_ngcontent-%COMP%]{position:absolute;top:0;height:100%;overflow:hidden;scroll-snap-align:center}.isp-gallery__view_image[_ngcontent-%COMP%]{left:40px;width:calc(100% - 80px)}.isp-gallery__view_pdf[_ngcontent-%COMP%]{left:calc(var(--isp-main-page__padding-left) * -1);width:calc(100% + var(--isp-main-page__padding-left) + var(--isp-main-page__padding-right))}.isp-gallery__switch-button[_ngcontent-%COMP%]{position:absolute;top:calc(50% - var(--isp-gallery-footer-height) / 2);left:0;transform:translateY(-50%)}.isp-gallery__switch-button_right[_ngcontent-%COMP%]{right:0;left:auto}.isp-gallery__footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;height:0}.isp-gallery__scale[_ngcontent-%COMP%]{position:absolute;bottom:17.5px;left:50%;display:flex;align-items:center;background:var(--isp-dc-norilsk);border-radius:5px;-webkit-user-select:none;user-select:none;transform:translate(-50%)}.isp-gallery__scale-buttons-divider[_ngcontent-%COMP%]{width:1px;height:15px;background:var(--isp-dc-charlie-chaplin)}"],changeDetection:0});let h=n;return h})();var ou=["inputContainer"],au=["input"],lu=()=>({height:"15px",width:"15px"});function cu(h,n){if(h&1&&(Ae(0,"div",6),Ke(1,"isp-svg-icon",7),_t(2),Te()),h&2){let _=pe();Ce(2),jt(" ",_.error,`
`)}}var cc=(()=>{let n=class n{constructor(e){this.keydownService=e,this.path="",this.error="",this.navigate=new lt,this.close=new lt,this.mousePressedInside=!1,this.clickHandler=t=>{if(!this.inputContainer.nativeElement.contains(t.target)){if(this.mousePressedInside){this.mousePressedInside=!1;return}this.mousePressedInside=!1,this.close.emit()}},this.keydownService.listen$({code:["Enter","Escape"],context:"path-editor"}).pipe(ct()).subscribe(t=>{t.code==="Enter"?this.navigate.emit(this.input.nativeElement.value):this.close.emit()})}ngAfterViewInit(){setTimeout(()=>{document.addEventListener("click",this.clickHandler),this.input.nativeElement.focus()})}ngOnDestroy(){document.removeEventListener("click",this.clickHandler)}};n.\u0275fac=function(t){return new(t||n)(tt(vi))},n.\u0275cmp=ut({type:n,selectors:[["isp-path-editor"]],viewQuery:function(t,i){if(t&1&&(Dt(ou,5),Dt(au,5)),t&2){let r;It(r=Ot())&&(i.inputContainer=r.first),It(r=Ot())&&(i.input=r.first)}},inputs:{path:"path",error:"error"},outputs:{navigate:"navigate",close:"close"},decls:6,vars:4,consts:[["inputContainer",""],["input",""],[1,"path-editor__input-container",3,"mousedown"],["name","pencil",1,"path-editor__pencil",3,"customStyle"],["type","text",1,"path-editor__input",3,"value"],["class","path-editor__error",4,"ngIf"],[1,"path-editor__error"],["name","danger_s",1,"path-editor__error-icon"]],template:function(t,i){if(t&1){let r=it();Ae(0,"div",2,0),Ge("mousedown",function(){return Re(r),De(i.mousePressedInside=!0)}),Ke(2,"isp-svg-icon",3)(3,"input",4,1),Te(),je(5,cu,3,1,"div",5)}t&2&&(Ce(2),ge("customStyle",wt(3,lu)),Ce(),ge("value",i.path),Ce(2),ge("ngIf",i.error))},dependencies:[Wt,St],styles:["[_nghost-%COMP%]{display:flex;align-items:center}.path-editor__input-container[_ngcontent-%COMP%]{position:relative}.path-editor__pencil[_ngcontent-%COMP%]{position:absolute;top:6px;left:11px}.path-editor__input[_ngcontent-%COMP%]{width:415px;height:25px;padding-right:10px;padding-left:35px;font-family:inherit;background:var(--isp-dc-norilsk);border:none;border-radius:5px;outline:none}.path-editor__error[_ngcontent-%COMP%]{--isp-icons-main-color: var(--isp-dc-bright-emotions);display:flex;align-items:center;height:25px;margin-left:10px;color:var(--isp-dc-bright-emotions)}.path-editor__error-icon[_ngcontent-%COMP%]{margin-right:6px}"],changeDetection:0});let h=n;return h})();function du(h,n){if(h&1){let _=it();Ae(0,"isp-gallery",5),Ne(1,"async"),Ge("close",function(){Re(_);let t=pe(2);return De(t.closeGallery())})("delete",function(t){Re(_);let i=pe(2);return De(i.deleteFileFromGallery(t))})("download",function(t){Re(_);let i=pe(2);return De(i.downloadFileFromGallery(t))}),Te()}if(h&2){let _=n.ngIf,e=pe(2);ge("items",_)("activeIndex",Be(1,2,e.activeGalleryItemIndex$))}}function uu(h,n){if(h&1&&(Ke(0,"isp-progress-modal",17,2),Ne(2,"async")),h&2){let _=pe(2).ngIf;ge("state",Be(2,1,_.state.progressModalUploadStateSubject))}}function pu(h,n){if(h&1){let _=it();Ae(0,"isp-banner-slider",18),Ne(1,"async"),Ne(2,"async"),Ge("slidesCountChange",function(t){Re(_);let i=pe(3);return De(i.actualBannersCount$.next(t))}),Te()}if(h&2){let _=pe(3);oi("list__banner-slider_with-pagination",Be(1,3,_.actualBannersCount$)>1),ge("doc",Be(2,5,_.docWithNormalBanners$))}}function fu(h,n){if(h&1){let _=it();Ae(0,"isp-path-editor",19),Ne(1,"async"),Ne(2,"async"),Ge("close",function(){Re(_);let t=pe(3);return De(t.handlePathEditorCloseRequest())})("navigate",function(t){Re(_);let i=pe(3);return De(i.handlePathNavigate(t))}),Te()}if(h&2){let _=pe(3);ge("path",Be(1,2,_.path$))("error",Be(2,4,_.pathNavigateError$))}}function gu(h,n){if(h&1){let _=it();Ae(0,"isp-breadcrumbs",21),Ne(1,"async"),Ne(2,"async"),Ne(3,"async"),Ne(4,"async"),Ge("navigation",function(t){Re(_);let i=pe(4);return De(i.handleBreadcrumbsNavigation(t))})("favoritePathNavigate",function(t){Re(_);let i=pe(4);return De(i.handlePathNavigate(t))})("edit",function(){Re(_);let t=pe(4);return De(t.editPath$.next(!0))}),Te()}if(h&2){let _=pe(4);ge("data",Be(1,6,_.breadcrumbList$))("copiedMessage",Be(2,8,_.breadcrumbsCopiedMessage$))("copyPathMessage",Be(3,10,_.copyPathMessage$))("editPathMessage",Be(4,12,_.editPathMessage$))("editable",_.isFileManager())("showFavorite",_.isFileManager())}}function mu(h,n){if(h&1&&(je(0,gu,5,14,"isp-breadcrumbs",20),Ne(1,"async")),h&2){let _=pe(3);ge("ngIf",Be(1,1,_.hasBreadcrumbs$))}}function _u(h,n){if(h&1){let _=it();Ae(0,"isp-dragdrop-target",22),Ne(1,"async"),Ne(2,"async"),Ge("filesDropped",function(t){Re(_);let i=pe(3);return De(i.filesDropped(t))}),Te()}if(h&2){let _=pe(2).ngIf,e=pe();oi("list__dragdrop-target-hidden",Be(1,5,_.state.progressModalUploadStateSubject)),ge("dragOverElement",e.elementRef)("folderName",Be(2,7,e.currentFolderName$))("subTargets",e.getSubTargets())}}function bu(h,n){if(h&1){let _=it();Ke(0,"isp-progress-task-modal",6),je(1,uu,3,3,"isp-progress-modal",7),Ne(2,"async"),Ae(3,"div",8)(4,"isp-page-header",9),Ne(5,"async"),Ne(6,"async"),Ge("headerClick",function(){Re(_);let t=pe(2);return De(t.reloadTab())}),Te(),Ae(7,"isp-list-searchbar",10),Ge("searchType",function(t){Re(_);let i=pe(2);return De(i.handleTableSearch(t))}),Te()(),Ae(8,"div",11),je(9,pu,3,7,"isp-banner-slider",12),Ne(10,"async"),je(11,fu,3,6,"isp-path-editor",13),Ne(12,"async"),je(13,mu,2,3,"ng-template",null,1,Ht),Ae(15,"isp-toolbar",14),Ne(16,"async"),Ge("buttonClick",function(t){Re(_);let i=pe(2);return De(i.handleToolbarClick(t))}),Te(),Ke(17,"isp-dragon-filter"),Te(),Ae(18,"isp-table",15),Ge("propClick",function(t){Re(_);let i=pe(2);return De(i.handlePropClick(t))})("sort",function(t){Re(_);let i=pe(2);return De(i.handleSortEvent(t))})("pager",function(t){Re(_);let i=pe(2);return De(i.handlePagerEvent(t))})("rowDbClick",function(t){Re(_);let i=pe(2);return De(i.handleDbClick(t))})("cellValueLinkClick",function(t){Re(_);let i=pe(2);return De(i.handleCellValueLinkClick(t))})("rowButtonClick",function(t){Re(_);let i=pe(2);return De(i.handleToolbarClick(t))})("scrolledIndexChange",function(t){Re(_);let i=pe(2);return De(i.handleScrolledIndexChange(t))})("emptyButtonClick",function(t){Re(_);let i=pe(2);return De(i.handleEmptyButtonClick(t))}),je(19,_u,3,9,"isp-dragdrop-target",16),Te()}if(h&2){let _=Ct(14),e=pe().ngIf,t=pe();ge("tab",e),Ce(),ge("ngIf",Be(2,11,e.state.progressModalUploadStateSubject)),Ce(3),ge("tab",Be(5,13,t.tab$))("doc",Be(6,15,t.doc$)),Ce(5),ge("ngIf",Be(10,17,t.actualBannersCount$)>0),Ce(2),ge("ngIf",Be(12,19,t.editPath$))("ngIfElse",_),Ce(4),ge("toolbar",t.getToolbar())("messages",t.getMessageList())("selectedItems",Be(16,21,t.selectionList$)),Ce(4),ge("ngIf",t.isFileManager())}}function vu(h,n){if(h&1&&(Mt(0),je(1,du,2,4,"isp-gallery",4),Ne(2,"async"),je(3,bu,20,23,"ng-template",null,0,Ht),kt()),h&2){let _=Ct(4),e=pe();Ce(),ge("ngIf",Be(2,2,e.galleryItems$))("ngIfElse",_)}}var yu=1e3,hc=(()=>{let n=class n{constructor(e,t,i,r,m,o){this.actionService=e,this.listService=t,this.collectorService=i,this.fileUploadService=r,this.elementRef=m,this.destroyRef=o,this.tab$=this.listService.tab$,this.galleryItems$=this.listService.galleryItems$,this.activeGalleryItemIndex$=this.listService.activeGalleryItemIndex$,this.doc$=this.listService.doc$.pipe(mt(u=>{let d=u.banner?.filter(v=>v.$pinned).length||0;this.actualBannersCount$.next(d)})),this.actualBannersCount$=new st(0),this.docWithNormalBanners$=this.doc$.pipe(Je(u=>u.banner?.find(d=>d.$pinned)?u:null)),this.selectionList$=this.listService.selectionList$.pipe(Je(u=>this.listService.getElementListByElid(u))),this.breadcrumbsCopiedMessage$=this.doc$.pipe(Je(u=>nt.getMessage("path_copy_to_buffer",u))),this.copyPathMessage$=this.doc$.pipe(Je(u=>nt.getMessage("breadcrumb_copy_path",u))),this.editPathMessage$=this.doc$.pipe(Je(u=>nt.getMessage("breadcrumb_edit_path",u))),this.breadcrumbList$=this.listService.breadcrumbList$,this.path$=this.listService.path$,this.pathNavigateError$=this.listService.pathNavigateError$,this.hasBreadcrumbs$=this.listService.hasBreadcrumbs$,this.editPath$=this.listService.editPath$,this.currentFolderName$=this.listService.breadcrumbList$.pipe(Je(u=>this.listService.tab.func==="file"&&(u[u.length-1]?.$name.replace(/\//,"")||"/")||null))}setGalleryAutoExit(){this.path$.pipe(Zt(),ct(this.destroyRef)).subscribe(()=>this.closeGallery())}handlePathNavigate(e){this.listService.handlePathNavigate(e)}handlePathEditorCloseRequest(){this.editPath$.next(!1),this.pathNavigateError$.next("")}subscribeToSearchQuery(){this.listService.searchQuery$.pipe(Vt(e=>e!==""),ri(yu),ct(this.destroyRef)).subscribe(()=>{this.collectorService.append({event:"user_start_search",data:{func:this.listService.tab?.func}})})}updateTab(e){this.actionService.updateTab(this.listService.tab.func,ft(ft({},this.listService.tab.q),e),this.listService.tab)}subscribeToTab(){this.listService.subscribeToTab()}ngOnInit(){this.subscribeToTab(),this.subscribeToSearchQuery(),this.setGalleryAutoExit()}ngOnDestroy(){this.listService.listDestroy()}deleteFileFromGallery(e){this.listService.deleteFileFromGallery(e)}downloadFileFromGallery(e){this.listService.downloadFileFromGallery(e)}getToolbar(){return this.listService.getToolbar()}getMessageList(){return this.listService.getMessageSet()}handleDbClick(e){this.listService.doDefaultAction(e)}closeGallery(){this.listService.closeGallery()}handleCellValueLinkClick({elid:e,cell:t}){this.listService.handleCellValueLinkClick(e,t)}handleBreadcrumbsNavigation(e){let t={func:this.listService.tab?.doc?.$func,name:e.$name};Array.isArray(e.param)?e.param.forEach(r=>{t[r.$name]=r.$}):e.param.$&&(t[e.param.$name]=e.param.$);let i=this.listService.doc?.tparams?.table_params?.$;i&&(t.table_params=i),this.actionService.updateTab(this.listService.tab.func,t,this.listService.tab)}handleEmptyButtonClick(e){this.listService.handleEmptyButtonClick(e)}handleToolbarClick(e){this.listService.handleToolbarClick(e)}handlePropClick(e){this.listService.handlePropClick(e)}handleSortEvent(e){let t=ft(ft({},this.listService.tab.q),na(e,this.listService.getColumnMetaList()));this.updateTab(t),this.collectorService.append({event:"user_click_sort_table",data:{func:this.listService.tab?.func,col:e.sortField,dir:e.sortType}}),e.withCtrlKey&&this.collectorService.append({event:"user_click_sort_table_multiple",data:{func:this.listService.tab?.func,col:e.sortField,dir:e.sortType}})}handlePagerEvent(e){let t={p_num:e.currPage.toString(),p_cnt:e.pageSize.toString()};this.updateTab(t)}handleTableSearch(e){this.listService.nextSearchQuery(e)}handleScrolledIndexChange(e){this.listService.updateCurrentTabListScroll(e)}reloadTab(){this.listService.reloadTab()}filesDropped(e){let{uploadSubject:t,fileSubtree:i,folderName:r}=e;this.fileUploadService.uploadFromVirtualForm(t,i,r,this.listService.tab)}getSubTargets(){return[...this.elementRef.nativeElement.querySelectorAll("tr[foldername]")||[]].map(e=>({row:e,folderName:e.getAttribute("foldername")}))}isFileManager(){return this.listService.tab.func==="file"}};n.\u0275fac=function(t){return new(t||n)(tt(Ci),tt($t),tt(Vi),tt(Dn),tt(ci),tt(Rt))},n.\u0275cmp=ut({type:n,selectors:[["isp-list"]],decls:2,vars:3,consts:[["list",""],["breadcrumbs",""],["uploadFileProgressModal",""],[4,"ngIf"],[3,"items","activeIndex","close","delete","download",4,"ngIf","ngIfElse"],[3,"close","delete","download","items","activeIndex"],[3,"tab"],[3,"state",4,"ngIf"],[1,"list__title-wrapper"],[3,"headerClick","tab","doc"],[1,"list__search-bar",3,"searchType"],[1,"list__subheader"],["class","list__banner-slider",3,"doc","list__banner-slider_with-pagination","slidesCountChange",4,"ngIf"],["class","list__path-editor",3,"path","error","close","navigate",4,"ngIf","ngIfElse"],[3,"buttonClick","toolbar","messages","selectedItems"],[1,"list__table","isp-list-table",3,"propClick","sort","pager","rowDbClick","cellValueLinkClick","rowButtonClick","scrolledIndexChange","emptyButtonClick"],[3,"dragOverElement","folderName","subTargets","list__dragdrop-target-hidden","filesDropped",4,"ngIf"],[3,"state"],[1,"list__banner-slider",3,"slidesCountChange","doc"],[1,"list__path-editor",3,"close","navigate","path","error"],["class","list__breadcrumbs",3,"data","copiedMessage","copyPathMessage","editPathMessage","editable","showFavorite","navigation","favoritePathNavigate","edit",4,"ngIf"],[1,"list__breadcrumbs",3,"navigation","favoritePathNavigate","edit","data","copiedMessage","copyPathMessage","editPathMessage","editable","showFavorite"],[3,"filesDropped","dragOverElement","folderName","subTargets"]],template:function(t,i){t&1&&(je(0,vu,5,4,"ng-container",3),Ne(1,"async")),t&2&&ge("ngIf",Be(1,1,i.tab$))},dependencies:[St,Qa,Xo,ba,Bo,ya,Oa,ka,Za,lc,Do,Ea,cc,xt],styles:["[_nghost-%COMP%]{position:relative;display:flex;flex-flow:column nowrap;justify-content:flex-start;height:100%;padding:0 var(--isp-main-page__padding-right) 0 var(--isp-main-page__padding-left);overflow-y:auto}.list__title-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:25px;margin-bottom:25px;white-space:nowrap}.list__subheader[_ngcontent-%COMP%]{display:flex;flex-flow:column nowrap;justify-content:flex-start}.list__path-editor[_ngcontent-%COMP%], .list__breadcrumbs[_ngcontent-%COMP%]{margin-top:-7px;margin-bottom:15px}.list__search-bar[_ngcontent-%COMP%]{margin-left:auto}.list__toolbar[_ngcontent-%COMP%]{display:none;margin-bottom:20px}.list__toolbar_visible[_ngcontent-%COMP%]{display:flex}.list__table[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;flex-grow:1}.list__banner-slider[_ngcontent-%COMP%]{margin-top:-5px;margin-bottom:20px}.list__banner-slider_with-pagination[_ngcontent-%COMP%]{margin-top:-21px}.list__dragdrop-target-hidden[_ngcontent-%COMP%], .dragdrop-target_dragged-over.list__dragdrop-target-hidden[_ngcontent-%COMP%]{display:none}.list__wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;max-width:100%;white-space:nowrap}"],changeDetection:0});let h=n;return h})();var Cu=[{path:"",component:hc}],dc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[_s.forChild(Cu),_s]});let h=n;return h})();var uc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[wa]});let h=n;return h})();var pc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({providers:[Ai],imports:[Nt,Ni,So,ii,hi,In]});let h=n;return h})();var fc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,Ni,wi,Mn,hi,In]});let h=n;return h})();var gc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,ii,hi,Yo]});let h=n;return h})();var mc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,ma,ui]});let h=n;return h})();var _c=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({providers:[Un]});let h=n;return h})();var bc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,Ln,hi]});let h=n;return h})();var vc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({providers:[ji,zn,pi,Wi],imports:[Nt,bc,Po,ii,fa,Ni,bo,Wo,_c,Ko,gc,mc,fc,pc,_a,ga,ko,ui,jn]});let h=n;return h})();var yc=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({imports:[Nt,ii,ui,oc]});let h=n;return h})();var Tb=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=yt({type:n}),n.\u0275inj=vt({providers:[$t,Si,Rn],imports:[ui,ii,Nt,dc,vc,qo,va,$o,Go,wi,Ln,Ca,Fa,La,hi,Uo,uc,yc,No]});let h=n;return h})();export{Tb as ListModule};