@lateralus-ai/shipping-ui 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -27,7 +27,7 @@ Check the top-level render call using <`+He+">.")}return Re}}function jn(Q,Re){{
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,eu,_s,Kg,_s),Un[_s+eu]=!0}}return Q===r?Zi(Ut):mn(Ut),Ut}}function Wr(Q,Re,He){return sn(Q,Re,He,!0)}function ui(Q,Re,He){return sn(Q,Re,He,!1)}var Uc=ui,Es=Wr;Wc.Fragment=r,Wc.jsx=Uc,Wc.jsxs=Es}()),Wc}process.env.NODE_ENV==="production"?t0.exports=RE():t0.exports=IE();var ve=t0.exports;const NE=()=>ve.jsx("div",{className:"bg-red-800 text-white p-2",children:"Hello world"});function ME(){for(var i=0,e,t,r="";i<arguments.length;)(e=arguments[i++])&&(t=F2(e))&&(r&&(r+=" "),r+=t);return r}function F2(i){if(typeof i=="string")return i;for(var e,t="",r=0;r<i.length;r++)i[r]&&(e=F2(i[r]))&&(t&&(t+=" "),t+=e);return t}var Db="-";function LE(i){var e=FE(i);function t(n){var s=n.split(Db);return s[0]===""&&s.length!==1&&s.shift(),B2(s,e)||OE(n)}function r(n){return i.conflictingClassGroups[n]||[]}return{getClassGroupId:t,getConflictingClassGroupIds:r}}function B2(i,e){var a;if(i.length===0)return e.classGroupId;var t=i[0],r=e.nextPart.get(t),n=r?B2(i.slice(1),r):void 0;if(n)return n;if(e.validators.length!==0){var s=i.join(Db);return(a=e.validators.find(function(o){var l=o.validator;return l(s)}))==null?void 0:a.classGroupId}}var Gv=/^\[(.+)\]$/;function OE(i){if(Gv.test(i)){var e=Gv.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function FE(i){var e=i.theme,t=i.prefix,r={nextPart:new Map,validators:[]},n=zE(Object.entries(i.classGroups),t);return n.forEach(function(s){var a=s[0],o=s[1];r0(o,r,a,e)}),r}function r0(i,e,t,r){i.forEach(function(n){if(typeof n=="string"){var s=n===""?e:qv(e,n);s.classGroupId=t;return}if(typeof n=="function"){if(BE(n)){r0(n(r),e,t,r);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(function(a){var o=a[0],l=a[1];r0(l,qv(e,o),t,r)})})}function qv(i,e){var t=i;return e.split(Db).forEach(function(r){t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function BE(i){return i.isThemeGetter}function zE(i,e){return e?i.map(function(t){var r=t[0],n=t[1],s=n.map(function(a){return typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(function(o){var l=o[0],c=o[1];return[e+l,c]})):a});return[r,s]}):i}function jE(i){if(i<1)return{get:function(){},set:function(){}};var e=0,t=new Map,r=new Map;function n(s,a){t.set(s,a),e++,e>i&&(e=0,r=t,t=new Map)}return{get:function(a){var o=t.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return n(a,o),o},set:function(a,o){t.has(a)?t.set(a,o):n(a,o)}}}var z2="!";function UE(i){var e=i.separator||":";return function(r){for(var n=0,s=[],a=0,o=0;o<r.length;o++){var l=r[o];n===0&&l===e[0]&&(e.length===1||r.slice(o,o+e.length)===e)&&(s.push(r.slice(a,o)),a=o+e.length),l==="["?n++:l==="]"&&n--}var c=s.length===0?r:r.substring(a),h=c.startsWith(z2),d=h?c.substring(1):c;return{modifiers:s,hasImportantModifier:h,baseClassName:d}}}function HE(i){if(i.length<=1)return i;var e=[],t=[];return i.forEach(function(r){var n=r[0]==="[";n?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function $E(i){return{cache:jE(i.cacheSize),splitModifiers:UE(i),...LE(i)}}var VE=/\s+/;function GE(i,e){var t=e.splitModifiers,r=e.getClassGroupId,n=e.getConflictingClassGroupIds,s=new Set;return i.trim().split(VE).map(function(a){var o=t(a),l=o.modifiers,c=o.hasImportantModifier,h=o.baseClassName,d=r(h);if(!d)return{isTailwindClass:!1,originalClassName:a};var p=HE(l).join(":"),g=c?p+z2:p;return{isTailwindClass:!0,modifierId:g,classGroupId:d,originalClassName:a}}).reverse().filter(function(a){if(!a.isTailwindClass)return!0;var o=a.modifierId,l=a.classGroupId,c=o+l;return s.has(c)?!1:(s.add(c),n(l).forEach(function(h){return s.add(o+h)}),!0)}).reverse().map(function(a){return a.originalClassName}).join(" ")}function qE(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];var r,n,s,a=o;function o(c){var h=e[0],d=e.slice(1),p=d.reduce(function(g,y){return y(g)},h());return r=$E(p),n=r.cache.get,s=r.cache.set,a=l,l(c)}function l(c){var h=n(c);if(h)return h;var d=GE(c,r);return s(c,d),d}return function(){return a(ME.apply(null,arguments))}}function sr(i){var e=function(r){return r[i]||[]};return e.isThemeGetter=!0,e}var j2=/^\[(?:([a-z-]+):)?(.+)\]$/i,WE=/^\d+\/\d+$/,XE=new Set(["px","full","screen"]),YE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh)/,KE=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Di(i){return Sh(i)||XE.has(i)||WE.test(i)||_o(i)}function _o(i){return Gl(i,"length",r_)}function QE(i){return Gl(i,"size",U2)}function JE(i){return Gl(i,"position",U2)}function e_(i){return Gl(i,"url",n_)}function cm(i){return Gl(i,"number",Sh)}function Sh(i){return!Number.isNaN(Number(i))}function Xc(i){return Wv(i)||Gl(i,"number",Wv)}function Sr(i){return j2.test(i)}function Yc(){return!0}function ma(i){return YE.test(i)}function t_(i){return Gl(i,"",i_)}function Gl(i,e,t){var r=j2.exec(i);return r?r[1]?r[1]===e:t(r[2]):!1}function r_(i){return ZE.test(i)}function U2(){return!1}function n_(i){return i.startsWith("url(")}function Wv(i){return Number.isInteger(Number(i))}function i_(i){return KE.test(i)}function s_(){var i=sr("colors"),e=sr("spacing"),t=sr("blur"),r=sr("brightness"),n=sr("borderColor"),s=sr("borderRadius"),a=sr("borderSpacing"),o=sr("borderWidth"),l=sr("contrast"),c=sr("grayscale"),h=sr("hueRotate"),d=sr("invert"),p=sr("gap"),g=sr("gradientColorStops"),y=sr("inset"),b=sr("margin"),w=sr("opacity"),v=sr("padding"),A=sr("saturate"),E=sr("scale"),_=sr("sepia"),C=sr("skew"),I=sr("space"),k=sr("translate"),D=function(){return["auto","contain","none"]},R=function(){return["auto","hidden","clip","visible","scroll"]},z=function(){return["auto",e]},G=function(){return["",Di]},O=function(){return["auto",Sh,Sr]},X=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},S=function(){return["solid","dashed","dotted","double","none"]},J=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},Y=function(){return["start","end","center","between","around","evenly"]},W=function(){return["","0",Sr]},fe=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},K=function(){return[Sh,cm]},be=function(){return[Sh,Sr]};return{cacheSize:500,theme:{colors:[Yc],spacing:[Di],blur:["none","",ma,_o],brightness:K(),borderColor:[i],borderRadius:["none","","full",ma,_o],borderSpacing:[e],borderWidth:G(),contrast:K(),grayscale:W(),hueRotate:be(),invert:W(),gap:[e],gradientColorStops:[i],inset:z(),margin:z(),opacity:K(),padding:[e],saturate:K(),scale:K(),sepia:W(),skew:be(),space:[e],translate:[e]},classGroups:{aspect:[{aspect:["auto","square","video",Sr]}],container:["container"],columns:[{columns:[ma]}],"break-after":[{"break-after":fe()}],"break-before":[{"break-before":fe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(X(),[Sr])}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xc]}],basis:[{basis:[e]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Sr]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Xc]}],"grid-cols":[{"grid-cols":[Yc]}],"col-start-end":[{col:["auto",{span:[Xc]},Sr]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Yc]}],"row-start-end":[{row:["auto",{span:[Xc]},Sr]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Sr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Sr]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:Y()}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:[].concat(Y(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Y(),["baseline","stretch"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",e]}],"min-w":[{"min-w":["min","max","fit",Di]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ma]},ma,_o]}],h:[{h:[e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Di]}],"max-h":[{"max-h":[e,"min","max","fit"]}],"font-size":[{text:["base",ma,_o]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cm]}],"font-family":[{font:[Yc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",_o]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Di]}],"list-style-type":[{list:["none","disc","decimal",Sr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(S(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",Di]}],"underline-offset":[{"underline-offset":["auto",Di]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:[e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_o]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap"]}],break:[{break:["normal","words","all","keep"]}],content:[{content:["none",Sr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(X(),[JE])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",QE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},e_]}],"bg-color":[{bg:[i]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[].concat(S(),["hidden"])}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:S()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(S())}],"outline-offset":[{"outline-offset":[Di]}],"outline-w":[{outline:[Di]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Di]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",ma,t_]}],"shadow-color":[{shadow:[Yc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":J()}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ma,Sr]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[A]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Sr]}],duration:[{duration:be()}],ease:[{ease:["linear","in","out","in-out",Sr]}],delay:[{delay:be()}],animate:[{animate:["none","spin","ping","pulse","bounce",Sr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Xc,Sr]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Sr]}],accent:[{accent:["auto",i]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Sr]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":[e]}],"scroll-mx":[{"scroll-mx":[e]}],"scroll-my":[{"scroll-my":[e]}],"scroll-mt":[{"scroll-mt":[e]}],"scroll-mr":[{"scroll-mr":[e]}],"scroll-mb":[{"scroll-mb":[e]}],"scroll-ml":[{"scroll-ml":[e]}],"scroll-p":[{"scroll-p":[e]}],"scroll-px":[{"scroll-px":[e]}],"scroll-py":[{"scroll-py":[e]}],"scroll-pt":[{"scroll-pt":[e]}],"scroll-pr":[{"scroll-pr":[e]}],"scroll-pb":[{"scroll-pb":[e]}],"scroll-pl":[{"scroll-pl":[e]}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Sr]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[Di,cm]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]}}}var a_=qE(s_);function H2(i){var e,t,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i))for(e=0;e<i.length;e++)i[e]&&(t=H2(i[e]))&&(r&&(r+=" "),r+=t);else for(e in i)i[e]&&(r&&(r+=" "),r+=e);return r}function o_(){for(var i,e,t=0,r="";t<arguments.length;)(i=arguments[t++])&&(e=H2(i))&&(r&&(r+=" "),r+=e);return r}function so(...i){return a_(o_(i))}function l_({className:i="",size:e="1em"}){return ve.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:[ve.jsx("path",{d:"M12.001 7.7395C12.2367 7.73978 12.4591 7.85076 12.6006 8.03931L15.376 11.7395C15.5459 11.9666 15.5731 12.2708 15.4463 12.5247C15.3193 12.7785 15.0592 12.9395 14.7754 12.9397H12.75V17.2766C12.7499 17.6907 12.4142 18.0266 12 18.0266C11.5858 18.0266 11.2501 17.6907 11.25 17.2766V12.9397H9.22559C8.94169 12.9397 8.68182 12.7785 8.55469 12.5247C8.42778 12.2706 8.45558 11.9667 8.62598 11.7395L11.4004 8.03931L11.457 7.97192C11.5977 7.82422 11.7945 7.7395 12.001 7.7395Z",fill:"currentColor"}),ve.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.65161C17.5228 2.65161 22 7.12876 22 12.6516C22 18.1744 17.5228 22.6516 12 22.6516C6.47715 22.6516 2 18.1744 2 12.6516C2 7.12876 6.47715 2.65161 12 2.65161ZM12 4.15161C7.30558 4.15161 3.5 7.95719 3.5 12.6516C3.5 17.346 7.30558 21.1516 12 21.1516C16.6944 21.1516 20.5 17.346 20.5 12.6516C20.5 7.95719 16.6944 4.15161 12 4.15161Z",fill:"currentColor"})]})}function u_({className:i="",size:e="1em"}){return ve.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:ve.jsx("path",{d:"M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17316C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8078C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C21.9971 9.34871 20.9426 6.80684 19.0679 4.9321C17.1932 3.05736 14.6513 2.00287 12 2ZM15.7092 11.7642C15.6751 11.8349 15.6217 11.8945 15.5553 11.9363C15.4888 11.978 15.4118 12.0001 15.3333 12H12.8333V16.1667C12.8333 16.3877 12.7455 16.5996 12.5893 16.7559C12.433 16.9122 12.221 17 12 17C11.779 17 11.567 16.9122 11.4107 16.7559C11.2545 16.5996 11.1667 16.3877 11.1667 16.1667V12H8.66667C8.58819 12 8.5113 11.9779 8.44484 11.9362C8.37839 11.8945 8.32507 11.8348 8.29102 11.7641C8.25697 11.6934 8.24359 11.6145 8.2524 11.5365C8.26121 11.4586 8.29187 11.3847 8.34084 11.3233L11.6742 7.15667C11.7146 7.10991 11.7646 7.07241 11.8209 7.04671C11.8771 7.021 11.9382 7.0077 12 7.0077C12.0618 7.0077 12.1229 7.021 12.1791 7.04671C12.2354 7.07241 12.2854 7.10991 12.3258 7.15667L15.6592 11.3233C15.7082 11.3846 15.7389 11.4585 15.7477 11.5365C15.7566 11.6145 15.7432 11.6934 15.7092 11.7642Z",fill:"#1DA56A"})})}const c_=({tooltipContent:i="Send message",className:e,...t})=>{const[r,n]=Pe.useState(!1);return ve.jsx(Mt.Tooltip,{content:i,children:ve.jsx(Mt.IconButton,{variant:"text",color:"gray",className:so(e,"hover:rounded-lg hover:bg-gray-100"),type:"submit",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),...t,children:r?ve.jsx(u_,{className:"size-6 "}):ve.jsx(l_,{className:"size-6 "})})})},$2=({onSubmit:i=()=>{},...e})=>ve.jsx(kE,{autoFocus:!0,placeholder:"Write your message here",className:"pl-1 block w-full focus:outline-none max-h-32 resize-none placeholder:text-gray-400",onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),i())},...e}),h_=({bottom:i,right:e,top:t,textArea:r=ve.jsx($2,{}),...n})=>ve.jsxs("div",{className:"border gap-2 rounded-lg bg-white shadow-[0px_2px_2px_0px_#0000000A,0px_8px_8px_-8px_#0000000A] border-gray-100",...n,children:[t,ve.jsxs("div",{className:"flex gap-2 p-4 rounded-lg bg-white",children:[ve.jsxs("div",{className:"grow flex flex-col items-start justify-center",children:[r,i]}),ve.jsx("div",{className:"shrink flex items-end justify-end",children:e})]})]}),d_=Object.freeze(Object.defineProperty({__proto__:null,Container:h_,SubmitButton:c_,Textarea:$2},Symbol.toStringTag,{value:"Module"})),ql=Pe.createContext(void 0),V2=({children:i,isCollapsed:e,onSwitchLayout:t})=>{const[r,n]=Pe.useState(!1),[s,a]=Pe.useState(!1),o=e!==void 0?e:r,l=c=>{const h=c??!o;e===void 0&&n(h),t==null||t(h)};return ve.jsx(ql.Provider,{value:{isCollapsed:o,toggleCollapsed:l,isHovered:s,setIsHovered:a},children:i})},G2=({className:i,children:e,...t})=>{const{isCollapsed:r,isHovered:n,setIsHovered:s}=Pe.useContext(ql);return ve.jsx("div",{className:so(i,r&&"shadow-lg rounded-lg",r&&!n?"w-auto":"w-[280px]","bg-gray-50 p-2 flex flex-col justify-between items-center rounded-tr-lg rounded-br-lg"),onMouseEnter:()=>r&&s(!0),onMouseLeave:()=>r&&s(!1),...t,children:e})},q2=({className:i,children:e,...t})=>{const{isCollapsed:r,setIsHovered:n}=Pe.useContext(ql);return ve.jsx("div",{className:so(i,r&&"!hidden","p-2 flex flex-col gap-2 items-center rounded-tl-lg rounded-bl-lg w-16"),onMouseEnter:()=>r&&n(!0),onMouseLeave:()=>r&&n(!1),...t,children:e})},f_=({className:i,children:e,isCollapsed:t,sideContainer:r,sideClassName:n,onSwitchLayout:s,...a})=>ve.jsxs(V2,{isCollapsed:t,onSwitchLayout:s,children:[r&&ve.jsx(q2,{className:n,children:r}),ve.jsx(G2,{className:i,...a,children:e})]}),p_=({icon:i,children:e,...t})=>{const{isCollapsed:r,isHovered:n}=Pe.useContext(ql);return ve.jsxs("button",{className:"flex items-center gap-2 w-full hover:bg-gray-100 text-caption-1-em text-gray-600 hover:text-gray-900 h-[38px] rounded-lg px-2",...t,children:[i," ",(!r||n)&&e]})};function g_(i){return ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M13 1C14.6569 1 16 2.34315 16 4V12L15.9961 12.1543C15.9158 13.7394 14.6051 15 13 15H3L2.8457 14.9961C1.31166 14.9184 0.0816253 13.6883 0.00390625 12.1543L0 12V4C1.28853e-07 2.34315 1.34315 1 3 1H13ZM3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3ZM3.75 3.5C4.16421 3.5 4.5 3.83579 4.5 4.25V11.75C4.5 12.1642 4.16421 12.5 3.75 12.5C3.33579 12.5 3 12.1642 3 11.75V4.25C3 3.83579 3.33579 3.5 3.75 3.5Z",fill:"currentColor"})})}function m_(i){return ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M13 1C14.6569 1 16 2.34315 16 4V12L15.9961 12.1543C15.9158 13.7394 14.6051 15 13 15H3L2.8457 14.9961C1.31166 14.9184 0.0816253 13.6883 0.00390625 12.1543L0 12V4C1.28853e-07 2.34315 1.34315 1 3 1H13ZM3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3ZM7.5 4C7.77614 4 8 4.22386 8 4.5V11.5C8 11.7761 7.77614 12 7.5 12H3.5C3.22386 12 3 11.7761 3 11.5V4.5C3 4.22386 3.22386 4 3.5 4H7.5Z",fill:"currentColor"})})}const b_=()=>{const{isCollapsed:i,isHovered:e,toggleCollapsed:t}=Pe.useContext(ql);return i&&!e?null:ve.jsx(Mt.IconButton,{variant:"text",color:"gray",onClick:()=>t(),children:i?ve.jsx(g_,{className:"size-4"}):ve.jsx(m_,{className:"size-4"})})},v_=({children:i,className:e,icon:t,isActive:r,trailing:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(ql);return ve.jsxs("div",{className:so(r?"!text-gray-900":"!text-gray-600","flex items-center justify-between w-full hover:bg-gray-100 text-caption-1-em hover:text-gray-900 h-[38px] rounded-lg px-2 cursor-pointer group",e),...s,children:[ve.jsxs("div",{className:"flex items-center gap-2",children:[t,(!a||o)&&i]}),(!a||o)&&n]})},y_=({children:i,className:e,isActive:t,trailing:r,icon:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(ql);return ve.jsxs("div",{className:so(t?"!text-gray-900":"!text-gray-600","flex items-center justify-between w-full hover:bg-gray-100 text-caption-1-em hover:text-gray-900 h-[38px] rounded-lg pr-2 pl-3 cursor-pointer group text-sm",e),...s,children:[ve.jsxs("div",{className:"flex items-center gap-2 overflow-auto",children:[(!a||o)&&n," ",(!a||o)&&i]}),(!a||o)&&r]})},w_=Object.freeze(Object.defineProperty({__proto__:null,Button:p_,Container:G2,Item:v_,Layout:f_,Provider:V2,SecondaryItem:y_,SideContainer:q2,ToggleCollapseButton:b_},Symbol.toStringTag,{value:"Module"})),x_=i=>ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M12.7197 2.21954C13.0125 1.92683 13.4874 1.92694 13.7803 2.21954C14.073 2.51241 14.073 2.98722 13.7803 3.28008L9.05955 7.99981L13.7803 12.7205L13.832 12.7772C14.0721 13.0717 14.0548 13.5065 13.7803 13.7811C13.5057 14.0555 13.0709 14.0729 12.7764 13.8328L12.7197 13.7811L7.99901 9.06036L3.27928 13.7811C2.9864 14.0737 2.51156 14.0738 2.21873 13.7811C1.92618 13.4882 1.92616 13.0133 2.21873 12.7205L6.93846 7.99981L2.21873 3.28008C1.92615 2.98722 1.92607 2.51235 2.21873 2.21954C2.51154 1.92673 2.98637 1.92691 3.27928 2.21954L7.99901 6.93926L12.7197 2.21954Z",fill:"currentColor"})}),A_=({onClose:i,right:e,children:t})=>ve.jsxs("div",{className:"bg-gray-50 flex gap-2 items-center px-2 py-3 rounded-t-xl",children:[ve.jsx("div",{className:"grow text-subheader-em",children:t}),ve.jsxs("div",{className:"flex items-center gap-4",children:[e,ve.jsx(Mt.IconButton,{variant:"text",size:"sm",color:"gray",className:"rounded-full",onClick:i,children:ve.jsx(x_,{className:"size-4 text-gray-600"})})]})]}),W2={Header:A_},X2=i=>ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M2.25 5.5C2.66421 5.5 3 5.83579 3 6.25C3 6.66421 2.66421 7 2.25 7H2C1.72386 7 1.5 7.22386 1.5 7.5V13.5C1.5 13.7761 1.72386 14 2 14H8C8.27614 14 8.5 13.7761 8.5 13.5V13.25C8.5 12.8358 8.83579 12.5 9.25 12.5C9.66421 12.5 10 12.8358 10 13.25V13.5C10 14.5357 9.21278 15.387 8.2041 15.4893L8 15.5H2L1.7959 15.4893C0.854346 15.3938 0.1062 14.6457 0.0107422 13.7041L0 13.5V7.5C0 6.39543 0.895431 5.5 2 5.5H2.25ZM13.75 0C14.7165 1.28853e-07 15.5 0.783502 15.5 1.75V9.75C15.5 10.7165 14.7165 11.5 13.75 11.5H5.75C4.7835 11.5 4 10.7165 4 9.75V1.75C4 0.783502 4.7835 8.0532e-09 5.75 0H13.75ZM5.75 1.5C5.61193 1.5 5.5 1.61193 5.5 1.75V9.75C5.5 9.88807 5.61193 10 5.75 10H13.75C13.8881 10 14 9.88807 14 9.75V1.75C14 1.61193 13.8881 1.5 13.75 1.5H5.75ZM11.75 3C11.795 3 11.839 3.00413 11.8818 3.01172C11.8874 3.0127 11.8929 3.01354 11.8984 3.01465C11.9118 3.01733 11.9244 3.02298 11.9375 3.02637C11.9707 3.03495 12.0041 3.04344 12.0361 3.05664C12.0653 3.06868 12.092 3.08512 12.1191 3.10059C12.1763 3.1331 12.2316 3.171 12.2803 3.21973C12.3287 3.26812 12.366 3.3232 12.3984 3.37988C12.414 3.40703 12.4303 3.43375 12.4424 3.46289C12.4631 3.51289 12.4779 3.56459 12.4873 3.61719C12.495 3.66035 12.5 3.70462 12.5 3.75V7.75C12.5 8.16421 12.1642 8.5 11.75 8.5C11.3358 8.5 11 8.16421 11 7.75V5.56055L8.28027 8.28027C7.98738 8.57317 7.51262 8.57317 7.21973 8.28027C6.92683 7.98738 6.92683 7.51262 7.21973 7.21973L9.93945 4.5H7.75C7.33579 4.5 7 4.16421 7 3.75C7 3.33579 7.33579 3 7.75 3H11.75Z",fill:"currentColor"})}),Y2=(i=100,e=50,t=990,r=10)=>{const[n,s]=Pe.useState(i);return[n,{...{zoomIn:()=>s(l=>Math.min(l+r,t)),zoomOut:()=>s(l=>Math.max(l-r,e)),reset:()=>s(i),zoomToValue:l=>s(Math.max(e,Math.min(l,t)))},handleWheel:l=>{l.preventDefault();const c=l.deltaY>0?-r:r;s(h=>Math.max(e,Math.min(h+c,t)))}}]},Z2=()=>{const[i,e]=Pe.useState(0);return[i,{rotateClockwise:()=>e(r=>(r+90)%360),rotateCounterClockwise:()=>e(r=>(r-90+360)%360)}]},K2=()=>{const[i,e]=Pe.useState({x:0,y:0}),[t,r]=Pe.useState(!1),[n,s]=Pe.useState({x:0,y:0});return[{pan:i,isDragging:t},{handleMouseDown:h=>{r(!0),s({x:h.clientX-i.x,y:h.clientY-i.y})},handleMouseMove:h=>{t&&e({x:h.clientX-n.x,y:h.clientY-n.y})},handleMouseUp:()=>{r(!1)},reset:()=>e({x:0,y:0})}]},Q2=(i=0)=>{const[e,t]=Pe.useState(1),[r,n]=Pe.useState(i),s={nextPage:Pe.useCallback(()=>{t(a=>a<r?a+1:a)},[r]),prevPage:Pe.useCallback(()=>{t(a=>Math.max(a-1,1))},[]),goToPage:Pe.useCallback(a=>{t(()=>Math.max(1,Math.min(a,r)))},[r]),setTotalPages:Pe.useCallback(a=>{n(a),t(o=>Math.min(o,a))},[])};return[{currentPage:e,totalPages:r},s]},E_=({className:i,onClose:e,totalPages:t,getImageSrc:r,documentUrl:n,title:s="PDF Viewer"})=>{const[a,o]=Y2(),[l,c]=Z2(),[{pan:h,isDragging:d},p]=K2(),[{currentPage:g},y]=Q2(t),[b,w]=Pe.useState(()=>{const A=r(g);return typeof A=="string"?A:""});Pe.useEffect(()=>{let A=!0;return(async()=>{const _=r(g),C=await Promise.resolve(_);A&&w(C)})(),()=>{A=!1}},[g,r]);const v=ve.jsx(Mt.IconButton,{variant:"text",color:"gray",children:ve.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:ve.jsx(X2,{className:"size-4"})})});return ve.jsxs("div",{className:so("shadow rounded-t-lg flex flex-col h-full",i),children:[ve.jsx(W2.Header,{onClose:e,right:v,children:s}),ve.jsx("div",{className:"flex-1 grid",children:ve.jsxs("div",{className:"grid relative",children:[ve.jsx("div",{className:"overflow-hidden col-start-1 row-start-1 bg-gray-200 h-full relative",onMouseMove:p.handleMouseMove,onMouseUp:p.handleMouseUp,onMouseLeave:p.handleMouseUp,onWheel:o.handleWheel,children:ve.jsx("div",{style:{transform:`translate(${h.x}px, ${h.y}px)`,cursor:d?"grabbing":"grab",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:p.handleMouseDown,children:ve.jsx("div",{style:{transform:`scale(${a/100}) rotate(${l}deg)`,transformOrigin:"center",transition:d?"none":"transform 0.3s ease"},children:b?ve.jsx("img",{src:b,style:{userSelect:"none",pointerEvents:"none"}}):null})})}),ve.jsxs("div",{className:"col-start-1 row-start-1 self-end p-4 flex gap-2 justify-between w-full z-10",children:[ve.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomOut,children:ve.jsx(vi.Icon,{icon:"lucide:minus"})}),ve.jsx(Mt.Tooltip,{content:"Click to reset zoom and pan",children:ve.jsxs("button",{className:"!bg-white text-center cursor-pointer w-[60px]",onClick:()=>{o.reset(),p.reset()},children:[a,"%"]})}),ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomIn,children:ve.jsx(vi.Icon,{icon:"lucide:plus"})})]}),ve.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateClockwise,children:ve.jsx(vi.Icon,{icon:"lucide:iteration-cw"})}),ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateCounterClockwise,children:ve.jsx(vi.Icon,{icon:"lucide:iteration-ccw"})})]}),ve.jsxs(Mt.ButtonGroup,{className:"divide-x-0 ",children:[ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.prevPage,disabled:g===1,children:ve.jsx(vi.Icon,{icon:"lucide:chevron-left"})}),ve.jsx("input",{className:"bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]",value:g,onChange:A=>{const E=parseInt(A.target.value);isNaN(E)||y.goToPage(E)},type:"number",min:"1",max:t}),ve.jsxs("div",{className:"flex items-center bg-white px-2",children:["of ",t]}),ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.nextPage,disabled:g===t,children:ve.jsx(vi.Icon,{icon:"lucide:chevron-right"})})]})]})]})})]})},_n=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),n0=[.001,0,0,.001,0,0],hm=1.35,ii={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},vs={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},J2="pdfjs_internal_editor_",ot={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},kt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},e1={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},on={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Th={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},wr={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},su={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Cf={ERRORS:0,WARNINGS:1,INFOS:5},Ph={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},ep={moveTo:0,lineTo:1,curveTo:2,closePath:3},t1={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Cg=Cf.WARNINGS;function __(i){Number.isInteger(i)&&(Cg=i)}function C_(){return Cg}function Sg(i){Cg>=Cf.INFOS&&console.log(`Info: ${i}`)}function ut(i){Cg>=Cf.WARNINGS&&console.log(`Warning: ${i}`)}function Wt(i){throw new Error(i)}function Dr(i,e){i||Wt(e)}function S_(i){switch(i==null?void 0:i.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Pb(i,e=null,t=null){if(!i)return null;if(t&&typeof i=="string"){if(t.addDefaultProtocol&&i.startsWith("www.")){const n=i.match(/\./g);(n==null?void 0:n.length)>=2&&(i=`http://${i}`)}if(t.tryConvertEncoding)try{i=R_(i)}catch{}}const r=e?URL.parse(i,e):URL.parse(i);return S_(r)?r:null}function Rb(i,e,t=!1){const r=URL.parse(i);return r?(r.hash=e,r.href):t&&Pb(i,"http://example.com")?i.split("#",1)[0]+`${e?`#${e}`:""}`:""}function Ct(i,e,t,r=!1){return Object.defineProperty(i,e,{value:t,enumerable:!r,configurable:!0,writable:!1}),t}const Wl=function(){function e(t,r){this.message=t,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class Xv extends Wl{constructor(e,t){super(e,"PasswordException"),this.code=t}}class dm extends Wl{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class Wp extends Wl{constructor(e){super(e,"InvalidPDFException")}}class Rh extends Wl{constructor(e,t,r){super(e,"ResponseException"),this.status=t,this.missing=r}}class T_ extends Wl{constructor(e){super(e,"FormatError")}}class ha extends Wl{constructor(e){super(e,"AbortException")}}function r1(i){(typeof i!="object"||(i==null?void 0:i.length)===void 0)&&Wt("Invalid argument for bytesToString");const e=i.length,t=8192;if(e<t)return String.fromCharCode.apply(null,i);const r=[];for(let n=0;n<e;n+=t){const s=Math.min(n+t,e),a=i.subarray(n,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function Sf(i){typeof i!="string"&&Wt("Invalid argument for stringToBytes");const e=i.length,t=new Uint8Array(e);for(let r=0;r<e;++r)t[r]=i.charCodeAt(r)&255;return t}function k_(i){return String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255)}function D_(){const i=new Uint8Array(4);return i[0]=1,new Uint32Array(i.buffer,0,1)[0]===1}function P_(){try{return new Function(""),!0}catch{return!1}}class qr{static get isLittleEndian(){return Ct(this,"isLittleEndian",D_())}static get isEvalSupported(){return Ct(this,"isEvalSupported",P_())}static get isOffscreenCanvasSupported(){return Ct(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Ct(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return Ct(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){var e,t;return Ct(this,"isCSSRoundSupported",(t=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:t.call(e,"width: round(1.5px, 1px)"))}}const fm=Array.from(Array(256).keys(),i=>i.toString(16).padStart(2,"0"));var ua,pp,i0;class Qe{static makeHexColor(e,t,r){return`#${fm[e]}${fm[t]}${fm[r]}`}static scaleMinMax(e,t){let r;e[0]?(e[0]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[3],t[3]*=e[3]):(r=t[0],t[0]=t[1],t[1]=r,r=t[2],t[2]=t[3],t[3]=r,e[1]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t,r=0){const n=e[r],s=e[r+1];e[r]=n*t[0]+s*t[2]+t[4],e[r+1]=n*t[1]+s*t[3]+t[5]}static applyTransformToBezier(e,t,r=0){const n=t[0],s=t[1],a=t[2],o=t[3],l=t[4],c=t[5];for(let h=0;h<6;h+=2){const d=e[r+h],p=e[r+h+1];e[r+h]=d*n+p*a+l,e[r+h+1]=d*s+p*o+c}}static applyInverseTransform(e,t){const r=e[0],n=e[1],s=t[0]*t[3]-t[1]*t[2];e[0]=(r*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/s,e[1]=(-r*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/s}static axialAlignedBoundingBox(e,t,r){const n=t[0],s=t[1],a=t[2],o=t[3],l=t[4],c=t[5],h=e[0],d=e[1],p=e[2],g=e[3];let y=n*h+l,b=y,w=n*p+l,v=w,A=o*d+c,E=A,_=o*g+c,C=_;if(s!==0||a!==0){const I=s*h,k=s*p,D=a*d,R=a*g;y+=D,v+=D,w+=R,b+=R,A+=I,C+=I,_+=k,E+=k}r[0]=Math.min(r[0],y,w,b,v),r[1]=Math.min(r[1],A,_,E,C),r[2]=Math.max(r[2],y,w,b,v),r[3]=Math.max(r[3],A,_,E,C)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const r=e[0],n=e[1],s=e[2],a=e[3],o=r**2+n**2,l=r*s+n*a,c=s**2+a**2,h=(o+c)/2,d=Math.sqrt(h**2-(o*c-l**2));t[0]=Math.sqrt(h+d||1),t[1]=Math.sqrt(h-d||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>n)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>a?null:[r,s,n,a]}static pointBoundingBox(e,t,r){r[0]=Math.min(r[0],e),r[1]=Math.min(r[1],t),r[2]=Math.max(r[2],e),r[3]=Math.max(r[3],t)}static rectBoundingBox(e,t,r,n,s){s[0]=Math.min(s[0],e,r),s[1]=Math.min(s[1],t,n),s[2]=Math.max(s[2],e,r),s[3]=Math.max(s[3],t,n)}static bezierBoundingBox(e,t,r,n,s,a,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,l),L(this,ua,i0).call(this,e,r,s,o,t,n,a,l,3*(-e+3*(r-s)+o),6*(e-2*r+s),3*(r-e),c),L(this,ua,i0).call(this,e,r,s,o,t,n,a,l,3*(-t+3*(n-a)+l),6*(t-2*n+a),3*(n-t),c)}}ua=new WeakSet,pp=function(e,t,r,n,s,a,o,l,c,h){if(c<=0||c>=1)return;const d=1-c,p=c*c,g=p*c,y=d*(d*(d*e+3*c*t)+3*p*r)+g*n,b=d*(d*(d*s+3*c*a)+3*p*o)+g*l;h[0]=Math.min(h[0],y),h[1]=Math.min(h[1],b),h[2]=Math.max(h[2],y),h[3]=Math.max(h[3],b)},i0=function(e,t,r,n,s,a,o,l,c,h,d,p){if(Math.abs(c)<1e-12){Math.abs(h)>=1e-12&&L(this,ua,pp).call(this,e,t,r,n,s,a,o,l,-d/h,p);return}const g=h**2-4*d*c;if(g<0)return;const y=Math.sqrt(g),b=2*c;L(this,ua,pp).call(this,e,t,r,n,s,a,o,l,(-h+y)/b,p),L(this,ua,pp).call(this,e,t,r,n,s,a,o,l,(-h-y)/b,p)},N(Qe,ua);function R_(i){return decodeURIComponent(escape(i))}let pm=null,Yv=null;function n1(i){return pm||(pm=/([\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,Yv=new Map([["ſt","ſt"]])),i.replaceAll(pm,(e,t,r)=>t?t.normalize("NFKC"):Yv.get(r))}function Ib(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const i=new Uint8Array(32);return crypto.getRandomValues(i),r1(i)}const Nb="pdfjs_internal_id_";function I_(i,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[r,n,...s]=t;if(!i(r)&&!Number.isInteger(r)||!e(n))return!1;const a=s.length;let o=!0;switch(n.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of s)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function dn(i,e,t){return Math.min(Math.max(i,e),t)}function i1(i){return Uint8Array.prototype.toBase64?i.toBase64():btoa(r1(i))}function N_(i){return Uint8Array.fromBase64?Uint8Array.fromBase64(i):Sf(atob(i))}typeof Promise.try!="function"&&(Promise.try=function(i,...e){return new Promise(t=>{t(i(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(i){return i.reduce((e,t)=>e+t,0)});const Ts="http://www.w3.org/2000/svg",ko=class ko{};Ie(ko,"CSS",96),Ie(ko,"PDF",72),Ie(ko,"PDF_TO_CSS_UNITS",ko.CSS/ko.PDF);let da=ko;async function Nc(i,e="text"){if(ah(i,document.baseURI)){const t=await fetch(i);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,r)=>{const n=new XMLHttpRequest;n.open("GET",i,!0),n.responseType=e,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(n.status===200||n.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(n.response);return}t(n.responseText);return}r(new Error(n.statusText))}},n.send(null)})}class Tf{constructor({viewBox:e,userUnit:t,scale:r,rotation:n,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=r,this.rotation=n,this.offsetX=s,this.offsetY=a,r*=t;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let h,d,p,g;switch(n%=360,n<0&&(n+=360),n){case 180:h=-1,d=0,p=0,g=1;break;case 90:h=0,d=1,p=1,g=0;break;case 270:h=0,d=-1,p=-1,g=0;break;case 0:h=1,d=0,p=0,g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(p=-p,g=-g);let y,b,w,v;h===0?(y=Math.abs(c-e[1])*r+s,b=Math.abs(l-e[0])*r+a,w=(e[3]-e[1])*r,v=(e[2]-e[0])*r):(y=Math.abs(l-e[0])*r+s,b=Math.abs(c-e[1])*r+a,w=(e[2]-e[0])*r,v=(e[3]-e[1])*r),this.transform=[h*r,d*r,p*r,g*r,y-h*r*l-p*r*c,b-d*r*l-g*r*c],this.width=w,this.height=v}get rawDims(){const e=this.viewBox;return Ct(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new Tf({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:s})}convertToViewportPoint(e,t){const r=[e,t];return Qe.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const t=[e[0],e[1]];Qe.applyTransform(t,this.transform);const r=[e[2],e[3]];return Qe.applyTransform(r,this.transform),[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){const r=[e,t];return Qe.applyInverseTransform(r,this.transform),r}}class Tg extends Wl{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function kf(i){const e=i.length;let t=0;for(;t<e&&i[t].trim()==="";)t++;return i.substring(t,t+5).toLowerCase()==="data:"}function kg(i){return typeof i=="string"&&/\.pdf$/i.test(i)}function s1(i){return[i]=i.split(/[#?]/,1),i.substring(i.lastIndexOf("/")+1)}function a1(i,e="document.pdf"){if(typeof i!="string")return e;if(kf(i))return ut('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const r=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(i);if(!r)return e;const n=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},s=/\.pdf$/i,a=r.pathname.split("/").at(-1);if(s.test(a))return n(a);if(r.searchParams.size>0){const o=Array.from(r.searchParams.values()).reverse();for(const c of o)if(s.test(c))return n(c);const l=Array.from(r.searchParams.keys()).reverse();for(const c of l)if(s.test(c))return n(c)}if(r.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(l)return n(l[0])}return e}class Zv{constructor(){Ie(this,"started",Object.create(null));Ie(this,"times",[])}time(e){e in this.started&&ut(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||ut(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:r}of this.times)t=Math.max(r.length,t);for(const{name:r,start:n,end:s}of this.times)e.push(`${r.padEnd(t)} ${s-n}ms
30
+ <%s key={someKey} {...props} />`,eu,_s,Kg,_s),Un[_s+eu]=!0}}return Q===r?Zi(Ut):mn(Ut),Ut}}function Wr(Q,Re,He){return sn(Q,Re,He,!0)}function ui(Q,Re,He){return sn(Q,Re,He,!1)}var Uc=ui,Es=Wr;Wc.Fragment=r,Wc.jsx=Uc,Wc.jsxs=Es}()),Wc}process.env.NODE_ENV==="production"?t0.exports=RE():t0.exports=IE();var ve=t0.exports;const NE=()=>ve.jsx("div",{className:"bg-red-800 text-white p-2",children:"Hello world"});function ME(){for(var i=0,e,t,r="";i<arguments.length;)(e=arguments[i++])&&(t=F2(e))&&(r&&(r+=" "),r+=t);return r}function F2(i){if(typeof i=="string")return i;for(var e,t="",r=0;r<i.length;r++)i[r]&&(e=F2(i[r]))&&(t&&(t+=" "),t+=e);return t}var Db="-";function LE(i){var e=FE(i);function t(n){var s=n.split(Db);return s[0]===""&&s.length!==1&&s.shift(),B2(s,e)||OE(n)}function r(n){return i.conflictingClassGroups[n]||[]}return{getClassGroupId:t,getConflictingClassGroupIds:r}}function B2(i,e){var a;if(i.length===0)return e.classGroupId;var t=i[0],r=e.nextPart.get(t),n=r?B2(i.slice(1),r):void 0;if(n)return n;if(e.validators.length!==0){var s=i.join(Db);return(a=e.validators.find(function(o){var l=o.validator;return l(s)}))==null?void 0:a.classGroupId}}var Gv=/^\[(.+)\]$/;function OE(i){if(Gv.test(i)){var e=Gv.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function FE(i){var e=i.theme,t=i.prefix,r={nextPart:new Map,validators:[]},n=zE(Object.entries(i.classGroups),t);return n.forEach(function(s){var a=s[0],o=s[1];r0(o,r,a,e)}),r}function r0(i,e,t,r){i.forEach(function(n){if(typeof n=="string"){var s=n===""?e:qv(e,n);s.classGroupId=t;return}if(typeof n=="function"){if(BE(n)){r0(n(r),e,t,r);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(function(a){var o=a[0],l=a[1];r0(l,qv(e,o),t,r)})})}function qv(i,e){var t=i;return e.split(Db).forEach(function(r){t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function BE(i){return i.isThemeGetter}function zE(i,e){return e?i.map(function(t){var r=t[0],n=t[1],s=n.map(function(a){return typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(function(o){var l=o[0],c=o[1];return[e+l,c]})):a});return[r,s]}):i}function jE(i){if(i<1)return{get:function(){},set:function(){}};var e=0,t=new Map,r=new Map;function n(s,a){t.set(s,a),e++,e>i&&(e=0,r=t,t=new Map)}return{get:function(a){var o=t.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return n(a,o),o},set:function(a,o){t.has(a)?t.set(a,o):n(a,o)}}}var z2="!";function UE(i){var e=i.separator||":";return function(r){for(var n=0,s=[],a=0,o=0;o<r.length;o++){var l=r[o];n===0&&l===e[0]&&(e.length===1||r.slice(o,o+e.length)===e)&&(s.push(r.slice(a,o)),a=o+e.length),l==="["?n++:l==="]"&&n--}var c=s.length===0?r:r.substring(a),h=c.startsWith(z2),d=h?c.substring(1):c;return{modifiers:s,hasImportantModifier:h,baseClassName:d}}}function HE(i){if(i.length<=1)return i;var e=[],t=[];return i.forEach(function(r){var n=r[0]==="[";n?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function $E(i){return{cache:jE(i.cacheSize),splitModifiers:UE(i),...LE(i)}}var VE=/\s+/;function GE(i,e){var t=e.splitModifiers,r=e.getClassGroupId,n=e.getConflictingClassGroupIds,s=new Set;return i.trim().split(VE).map(function(a){var o=t(a),l=o.modifiers,c=o.hasImportantModifier,h=o.baseClassName,d=r(h);if(!d)return{isTailwindClass:!1,originalClassName:a};var p=HE(l).join(":"),g=c?p+z2:p;return{isTailwindClass:!0,modifierId:g,classGroupId:d,originalClassName:a}}).reverse().filter(function(a){if(!a.isTailwindClass)return!0;var o=a.modifierId,l=a.classGroupId,c=o+l;return s.has(c)?!1:(s.add(c),n(l).forEach(function(h){return s.add(o+h)}),!0)}).reverse().map(function(a){return a.originalClassName}).join(" ")}function qE(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];var r,n,s,a=o;function o(c){var h=e[0],d=e.slice(1),p=d.reduce(function(g,y){return y(g)},h());return r=$E(p),n=r.cache.get,s=r.cache.set,a=l,l(c)}function l(c){var h=n(c);if(h)return h;var d=GE(c,r);return s(c,d),d}return function(){return a(ME.apply(null,arguments))}}function sr(i){var e=function(r){return r[i]||[]};return e.isThemeGetter=!0,e}var j2=/^\[(?:([a-z-]+):)?(.+)\]$/i,WE=/^\d+\/\d+$/,XE=new Set(["px","full","screen"]),YE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh)/,KE=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Di(i){return Sh(i)||XE.has(i)||WE.test(i)||_o(i)}function _o(i){return Gl(i,"length",r_)}function QE(i){return Gl(i,"size",U2)}function JE(i){return Gl(i,"position",U2)}function e_(i){return Gl(i,"url",n_)}function cm(i){return Gl(i,"number",Sh)}function Sh(i){return!Number.isNaN(Number(i))}function Xc(i){return Wv(i)||Gl(i,"number",Wv)}function Sr(i){return j2.test(i)}function Yc(){return!0}function ma(i){return YE.test(i)}function t_(i){return Gl(i,"",i_)}function Gl(i,e,t){var r=j2.exec(i);return r?r[1]?r[1]===e:t(r[2]):!1}function r_(i){return ZE.test(i)}function U2(){return!1}function n_(i){return i.startsWith("url(")}function Wv(i){return Number.isInteger(Number(i))}function i_(i){return KE.test(i)}function s_(){var i=sr("colors"),e=sr("spacing"),t=sr("blur"),r=sr("brightness"),n=sr("borderColor"),s=sr("borderRadius"),a=sr("borderSpacing"),o=sr("borderWidth"),l=sr("contrast"),c=sr("grayscale"),h=sr("hueRotate"),d=sr("invert"),p=sr("gap"),g=sr("gradientColorStops"),y=sr("inset"),b=sr("margin"),w=sr("opacity"),v=sr("padding"),A=sr("saturate"),E=sr("scale"),_=sr("sepia"),C=sr("skew"),I=sr("space"),k=sr("translate"),D=function(){return["auto","contain","none"]},R=function(){return["auto","hidden","clip","visible","scroll"]},z=function(){return["auto",e]},G=function(){return["",Di]},O=function(){return["auto",Sh,Sr]},X=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},S=function(){return["solid","dashed","dotted","double","none"]},J=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},Y=function(){return["start","end","center","between","around","evenly"]},W=function(){return["","0",Sr]},fe=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},K=function(){return[Sh,cm]},be=function(){return[Sh,Sr]};return{cacheSize:500,theme:{colors:[Yc],spacing:[Di],blur:["none","",ma,_o],brightness:K(),borderColor:[i],borderRadius:["none","","full",ma,_o],borderSpacing:[e],borderWidth:G(),contrast:K(),grayscale:W(),hueRotate:be(),invert:W(),gap:[e],gradientColorStops:[i],inset:z(),margin:z(),opacity:K(),padding:[e],saturate:K(),scale:K(),sepia:W(),skew:be(),space:[e],translate:[e]},classGroups:{aspect:[{aspect:["auto","square","video",Sr]}],container:["container"],columns:[{columns:[ma]}],"break-after":[{"break-after":fe()}],"break-before":[{"break-before":fe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(X(),[Sr])}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xc]}],basis:[{basis:[e]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Sr]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Xc]}],"grid-cols":[{"grid-cols":[Yc]}],"col-start-end":[{col:["auto",{span:[Xc]},Sr]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Yc]}],"row-start-end":[{row:["auto",{span:[Xc]},Sr]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Sr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Sr]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:Y()}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:[].concat(Y(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Y(),["baseline","stretch"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",e]}],"min-w":[{"min-w":["min","max","fit",Di]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ma]},ma,_o]}],h:[{h:[e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Di]}],"max-h":[{"max-h":[e,"min","max","fit"]}],"font-size":[{text:["base",ma,_o]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cm]}],"font-family":[{font:[Yc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",_o]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Di]}],"list-style-type":[{list:["none","disc","decimal",Sr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(S(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",Di]}],"underline-offset":[{"underline-offset":["auto",Di]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:[e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_o]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap"]}],break:[{break:["normal","words","all","keep"]}],content:[{content:["none",Sr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(X(),[JE])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",QE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},e_]}],"bg-color":[{bg:[i]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[].concat(S(),["hidden"])}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:S()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(S())}],"outline-offset":[{"outline-offset":[Di]}],"outline-w":[{outline:[Di]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Di]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",ma,t_]}],"shadow-color":[{shadow:[Yc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":J()}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ma,Sr]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[A]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Sr]}],duration:[{duration:be()}],ease:[{ease:["linear","in","out","in-out",Sr]}],delay:[{delay:be()}],animate:[{animate:["none","spin","ping","pulse","bounce",Sr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Xc,Sr]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Sr]}],accent:[{accent:["auto",i]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Sr]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":[e]}],"scroll-mx":[{"scroll-mx":[e]}],"scroll-my":[{"scroll-my":[e]}],"scroll-mt":[{"scroll-mt":[e]}],"scroll-mr":[{"scroll-mr":[e]}],"scroll-mb":[{"scroll-mb":[e]}],"scroll-ml":[{"scroll-ml":[e]}],"scroll-p":[{"scroll-p":[e]}],"scroll-px":[{"scroll-px":[e]}],"scroll-py":[{"scroll-py":[e]}],"scroll-pt":[{"scroll-pt":[e]}],"scroll-pr":[{"scroll-pr":[e]}],"scroll-pb":[{"scroll-pb":[e]}],"scroll-pl":[{"scroll-pl":[e]}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Sr]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[Di,cm]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]}}}var a_=qE(s_);function H2(i){var e,t,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i))for(e=0;e<i.length;e++)i[e]&&(t=H2(i[e]))&&(r&&(r+=" "),r+=t);else for(e in i)i[e]&&(r&&(r+=" "),r+=e);return r}function o_(){for(var i,e,t=0,r="";t<arguments.length;)(i=arguments[t++])&&(e=H2(i))&&(r&&(r+=" "),r+=e);return r}function so(...i){return a_(o_(i))}function l_({className:i="",size:e="1em"}){return ve.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:[ve.jsx("path",{d:"M12.001 7.7395C12.2367 7.73978 12.4591 7.85076 12.6006 8.03931L15.376 11.7395C15.5459 11.9666 15.5731 12.2708 15.4463 12.5247C15.3193 12.7785 15.0592 12.9395 14.7754 12.9397H12.75V17.2766C12.7499 17.6907 12.4142 18.0266 12 18.0266C11.5858 18.0266 11.2501 17.6907 11.25 17.2766V12.9397H9.22559C8.94169 12.9397 8.68182 12.7785 8.55469 12.5247C8.42778 12.2706 8.45558 11.9667 8.62598 11.7395L11.4004 8.03931L11.457 7.97192C11.5977 7.82422 11.7945 7.7395 12.001 7.7395Z",fill:"currentColor"}),ve.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.65161C17.5228 2.65161 22 7.12876 22 12.6516C22 18.1744 17.5228 22.6516 12 22.6516C6.47715 22.6516 2 18.1744 2 12.6516C2 7.12876 6.47715 2.65161 12 2.65161ZM12 4.15161C7.30558 4.15161 3.5 7.95719 3.5 12.6516C3.5 17.346 7.30558 21.1516 12 21.1516C16.6944 21.1516 20.5 17.346 20.5 12.6516C20.5 7.95719 16.6944 4.15161 12 4.15161Z",fill:"currentColor"})]})}function u_({className:i="",size:e="1em"}){return ve.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:ve.jsx("path",{d:"M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17316C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8078C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C21.9971 9.34871 20.9426 6.80684 19.0679 4.9321C17.1932 3.05736 14.6513 2.00287 12 2ZM15.7092 11.7642C15.6751 11.8349 15.6217 11.8945 15.5553 11.9363C15.4888 11.978 15.4118 12.0001 15.3333 12H12.8333V16.1667C12.8333 16.3877 12.7455 16.5996 12.5893 16.7559C12.433 16.9122 12.221 17 12 17C11.779 17 11.567 16.9122 11.4107 16.7559C11.2545 16.5996 11.1667 16.3877 11.1667 16.1667V12H8.66667C8.58819 12 8.5113 11.9779 8.44484 11.9362C8.37839 11.8945 8.32507 11.8348 8.29102 11.7641C8.25697 11.6934 8.24359 11.6145 8.2524 11.5365C8.26121 11.4586 8.29187 11.3847 8.34084 11.3233L11.6742 7.15667C11.7146 7.10991 11.7646 7.07241 11.8209 7.04671C11.8771 7.021 11.9382 7.0077 12 7.0077C12.0618 7.0077 12.1229 7.021 12.1791 7.04671C12.2354 7.07241 12.2854 7.10991 12.3258 7.15667L15.6592 11.3233C15.7082 11.3846 15.7389 11.4585 15.7477 11.5365C15.7566 11.6145 15.7432 11.6934 15.7092 11.7642Z",fill:"#1DA56A"})})}const c_=({tooltipContent:i="Send message",className:e,...t})=>{const[r,n]=Pe.useState(!1);return ve.jsx(Mt.Tooltip,{content:i,children:ve.jsx(Mt.IconButton,{variant:"text",color:"gray",className:so(e,"hover:rounded-lg hover:bg-gray-100"),type:"submit",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),...t,children:r?ve.jsx(u_,{className:"size-6 "}):ve.jsx(l_,{className:"size-6 "})})})},$2=({onSubmit:i=()=>{},...e})=>ve.jsx(kE,{autoFocus:!0,placeholder:"Write your message here",className:"pl-1 block w-full focus:outline-none max-h-32 resize-none placeholder:text-gray-400",onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),i())},...e}),h_=({bottom:i,right:e,top:t,textArea:r=ve.jsx($2,{}),...n})=>ve.jsxs("div",{className:"border gap-2 rounded-lg bg-white shadow-[0px_2px_2px_0px_#0000000A,0px_8px_8px_-8px_#0000000A] border-gray-100",...n,children:[t,ve.jsxs("div",{className:"flex gap-2 p-4 rounded-lg bg-white",children:[ve.jsxs("div",{className:"grow flex flex-col items-start justify-center",children:[r,i]}),ve.jsx("div",{className:"shrink flex items-end justify-end",children:e})]})]}),d_=Object.freeze(Object.defineProperty({__proto__:null,Container:h_,SubmitButton:c_,Textarea:$2},Symbol.toStringTag,{value:"Module"})),ql=Pe.createContext(void 0),V2=({children:i,isCollapsed:e,onSwitchLayout:t})=>{const[r,n]=Pe.useState(!1),[s,a]=Pe.useState(!1),o=e!==void 0?e:r,l=c=>{const h=c??!o;e===void 0&&n(h),t==null||t(h)};return ve.jsx(ql.Provider,{value:{isCollapsed:o,toggleCollapsed:l,isHovered:s,setIsHovered:a},children:i})},G2=({className:i,children:e,...t})=>{const{isCollapsed:r,isHovered:n,setIsHovered:s}=Pe.useContext(ql);return ve.jsx("div",{className:so(i,r&&"shadow-lg rounded-lg",r&&!n?"w-auto":"w-[280px]","bg-gray-50 p-2 flex flex-col justify-between items-center rounded-tr-lg rounded-br-lg"),onMouseEnter:()=>r&&s(!0),onMouseLeave:()=>r&&s(!1),...t,children:e})},q2=({className:i,children:e,...t})=>{const{isCollapsed:r,setIsHovered:n}=Pe.useContext(ql);return ve.jsx("div",{className:so(i,r&&"!hidden","p-2 flex flex-col gap-2 items-center rounded-tl-lg rounded-bl-lg w-16"),onMouseEnter:()=>r&&n(!0),onMouseLeave:()=>r&&n(!1),...t,children:e})},f_=({className:i,children:e,isCollapsed:t,sideContainer:r,sideClassName:n,onSwitchLayout:s,...a})=>ve.jsxs(V2,{isCollapsed:t,onSwitchLayout:s,children:[r&&ve.jsx(q2,{className:n,children:r}),ve.jsx(G2,{className:i,...a,children:e})]}),p_=({icon:i,children:e,...t})=>{const{isCollapsed:r,isHovered:n}=Pe.useContext(ql);return ve.jsxs("button",{className:"flex items-center gap-2 w-full hover:bg-gray-100 text-caption-1-em text-gray-600 hover:text-gray-900 h-[38px] rounded-lg px-2",...t,children:[i," ",(!r||n)&&e]})};function g_(i){return ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M13 1C14.6569 1 16 2.34315 16 4V12L15.9961 12.1543C15.9158 13.7394 14.6051 15 13 15H3L2.8457 14.9961C1.31166 14.9184 0.0816253 13.6883 0.00390625 12.1543L0 12V4C1.28853e-07 2.34315 1.34315 1 3 1H13ZM3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3ZM3.75 3.5C4.16421 3.5 4.5 3.83579 4.5 4.25V11.75C4.5 12.1642 4.16421 12.5 3.75 12.5C3.33579 12.5 3 12.1642 3 11.75V4.25C3 3.83579 3.33579 3.5 3.75 3.5Z",fill:"currentColor"})})}function m_(i){return ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M13 1C14.6569 1 16 2.34315 16 4V12L15.9961 12.1543C15.9158 13.7394 14.6051 15 13 15H3L2.8457 14.9961C1.31166 14.9184 0.0816253 13.6883 0.00390625 12.1543L0 12V4C1.28853e-07 2.34315 1.34315 1 3 1H13ZM3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3ZM7.5 4C7.77614 4 8 4.22386 8 4.5V11.5C8 11.7761 7.77614 12 7.5 12H3.5C3.22386 12 3 11.7761 3 11.5V4.5C3 4.22386 3.22386 4 3.5 4H7.5Z",fill:"currentColor"})})}const b_=()=>{const{isCollapsed:i,isHovered:e,toggleCollapsed:t}=Pe.useContext(ql);return i&&!e?null:ve.jsx(Mt.IconButton,{variant:"text",color:"gray",onClick:()=>t(),children:i?ve.jsx(g_,{className:"size-4"}):ve.jsx(m_,{className:"size-4"})})},v_=({children:i,className:e,icon:t,isActive:r,trailing:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(ql);return ve.jsxs("div",{className:so(r?"!text-gray-900":"!text-gray-600","flex items-center justify-between w-full hover:bg-gray-100 text-caption-1-em hover:text-gray-900 h-[38px] rounded-lg px-2 cursor-pointer group",e),...s,children:[ve.jsxs("div",{className:"flex items-center gap-2",children:[t,(!a||o)&&i]}),(!a||o)&&n]})},y_=({children:i,className:e,isActive:t,trailing:r,icon:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(ql);return ve.jsxs("div",{className:so(t?"!text-gray-900":"!text-gray-600","flex items-center justify-between w-full hover:bg-gray-100 text-caption-1-em hover:text-gray-900 h-[38px] rounded-lg pr-2 pl-3 cursor-pointer group text-sm",e),...s,children:[ve.jsxs("div",{className:"flex items-center gap-2 overflow-auto",children:[(!a||o)&&n," ",(!a||o)&&i]}),(!a||o)&&r]})},w_=Object.freeze(Object.defineProperty({__proto__:null,Button:p_,Container:G2,Item:v_,Layout:f_,Provider:V2,SecondaryItem:y_,SideContainer:q2,ToggleCollapseButton:b_},Symbol.toStringTag,{value:"Module"})),x_=i=>ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M12.7197 2.21954C13.0125 1.92683 13.4874 1.92694 13.7803 2.21954C14.073 2.51241 14.073 2.98722 13.7803 3.28008L9.05955 7.99981L13.7803 12.7205L13.832 12.7772C14.0721 13.0717 14.0548 13.5065 13.7803 13.7811C13.5057 14.0555 13.0709 14.0729 12.7764 13.8328L12.7197 13.7811L7.99901 9.06036L3.27928 13.7811C2.9864 14.0737 2.51156 14.0738 2.21873 13.7811C1.92618 13.4882 1.92616 13.0133 2.21873 12.7205L6.93846 7.99981L2.21873 3.28008C1.92615 2.98722 1.92607 2.51235 2.21873 2.21954C2.51154 1.92673 2.98637 1.92691 3.27928 2.21954L7.99901 6.93926L12.7197 2.21954Z",fill:"currentColor"})}),A_=({onClose:i,right:e,children:t})=>ve.jsxs("div",{className:"bg-gray-50 flex gap-2 items-center px-2 py-3 rounded-t-xl",children:[ve.jsx("div",{className:"grow text-subheader-em",children:t}),ve.jsxs("div",{className:"flex items-center gap-4",children:[e,ve.jsx(Mt.IconButton,{variant:"text",size:"sm",color:"gray",className:"rounded-full",onClick:i,children:ve.jsx(x_,{className:"size-4 text-gray-600"})})]})]}),W2={Header:A_},X2=i=>ve.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ve.jsx("path",{d:"M2.25 5.5C2.66421 5.5 3 5.83579 3 6.25C3 6.66421 2.66421 7 2.25 7H2C1.72386 7 1.5 7.22386 1.5 7.5V13.5C1.5 13.7761 1.72386 14 2 14H8C8.27614 14 8.5 13.7761 8.5 13.5V13.25C8.5 12.8358 8.83579 12.5 9.25 12.5C9.66421 12.5 10 12.8358 10 13.25V13.5C10 14.5357 9.21278 15.387 8.2041 15.4893L8 15.5H2L1.7959 15.4893C0.854346 15.3938 0.1062 14.6457 0.0107422 13.7041L0 13.5V7.5C0 6.39543 0.895431 5.5 2 5.5H2.25ZM13.75 0C14.7165 1.28853e-07 15.5 0.783502 15.5 1.75V9.75C15.5 10.7165 14.7165 11.5 13.75 11.5H5.75C4.7835 11.5 4 10.7165 4 9.75V1.75C4 0.783502 4.7835 8.0532e-09 5.75 0H13.75ZM5.75 1.5C5.61193 1.5 5.5 1.61193 5.5 1.75V9.75C5.5 9.88807 5.61193 10 5.75 10H13.75C13.8881 10 14 9.88807 14 9.75V1.75C14 1.61193 13.8881 1.5 13.75 1.5H5.75ZM11.75 3C11.795 3 11.839 3.00413 11.8818 3.01172C11.8874 3.0127 11.8929 3.01354 11.8984 3.01465C11.9118 3.01733 11.9244 3.02298 11.9375 3.02637C11.9707 3.03495 12.0041 3.04344 12.0361 3.05664C12.0653 3.06868 12.092 3.08512 12.1191 3.10059C12.1763 3.1331 12.2316 3.171 12.2803 3.21973C12.3287 3.26812 12.366 3.3232 12.3984 3.37988C12.414 3.40703 12.4303 3.43375 12.4424 3.46289C12.4631 3.51289 12.4779 3.56459 12.4873 3.61719C12.495 3.66035 12.5 3.70462 12.5 3.75V7.75C12.5 8.16421 12.1642 8.5 11.75 8.5C11.3358 8.5 11 8.16421 11 7.75V5.56055L8.28027 8.28027C7.98738 8.57317 7.51262 8.57317 7.21973 8.28027C6.92683 7.98738 6.92683 7.51262 7.21973 7.21973L9.93945 4.5H7.75C7.33579 4.5 7 4.16421 7 3.75C7 3.33579 7.33579 3 7.75 3H11.75Z",fill:"currentColor"})}),Y2=(i=100,e=50,t=990,r=10)=>{const[n,s]=Pe.useState(i);return[n,{...{zoomIn:()=>s(l=>Math.min(l+r,t)),zoomOut:()=>s(l=>Math.max(l-r,e)),reset:()=>s(i),zoomToValue:l=>s(Math.max(e,Math.min(l,t)))},handleWheel:l=>{l.preventDefault();const c=l.deltaY>0?-r:r;s(h=>Math.max(e,Math.min(h+c,t)))}}]},Z2=()=>{const[i,e]=Pe.useState(0);return[i,{rotateClockwise:()=>e(r=>(r+90)%360),rotateCounterClockwise:()=>e(r=>(r-90+360)%360)}]},K2=()=>{const[i,e]=Pe.useState({x:0,y:0}),[t,r]=Pe.useState(!1),[n,s]=Pe.useState({x:0,y:0});return[{pan:i,isDragging:t},{handleMouseDown:h=>{r(!0),s({x:h.clientX-i.x,y:h.clientY-i.y})},handleMouseMove:h=>{t&&e({x:h.clientX-n.x,y:h.clientY-n.y})},handleMouseUp:()=>{r(!1)},reset:()=>e({x:0,y:0})}]},Q2=(i=0)=>{const[e,t]=Pe.useState(1),[r,n]=Pe.useState(i),s={nextPage:Pe.useCallback(()=>{t(a=>a<r?a+1:a)},[r]),prevPage:Pe.useCallback(()=>{t(a=>Math.max(a-1,1))},[]),goToPage:Pe.useCallback(a=>{t(()=>Math.max(1,Math.min(a,r)))},[r]),setTotalPages:Pe.useCallback(a=>{n(a),t(o=>Math.min(o,a))},[])};return[{currentPage:e,totalPages:r},s]},E_=({className:i,onClose:e,totalPages:t,getImageSrc:r,documentUrl:n,title:s="PDF Viewer"})=>{const[a,o]=Y2(),[l,c]=Z2(),[{pan:h,isDragging:d},p]=K2(),[{currentPage:g},y]=Q2(t),[b,w]=Pe.useState(()=>{const A=r(g);return typeof A=="string"?A:""});Pe.useEffect(()=>{let A=!0;return(async()=>{const _=r(g),C=await Promise.resolve(_);A&&w(C)})(),()=>{A=!1}},[g,r]);const v=ve.jsx(Mt.IconButton,{variant:"text",color:"gray",children:ve.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:ve.jsx(X2,{className:"size-4"})})});return ve.jsxs("div",{className:so("shadow rounded-t-lg flex flex-col h-full",i),children:[ve.jsx(W2.Header,{onClose:e,right:v,children:s}),ve.jsx("div",{className:"flex flex-col h-full justify-between",children:ve.jsxs("div",{className:"grid relative h-full",children:[ve.jsx("div",{className:"overflow-hidden col-start-1 row-start-1 bg-gray-200 h-full relative",onMouseMove:p.handleMouseMove,onMouseUp:p.handleMouseUp,onMouseLeave:p.handleMouseUp,onWheel:o.handleWheel,children:ve.jsx("div",{style:{transform:`translate(${h.x}px, ${h.y}px)`,cursor:d?"grabbing":"grab",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:p.handleMouseDown,children:ve.jsx("div",{style:{transform:`scale(${a/100}) rotate(${l}deg)`,transformOrigin:"center",transition:d?"none":"transform 0.3s ease"},children:b?ve.jsx("img",{src:b,style:{userSelect:"none",pointerEvents:"none"}}):null})})}),ve.jsxs("div",{className:"col-start-1 row-start-1 self-end p-4 flex gap-2 justify-between w-full z-10",children:[ve.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomOut,children:ve.jsx(vi.Icon,{icon:"lucide:minus"})}),ve.jsx(Mt.Tooltip,{content:"Click to reset zoom and pan",children:ve.jsxs("button",{className:"!bg-white text-center cursor-pointer w-[60px]",onClick:()=>{o.reset(),p.reset()},children:[a,"%"]})}),ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomIn,children:ve.jsx(vi.Icon,{icon:"lucide:plus"})})]}),ve.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateClockwise,children:ve.jsx(vi.Icon,{icon:"lucide:iteration-cw"})}),ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateCounterClockwise,children:ve.jsx(vi.Icon,{icon:"lucide:iteration-ccw"})})]}),ve.jsxs(Mt.ButtonGroup,{className:"divide-x-0 ",children:[ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.prevPage,disabled:g===1,children:ve.jsx(vi.Icon,{icon:"lucide:chevron-left"})}),ve.jsx("input",{className:"bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]",value:g,onChange:A=>{const E=parseInt(A.target.value);isNaN(E)||y.goToPage(E)},type:"number",min:"1",max:t}),ve.jsxs("div",{className:"flex items-center bg-white px-2",children:["of ",t]}),ve.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.nextPage,disabled:g===t,children:ve.jsx(vi.Icon,{icon:"lucide:chevron-right"})})]})]})]})})]})},_n=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),n0=[.001,0,0,.001,0,0],hm=1.35,ii={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},vs={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},J2="pdfjs_internal_editor_",ot={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},kt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},e1={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},on={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Th={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},wr={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},su={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Cf={ERRORS:0,WARNINGS:1,INFOS:5},Ph={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},ep={moveTo:0,lineTo:1,curveTo:2,closePath:3},t1={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Cg=Cf.WARNINGS;function __(i){Number.isInteger(i)&&(Cg=i)}function C_(){return Cg}function Sg(i){Cg>=Cf.INFOS&&console.log(`Info: ${i}`)}function ut(i){Cg>=Cf.WARNINGS&&console.log(`Warning: ${i}`)}function Wt(i){throw new Error(i)}function Dr(i,e){i||Wt(e)}function S_(i){switch(i==null?void 0:i.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Pb(i,e=null,t=null){if(!i)return null;if(t&&typeof i=="string"){if(t.addDefaultProtocol&&i.startsWith("www.")){const n=i.match(/\./g);(n==null?void 0:n.length)>=2&&(i=`http://${i}`)}if(t.tryConvertEncoding)try{i=R_(i)}catch{}}const r=e?URL.parse(i,e):URL.parse(i);return S_(r)?r:null}function Rb(i,e,t=!1){const r=URL.parse(i);return r?(r.hash=e,r.href):t&&Pb(i,"http://example.com")?i.split("#",1)[0]+`${e?`#${e}`:""}`:""}function Ct(i,e,t,r=!1){return Object.defineProperty(i,e,{value:t,enumerable:!r,configurable:!0,writable:!1}),t}const Wl=function(){function e(t,r){this.message=t,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class Xv extends Wl{constructor(e,t){super(e,"PasswordException"),this.code=t}}class dm extends Wl{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class Wp extends Wl{constructor(e){super(e,"InvalidPDFException")}}class Rh extends Wl{constructor(e,t,r){super(e,"ResponseException"),this.status=t,this.missing=r}}class T_ extends Wl{constructor(e){super(e,"FormatError")}}class ha extends Wl{constructor(e){super(e,"AbortException")}}function r1(i){(typeof i!="object"||(i==null?void 0:i.length)===void 0)&&Wt("Invalid argument for bytesToString");const e=i.length,t=8192;if(e<t)return String.fromCharCode.apply(null,i);const r=[];for(let n=0;n<e;n+=t){const s=Math.min(n+t,e),a=i.subarray(n,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function Sf(i){typeof i!="string"&&Wt("Invalid argument for stringToBytes");const e=i.length,t=new Uint8Array(e);for(let r=0;r<e;++r)t[r]=i.charCodeAt(r)&255;return t}function k_(i){return String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255)}function D_(){const i=new Uint8Array(4);return i[0]=1,new Uint32Array(i.buffer,0,1)[0]===1}function P_(){try{return new Function(""),!0}catch{return!1}}class qr{static get isLittleEndian(){return Ct(this,"isLittleEndian",D_())}static get isEvalSupported(){return Ct(this,"isEvalSupported",P_())}static get isOffscreenCanvasSupported(){return Ct(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Ct(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return Ct(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){var e,t;return Ct(this,"isCSSRoundSupported",(t=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:t.call(e,"width: round(1.5px, 1px)"))}}const fm=Array.from(Array(256).keys(),i=>i.toString(16).padStart(2,"0"));var ua,pp,i0;class Qe{static makeHexColor(e,t,r){return`#${fm[e]}${fm[t]}${fm[r]}`}static scaleMinMax(e,t){let r;e[0]?(e[0]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[3],t[3]*=e[3]):(r=t[0],t[0]=t[1],t[1]=r,r=t[2],t[2]=t[3],t[3]=r,e[1]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t,r=0){const n=e[r],s=e[r+1];e[r]=n*t[0]+s*t[2]+t[4],e[r+1]=n*t[1]+s*t[3]+t[5]}static applyTransformToBezier(e,t,r=0){const n=t[0],s=t[1],a=t[2],o=t[3],l=t[4],c=t[5];for(let h=0;h<6;h+=2){const d=e[r+h],p=e[r+h+1];e[r+h]=d*n+p*a+l,e[r+h+1]=d*s+p*o+c}}static applyInverseTransform(e,t){const r=e[0],n=e[1],s=t[0]*t[3]-t[1]*t[2];e[0]=(r*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/s,e[1]=(-r*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/s}static axialAlignedBoundingBox(e,t,r){const n=t[0],s=t[1],a=t[2],o=t[3],l=t[4],c=t[5],h=e[0],d=e[1],p=e[2],g=e[3];let y=n*h+l,b=y,w=n*p+l,v=w,A=o*d+c,E=A,_=o*g+c,C=_;if(s!==0||a!==0){const I=s*h,k=s*p,D=a*d,R=a*g;y+=D,v+=D,w+=R,b+=R,A+=I,C+=I,_+=k,E+=k}r[0]=Math.min(r[0],y,w,b,v),r[1]=Math.min(r[1],A,_,E,C),r[2]=Math.max(r[2],y,w,b,v),r[3]=Math.max(r[3],A,_,E,C)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const r=e[0],n=e[1],s=e[2],a=e[3],o=r**2+n**2,l=r*s+n*a,c=s**2+a**2,h=(o+c)/2,d=Math.sqrt(h**2-(o*c-l**2));t[0]=Math.sqrt(h+d||1),t[1]=Math.sqrt(h-d||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>n)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>a?null:[r,s,n,a]}static pointBoundingBox(e,t,r){r[0]=Math.min(r[0],e),r[1]=Math.min(r[1],t),r[2]=Math.max(r[2],e),r[3]=Math.max(r[3],t)}static rectBoundingBox(e,t,r,n,s){s[0]=Math.min(s[0],e,r),s[1]=Math.min(s[1],t,n),s[2]=Math.max(s[2],e,r),s[3]=Math.max(s[3],t,n)}static bezierBoundingBox(e,t,r,n,s,a,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,l),L(this,ua,i0).call(this,e,r,s,o,t,n,a,l,3*(-e+3*(r-s)+o),6*(e-2*r+s),3*(r-e),c),L(this,ua,i0).call(this,e,r,s,o,t,n,a,l,3*(-t+3*(n-a)+l),6*(t-2*n+a),3*(n-t),c)}}ua=new WeakSet,pp=function(e,t,r,n,s,a,o,l,c,h){if(c<=0||c>=1)return;const d=1-c,p=c*c,g=p*c,y=d*(d*(d*e+3*c*t)+3*p*r)+g*n,b=d*(d*(d*s+3*c*a)+3*p*o)+g*l;h[0]=Math.min(h[0],y),h[1]=Math.min(h[1],b),h[2]=Math.max(h[2],y),h[3]=Math.max(h[3],b)},i0=function(e,t,r,n,s,a,o,l,c,h,d,p){if(Math.abs(c)<1e-12){Math.abs(h)>=1e-12&&L(this,ua,pp).call(this,e,t,r,n,s,a,o,l,-d/h,p);return}const g=h**2-4*d*c;if(g<0)return;const y=Math.sqrt(g),b=2*c;L(this,ua,pp).call(this,e,t,r,n,s,a,o,l,(-h+y)/b,p),L(this,ua,pp).call(this,e,t,r,n,s,a,o,l,(-h-y)/b,p)},N(Qe,ua);function R_(i){return decodeURIComponent(escape(i))}let pm=null,Yv=null;function n1(i){return pm||(pm=/([\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,Yv=new Map([["ſt","ſt"]])),i.replaceAll(pm,(e,t,r)=>t?t.normalize("NFKC"):Yv.get(r))}function Ib(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const i=new Uint8Array(32);return crypto.getRandomValues(i),r1(i)}const Nb="pdfjs_internal_id_";function I_(i,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[r,n,...s]=t;if(!i(r)&&!Number.isInteger(r)||!e(n))return!1;const a=s.length;let o=!0;switch(n.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of s)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function dn(i,e,t){return Math.min(Math.max(i,e),t)}function i1(i){return Uint8Array.prototype.toBase64?i.toBase64():btoa(r1(i))}function N_(i){return Uint8Array.fromBase64?Uint8Array.fromBase64(i):Sf(atob(i))}typeof Promise.try!="function"&&(Promise.try=function(i,...e){return new Promise(t=>{t(i(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(i){return i.reduce((e,t)=>e+t,0)});const Ts="http://www.w3.org/2000/svg",ko=class ko{};Ie(ko,"CSS",96),Ie(ko,"PDF",72),Ie(ko,"PDF_TO_CSS_UNITS",ko.CSS/ko.PDF);let da=ko;async function Nc(i,e="text"){if(ah(i,document.baseURI)){const t=await fetch(i);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,r)=>{const n=new XMLHttpRequest;n.open("GET",i,!0),n.responseType=e,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(n.status===200||n.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(n.response);return}t(n.responseText);return}r(new Error(n.statusText))}},n.send(null)})}class Tf{constructor({viewBox:e,userUnit:t,scale:r,rotation:n,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=r,this.rotation=n,this.offsetX=s,this.offsetY=a,r*=t;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let h,d,p,g;switch(n%=360,n<0&&(n+=360),n){case 180:h=-1,d=0,p=0,g=1;break;case 90:h=0,d=1,p=1,g=0;break;case 270:h=0,d=-1,p=-1,g=0;break;case 0:h=1,d=0,p=0,g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(p=-p,g=-g);let y,b,w,v;h===0?(y=Math.abs(c-e[1])*r+s,b=Math.abs(l-e[0])*r+a,w=(e[3]-e[1])*r,v=(e[2]-e[0])*r):(y=Math.abs(l-e[0])*r+s,b=Math.abs(c-e[1])*r+a,w=(e[2]-e[0])*r,v=(e[3]-e[1])*r),this.transform=[h*r,d*r,p*r,g*r,y-h*r*l-p*r*c,b-d*r*l-g*r*c],this.width=w,this.height=v}get rawDims(){const e=this.viewBox;return Ct(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new Tf({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:s})}convertToViewportPoint(e,t){const r=[e,t];return Qe.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const t=[e[0],e[1]];Qe.applyTransform(t,this.transform);const r=[e[2],e[3]];return Qe.applyTransform(r,this.transform),[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){const r=[e,t];return Qe.applyInverseTransform(r,this.transform),r}}class Tg extends Wl{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function kf(i){const e=i.length;let t=0;for(;t<e&&i[t].trim()==="";)t++;return i.substring(t,t+5).toLowerCase()==="data:"}function kg(i){return typeof i=="string"&&/\.pdf$/i.test(i)}function s1(i){return[i]=i.split(/[#?]/,1),i.substring(i.lastIndexOf("/")+1)}function a1(i,e="document.pdf"){if(typeof i!="string")return e;if(kf(i))return ut('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const r=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(i);if(!r)return e;const n=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},s=/\.pdf$/i,a=r.pathname.split("/").at(-1);if(s.test(a))return n(a);if(r.searchParams.size>0){const o=Array.from(r.searchParams.values()).reverse();for(const c of o)if(s.test(c))return n(c);const l=Array.from(r.searchParams.keys()).reverse();for(const c of l)if(s.test(c))return n(c)}if(r.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(l)return n(l[0])}return e}class Zv{constructor(){Ie(this,"started",Object.create(null));Ie(this,"times",[])}time(e){e in this.started&&ut(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||ut(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:r}of this.times)t=Math.max(r.length,t);for(const{name:r,start:n,end:s}of this.times)e.push(`${r.padEnd(t)} ${s-n}ms
31
31
  `);return e.join("")}}function ah(i,e){const t=e?URL.parse(i,e):URL.parse(i);return(t==null?void 0:t.protocol)==="http:"||(t==null?void 0:t.protocol)==="https:"}function Ei(i){i.preventDefault()}function _r(i){i.preventDefault(),i.stopPropagation()}function M_(i){console.log("Deprecated API usage: "+i)}var Zh;class Dg{static toDateObject(e){if(!e||typeof e!="string")return null;u(this,Zh)||T(this,Zh,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=u(this,Zh).exec(e);if(!t)return null;const r=parseInt(t[1],10);let n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let h=parseInt(t[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(a+=h,o+=d):c==="+"&&(a-=h,o-=d),new Date(Date.UTC(r,n,s,a,o,l))}}Zh=new WeakMap,N(Dg,Zh);function o1(i,{scale:e=1,rotation:t=0}){const{width:r,height:n}=i.attributes.style,s=[0,0,parseInt(r),parseInt(n)];return new Tf({viewBox:s,userUnit:1,scale:e,rotation:t})}function Mb(i){if(i.startsWith("#")){const e=parseInt(i.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return i.startsWith("rgb(")?i.slice(4,-1).split(",").map(e=>parseInt(e)):i.startsWith("rgba(")?i.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(ut(`Not a valid color format: "${i}"`),[0,0,0])}function L_(i){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of i.keys()){e.style.color=t;const r=window.getComputedStyle(e).color;i.set(t,Mb(r))}e.remove()}function hr(i){const{a:e,b:t,c:r,d:n,e:s,f:a}=i.getTransform();return[e,t,r,n,s,a]}function Ki(i){const{a:e,b:t,c:r,d:n,e:s,f:a}=i.getTransform().invertSelf();return[e,t,r,n,s,a]}function ao(i,e,t=!1,r=!0){if(e instanceof Tf){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:a}=i,o=qr.isCSSRoundSupported,l=`var(--total-scale-factor) * ${n}px`,c=`var(--total-scale-factor) * ${s}px`,h=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(a.width=h,a.height=d):(a.width=d,a.height=h)}r&&i.setAttribute("data-main-rotation",e.rotation)}class Wi{constructor(){const{pixelRatio:e}=Wi;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,r,n,s=-1){let a=1/0,o=1/0,l=1/0;r=Wi.capPixels(r,s),r>0&&(a=Math.sqrt(r/(e*t))),n!==-1&&(o=n/e,l=n/t);const c=Math.min(a,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,r):r}return e}}const Xp=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var xa,Ro,hi,Aa,Kh,xu,Qh,sg,l1,Sn,u1,c1,oh,gp;const Ps=class Ps{constructor(e){N(this,Sn);N(this,xa,null);N(this,Ro,null);N(this,hi);N(this,Aa,null);N(this,Kh,null);N(this,xu,null);T(this,hi,e),u(Ps,Qh)||T(Ps,Qh,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const e=T(this,xa,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=u(this,hi)._uiManager._signal;e.addEventListener("contextmenu",Ei,{signal:t}),e.addEventListener("pointerdown",L(Ps,sg,l1),{signal:t});const r=T(this,Aa,document.createElement("div"));r.className="buttons",e.append(r);const n=u(this,hi).toolbarPosition;if(n){const{style:s}=e,a=u(this,hi)._uiManager.direction==="ltr"?1-n[0]:n[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return u(this,xa)}hide(){var e;u(this,xa).classList.add("hidden"),(e=u(this,Ro))==null||e.hideDropdown()}show(){var e;u(this,xa).classList.remove("hidden"),(e=u(this,Kh))==null||e.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=u(this,hi),r=document.createElement("button");r.className="delete",r.tabIndex=0,r.setAttribute("data-l10n-id",u(Ps,Qh)[e]),L(this,Sn,oh).call(this,r),r.addEventListener("click",n=>{t.delete()},{signal:t._signal}),u(this,Aa).append(r)}async addAltText(e){const t=await e.render();L(this,Sn,oh).call(this,t),u(this,Aa).append(t,u(this,Sn,gp)),T(this,Kh,e)}addColorPicker(e){T(this,Ro,e);const t=e.renderButton();L(this,Sn,oh).call(this,t),u(this,Aa).append(t,u(this,Sn,gp))}async addEditSignatureButton(e){const t=T(this,xu,await e.renderEditButton(u(this,hi)));L(this,Sn,oh).call(this,t),u(this,Aa).append(t,u(this,Sn,gp))}async addButton(e,t){switch(e){case"colorPicker":this.addColorPicker(t);break;case"altText":await this.addAltText(t);break;case"editSignature":await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break}}updateEditSignatureButton(e){u(this,xu)&&(u(this,xu).title=e)}remove(){var e;u(this,xa).remove(),(e=u(this,Ro))==null||e.destroy(),T(this,Ro,null)}};xa=new WeakMap,Ro=new WeakMap,hi=new WeakMap,Aa=new WeakMap,Kh=new WeakMap,xu=new WeakMap,Qh=new WeakMap,sg=new WeakSet,l1=function(e){e.stopPropagation()},Sn=new WeakSet,u1=function(e){u(this,hi)._focusEventsAllowed=!1,_r(e)},c1=function(e){u(this,hi)._focusEventsAllowed=!0,_r(e)},oh=function(e){const t=u(this,hi)._uiManager._signal;e.addEventListener("focusin",L(this,Sn,u1).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",L(this,Sn,c1).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",Ei,{signal:t})},gp=function(){const e=document.createElement("div");return e.className="divider",e},N(Ps,sg),N(Ps,Qh,null);let s0=Ps;var Jh,Io,No,fo,h1,d1,f1;class O_{constructor(e){N(this,fo);N(this,Jh,null);N(this,Io,null);N(this,No);T(this,No,e)}show(e,t,r){const[n,s]=L(this,fo,d1).call(this,t,r),{style:a}=u(this,Io)||T(this,Io,L(this,fo,h1).call(this));e.append(u(this,Io)),a.insetInlineEnd=`${100*n}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){u(this,Io).remove()}}Jh=new WeakMap,Io=new WeakMap,No=new WeakMap,fo=new WeakSet,h1=function(){const e=T(this,Io,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Ei,{signal:u(this,No)._signal});const t=T(this,Jh,document.createElement("div"));return t.className="buttons",e.append(t),L(this,fo,f1).call(this),e},d1=function(e,t){let r=0,n=0;for(const s of e){const a=s.y+s.height;if(a<r)continue;const o=s.x+(t?s.width:0);if(a>r){n=o,r=a;continue}t?o>n&&(n=o):o<n&&(n=o)}return[t?1-n:n,r]},f1=function(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=u(this,No)._signal;e.addEventListener("contextmenu",Ei,{signal:r}),e.addEventListener("click",()=>{u(this,No).highlightSelection("floating_button")},{signal:r}),u(this,Jh).append(e)};function p1(i,e,t){for(const r of t)e.addEventListener(r,i[r].bind(i))}var ag;class F_{constructor(){N(this,ag,0)}get id(){return`${J2}${bn(this,ag)._++}`}}ag=new WeakMap;var Au,ed,un,Eu,mp;const mv=class mv{constructor(){N(this,Eu);N(this,Au,Ib());N(this,ed,0);N(this,un,null)}static get _isSVGFittingCanvas(){const e='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>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),n=new Image;n.src=e;const s=n.decode().then(()=>(r.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Ct(this,"_isSVGFittingCanvas",s)}async getFromFile(e){const{lastModified:t,name:r,size:n,type:s}=e;return L(this,Eu,mp).call(this,`${t}_${r}_${n}_${s}`,e)}async getFromUrl(e){return L(this,Eu,mp).call(this,e,e)}async getFromBlob(e,t){const r=await t;return L(this,Eu,mp).call(this,e,r)}async getFromId(e){u(this,un)||T(this,un,new Map);const t=u(this,un).get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:r}=t;return delete t.blobPromise,this.getFromBlob(t.id,r)}return this.getFromUrl(t.url)}getFromCanvas(e,t){u(this,un)||T(this,un,new Map);let r=u(this,un).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const n=new OffscreenCanvas(t.width,t.height);return n.getContext("2d").drawImage(t,0,0),r={bitmap:n.transferToImageBitmap(),id:`image_${u(this,Au)}_${bn(this,ed)._++}`,refCounter:1,isSvg:!1},u(this,un).set(e,r),u(this,un).set(r.id,r),r}getSvgUrl(e){const t=u(this,un).get(e);return t!=null&&t.isSvg?t.svgUrl:null}deleteId(e){var n;u(this,un)||T(this,un,new Map);const t=u(this,un).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:r}=t;if(!t.url&&!t.file){const s=new OffscreenCanvas(r.width,r.height);s.getContext("bitmaprenderer").transferFromImageBitmap(r),t.blobPromise=s.convertToBlob()}(n=r.close)==null||n.call(r),t.bitmap=null}isValidId(e){return e.startsWith(`image_${u(this,Au)}_`)}};Au=new WeakMap,ed=new WeakMap,un=new WeakMap,Eu=new WeakSet,mp=async function(e,t){u(this,un)||T(this,un,new Map);let r=u(this,un).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${u(this,Au)}_${bn(this,ed)._++}`,refCounter:0,isSvg:!1});let n;if(typeof t=="string"?(r.url=t,n=await Nc(t,"blob")):t instanceof File?n=r.file=t:t instanceof Blob&&(n=t),n.type==="image/svg+xml"){const s=mv._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,h)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,c()},a.onload=async()=>{const d=r.svgUrl=a.result;o.src=await s?`${d}#svgView(preserveAspectRatio(none))`:d},o.onerror=a.onerror=h});a.readAsDataURL(n),await l}else r.bitmap=await createImageBitmap(n);r.refCounter=1}catch(n){ut(n),r=null}return u(this,un).set(e,r),r&&u(this,un).set(r.id,r),r};let a0=mv;var xr,Ea,td,cr;class B_{constructor(e=128){N(this,xr,[]);N(this,Ea,!1);N(this,td);N(this,cr,-1);T(this,td,e)}add({cmd:e,undo:t,post:r,mustExec:n,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(n&&e(),u(this,Ea))return;const l={cmd:e,undo:t,post:r,type:s};if(u(this,cr)===-1){u(this,xr).length>0&&(u(this,xr).length=0),T(this,cr,0),u(this,xr).push(l);return}if(a&&u(this,xr)[u(this,cr)].type===s){o&&(l.undo=u(this,xr)[u(this,cr)].undo),u(this,xr)[u(this,cr)]=l;return}const c=u(this,cr)+1;c===u(this,td)?u(this,xr).splice(0,1):(T(this,cr,c),c<u(this,xr).length&&u(this,xr).splice(c)),u(this,xr).push(l)}undo(){if(u(this,cr)===-1)return;T(this,Ea,!0);const{undo:e,post:t}=u(this,xr)[u(this,cr)];e(),t==null||t(),T(this,Ea,!1),T(this,cr,u(this,cr)-1)}redo(){if(u(this,cr)<u(this,xr).length-1){T(this,cr,u(this,cr)+1),T(this,Ea,!0);const{cmd:e,post:t}=u(this,xr)[u(this,cr)];e(),t==null||t(),T(this,Ea,!1)}}hasSomethingToUndo(){return u(this,cr)!==-1}hasSomethingToRedo(){return u(this,cr)<u(this,xr).length-1}cleanType(e){if(u(this,cr)!==-1){for(let t=u(this,cr);t>=0;t--)if(u(this,xr)[t].type!==e){u(this,xr).splice(t+1,u(this,cr)-t),T(this,cr,t);return}u(this,xr).length=0,T(this,cr,-1)}}destroy(){T(this,xr,null)}}xr=new WeakMap,Ea=new WeakMap,td=new WeakMap,cr=new WeakMap;var og,g1;class Df{constructor(e){N(this,og);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=qr.platform;for(const[r,n,s={}]of e)for(const a of r){const o=a.startsWith("mac+");t&&o?(this.callbacks.set(a.slice(4),{callback:n,options:s}),this.allKeys.add(a.split("+").at(-1))):!t&&!o&&(this.callbacks.set(a,{callback:n,options:s}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const r=this.callbacks.get(L(this,og,g1).call(this,t));if(!r)return;const{callback:n,options:{bubbles:s=!1,args:a=[],checker:o=null}}=r;o&&!o(e,t)||(n.bind(e,...a,t)(),s||_r(t))}}og=new WeakSet,g1=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t};const lg=class lg{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return L_(e),Ct(this,"_colors",e)}convert(e){const t=Mb(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[r,n]of this._colors)if(n.every((s,a)=>s===t[a]))return lg._colorsMapping.get(r);return t}getHexCode(e){const t=this._colors.get(e);return t?Qe.makeHexColor(...t):e}};Ie(lg,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let o0=lg;var _u,Vn,Ir,Yr,Cu,Is,Su,di,_a,Ca,Tu,Mo,ts,Ni,Lo,rd,nd,ku,id,rs,Sa,Du,Ta,ns,ug,ka,sd,Da,Oo,Fo,Pa,ad,zr,Ht,Ns,Ra,Bo,od,ld,Ia,is,Ms,ud,cd,fi,ze,bp,l0,m1,b1,vp,v1,y1,w1,u0,x1,c0,h0,A1,yn,ks,E1,_1,d0,C1,lh,f0;const gu=class gu{constructor(e,t,r,n,s,a,o,l,c,h,d,p,g,y,b){N(this,ze);N(this,_u,new AbortController);N(this,Vn,null);N(this,Ir,new Map);N(this,Yr,new Map);N(this,Cu,null);N(this,Is,null);N(this,Su,null);N(this,di,new B_);N(this,_a,null);N(this,Ca,null);N(this,Tu,0);N(this,Mo,new Set);N(this,ts,null);N(this,Ni,null);N(this,Lo,new Set);Ie(this,"_editorUndoBar",null);N(this,rd,!1);N(this,nd,!1);N(this,ku,!1);N(this,id,null);N(this,rs,null);N(this,Sa,null);N(this,Du,null);N(this,Ta,!1);N(this,ns,null);N(this,ug,new F_);N(this,ka,!1);N(this,sd,!1);N(this,Da,null);N(this,Oo,null);N(this,Fo,null);N(this,Pa,null);N(this,ad,null);N(this,zr,ot.NONE);N(this,Ht,new Set);N(this,Ns,null);N(this,Ra,null);N(this,Bo,null);N(this,od,null);N(this,ld,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});N(this,Ia,[0,0]);N(this,is,null);N(this,Ms,null);N(this,ud,null);N(this,cd,null);N(this,fi,null);const w=this._signal=u(this,_u).signal;T(this,Ms,e),T(this,ud,t),T(this,cd,r),T(this,Cu,n),T(this,Ra,s),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:w}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:w}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:w}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:w}),a._on("setpreference",this.onSetPreference.bind(this),{signal:w}),a._on("switchannotationeditorparams",v=>this.updateParams(v.type,v.value),{signal:w}),L(this,ze,v1).call(this),L(this,ze,A1).call(this),L(this,ze,u0).call(this),T(this,Is,o.annotationStorage),T(this,id,o.filterFactory),T(this,Bo,l),T(this,Du,c||null),T(this,rd,h),T(this,nd,d),T(this,ku,p),T(this,ad,g||null),this.viewParameters={realScale:da.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=b!==!1}static get _keyboardManager(){const e=gu.prototype,t=a=>u(a,Ms).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Ct(this,"_keyboardManager",new Df([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&u(a,Ms).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&u(a,Ms).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:t}]]))}destroy(){var e,t,r,n,s,a,o,l;(e=u(this,fi))==null||e.resolve(),T(this,fi,null),(t=u(this,_u))==null||t.abort(),T(this,_u,null),this._signal=null;for(const c of u(this,Yr).values())c.destroy();u(this,Yr).clear(),u(this,Ir).clear(),u(this,Lo).clear(),(r=u(this,Pa))==null||r.clear(),T(this,Vn,null),u(this,Ht).clear(),u(this,di).destroy(),(n=u(this,Cu))==null||n.destroy(),(s=u(this,Ra))==null||s.destroy(),(a=u(this,ns))==null||a.hide(),T(this,ns,null),(o=u(this,Fo))==null||o.destroy(),T(this,Fo,null),u(this,rs)&&(clearTimeout(u(this,rs)),T(this,rs,null)),u(this,is)&&(clearTimeout(u(this,is)),T(this,is,null)),(l=this._editorUndoBar)==null||l.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return u(this,ad)}get useNewAltTextFlow(){return u(this,nd)}get useNewAltTextWhenAddingImage(){return u(this,ku)}get hcmFilter(){return Ct(this,"hcmFilter",u(this,Bo)?u(this,id).addHCMFilter(u(this,Bo).foreground,u(this,Bo).background):"none")}get direction(){return Ct(this,"direction",getComputedStyle(u(this,Ms)).direction)}get highlightColors(){return Ct(this,"highlightColors",u(this,Du)?new Map(u(this,Du).split(",").map(e=>(e=e.split("=").map(t=>t.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColorNames(){return Ct(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),T(this,Ca,e)}setMainHighlightColorPicker(e){T(this,Fo,e)}editAltText(e,t=!1){var r;(r=u(this,Cu))==null||r.editAltText(this,e,t)}getSignature(e){var t;(t=u(this,Ra))==null||t.getSignature({uiManager:this,editor:e})}get signatureManager(){return u(this,Ra)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":T(this,ku,t);break}}onPageChanging({pageNumber:e}){T(this,Tu,e-1)}focusMainContainer(){u(this,Ms).focus()}findParent(e,t){for(const r of u(this,Yr).values()){const{x:n,y:s,width:a,height:o}=r.div.getBoundingClientRect();if(e>=n&&e<=n+a&&t>=s&&t<=s+o)return r}return null}disableUserSelect(e=!1){u(this,ud).classList.toggle("noUserSelect",e)}addShouldRescale(e){u(this,Lo).add(e)}removeShouldRescale(e){u(this,Lo).delete(e)}onScaleChanging({scale:e}){var t;this.commitOrRemove(),this.viewParameters.realScale=e*da.PDF_TO_CSS_UNITS;for(const r of u(this,Lo))r.onScaleChanging();(t=u(this,Ca))==null||t.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:r,anchorOffset:n,focusNode:s,focusOffset:a}=t,o=t.toString(),c=L(this,ze,bp).call(this,t).closest(".textLayer"),h=this.getSelectionBoxes(c);if(!h)return;t.empty();const d=L(this,ze,l0).call(this,c),p=u(this,zr)===ot.NONE,g=()=>{d==null||d.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:r,anchorOffset:n,focusNode:s,focusOffset:a,text:o}),p&&this.showAllEditors("highlight",!0,!0)};if(p){this.switchToMode(ot.HIGHLIGHT,g);return}g()}addToAnnotationStorage(e){!e.isEmpty()&&u(this,Is)&&!u(this,Is).has(e.id)&&u(this,Is).setValue(e.id,e)}a11yAlert(e,t=null){const r=u(this,cd);r&&(r.setAttribute("data-l10n-id",e),t?r.setAttribute("data-l10n-args",JSON.stringify(t)):r.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,u(this,Ta)&&(T(this,Ta,!1),L(this,ze,vp).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of u(this,Ht))if(t.div.contains(e)){T(this,Oo,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!u(this,Oo))return;const[e,t]=u(this,Oo);T(this,Oo,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){L(this,ze,u0).call(this),L(this,ze,c0).call(this)}removeEditListeners(){L(this,ze,x1).call(this),L(this,ze,h0).call(this)}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const r of u(this,Ni))if(r.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const r of u(this,Ni))if(r.isHandlingMimeForPasting(t.type)){r.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=u(this,Vn))==null||r.commitOrRemove(),!this.hasSelection)return;const t=[];for(const n of u(this,Ht)){const s=n.serialize(!0);s&&t.push(s)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const s of t.items)for(const a of u(this,Ni))if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let r=t.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(s){ut(`paste: "${s.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const n=this.currentLayer;try{const s=[];for(const l of r){const c=await n.deserialize(l);if(!c)return;s.push(c)}const a=()=>{for(const l of s)L(this,ze,d0).call(this,l);L(this,ze,f0).call(this,s)},o=()=>{for(const l of s)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){ut(`paste: "${s.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),u(this,zr)!==ot.NONE&&!this.isEditorHandlingKeyboard&&gu._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,u(this,Ta)&&(T(this,Ta,!1),L(this,ze,vp).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(L(this,ze,y1).call(this),L(this,ze,c0).call(this),L(this,ze,yn).call(this,{isEditing:u(this,zr)!==ot.NONE,isEmpty:L(this,ze,lh).call(this),hasSomethingToUndo:u(this,di).hasSomethingToUndo(),hasSomethingToRedo:u(this,di).hasSomethingToRedo(),hasSelectedEditor:!1})):(L(this,ze,w1).call(this),L(this,ze,h0).call(this),L(this,ze,yn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!u(this,Ni)){T(this,Ni,e);for(const t of u(this,Ni))L(this,ze,ks).call(this,t.defaultPropertiesToUpdate)}}getId(){return u(this,ug).id}get currentLayer(){return u(this,Yr).get(u(this,Tu))}getLayer(e){return u(this,Yr).get(e)}get currentPageIndex(){return u(this,Tu)}addLayer(e){u(this,Yr).set(e.pageIndex,e),u(this,ka)?e.enable():e.disable()}removeLayer(e){u(this,Yr).delete(e.pageIndex)}async updateMode(e,t=null,r=!1,n=!1){var s,a,o;if(u(this,zr)!==e&&!(u(this,fi)&&(await u(this,fi).promise,!u(this,fi)))){if(T(this,fi,Promise.withResolvers()),(s=u(this,Ca))==null||s.commitOrRemove(),T(this,zr,e),e===ot.NONE){this.setEditingState(!1),L(this,ze,_1).call(this),(a=this._editorUndoBar)==null||a.hide(),u(this,fi).resolve();return}e===ot.SIGNATURE&&await((o=u(this,Ra))==null?void 0:o.loadSignatures()),this.setEditingState(!0),await L(this,ze,E1).call(this),this.unselectAll();for(const l of u(this,Yr).values())l.updateMode(e);if(!t){r&&this.addNewEditorFromKeyboard(),u(this,fi).resolve();return}for(const l of u(this,Ir).values())l.annotationElementId===t||l.id===t?(this.setSelected(l),n&&l.enterInEditMode()):l.unselect();u(this,fi).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==u(this,zr)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){var r;if(u(this,Ni)){switch(e){case kt.CREATE:this.currentLayer.addNewEditor(t);return;case kt.HIGHLIGHT_DEFAULT_COLOR:(r=u(this,Fo))==null||r.updateColor(t);break;case kt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(u(this,od)||T(this,od,new Map)).set(e,t),this.showAllEditors("highlight",t);break}for(const n of u(this,Ht))n.updateParams(e,t);for(const n of u(this,Ni))n.updateDefaultParams(e,t)}}showAllEditors(e,t,r=!1){var s;for(const a of u(this,Ir).values())a.editorType===e&&a.show(t);(((s=u(this,od))==null?void 0:s.get(kt.HIGHLIGHT_SHOW_ALL))??!0)!==t&&L(this,ze,ks).call(this,[[kt.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(u(this,sd)!==e){T(this,sd,e);for(const t of u(this,Yr).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}getEditors(e){const t=[];for(const r of u(this,Ir).values())r.pageIndex===e&&t.push(r);return t}getEditor(e){return u(this,Ir).get(e)}addEditor(e){u(this,Ir).set(e.id,e)}removeEditor(e){var t,r;e.div.contains(document.activeElement)&&(u(this,rs)&&clearTimeout(u(this,rs)),T(this,rs,setTimeout(()=>{this.focusMainContainer(),T(this,rs,null)},0))),u(this,Ir).delete(e.id),e.annotationElementId&&((t=u(this,Pa))==null||t.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!u(this,Mo).has(e.annotationElementId))&&((r=u(this,Is))==null||r.remove(e.id))}addDeletedAnnotationElement(e){u(this,Mo).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return u(this,Mo).has(e)}removeDeletedAnnotationElement(e){u(this,Mo).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){u(this,Vn)!==e&&(T(this,Vn,e),e&&L(this,ze,ks).call(this,e.propertiesToUpdate))}updateUI(e){u(this,ze,C1)===e&&L(this,ze,ks).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){L(this,ze,ks).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(u(this,Ht).has(e)){u(this,Ht).delete(e),e.unselect(),L(this,ze,yn).call(this,{hasSelectedEditor:this.hasSelection});return}u(this,Ht).add(e),e.select(),L(this,ze,ks).call(this,e.propertiesToUpdate),L(this,ze,yn).call(this,{hasSelectedEditor:!0})}setSelected(e){var t;this.updateToolbar({mode:e.mode,editId:e.id}),(t=u(this,Ca))==null||t.commitOrRemove();for(const r of u(this,Ht))r!==e&&r.unselect();u(this,Ht).clear(),u(this,Ht).add(e),e.select(),L(this,ze,ks).call(this,e.propertiesToUpdate),L(this,ze,yn).call(this,{hasSelectedEditor:!0})}isSelected(e){return u(this,Ht).has(e)}get firstSelectedEditor(){return u(this,Ht).values().next().value}unselect(e){e.unselect(),u(this,Ht).delete(e),L(this,ze,yn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return u(this,Ht).size!==0}get isEnterHandled(){return u(this,Ht).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;u(this,di).undo(),L(this,ze,yn).call(this,{hasSomethingToUndo:u(this,di).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:L(this,ze,lh).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){u(this,di).redo(),L(this,ze,yn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:u(this,di).hasSomethingToRedo(),isEmpty:L(this,ze,lh).call(this)})}addCommands(e){u(this,di).add(e),L(this,ze,yn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:L(this,ze,lh).call(this)})}cleanUndoStack(e){u(this,di).cleanType(e)}delete(){var s;this.commitOrRemove();const e=(s=this.currentLayer)==null?void 0:s.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...u(this,Ht)],r=()=>{var a;(a=this._editorUndoBar)==null||a.show(n,t.length===1?t[0].editorType:t.length);for(const o of t)o.remove()},n=()=>{for(const a of t)L(this,ze,d0).call(this,a)};this.addCommands({cmd:r,undo:n,mustExec:!0})}commitOrRemove(){var e;(e=u(this,Vn))==null||e.commitOrRemove()}hasSomethingToControl(){return u(this,Vn)||this.hasSelection}selectAll(){for(const e of u(this,Ht))e.commit();L(this,ze,f0).call(this,u(this,Ir).values())}unselectAll(){var e;if(!(u(this,Vn)&&(u(this,Vn).commitOrRemove(),u(this,zr)!==ot.NONE))&&!((e=u(this,Ca))!=null&&e.commitOrRemove())&&this.hasSelection){for(const t of u(this,Ht))t.unselect();u(this,Ht).clear(),L(this,ze,yn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;u(this,Ia)[0]+=e,u(this,Ia)[1]+=t;const[n,s]=u(this,Ia),a=[...u(this,Ht)],o=1e3;u(this,is)&&clearTimeout(u(this,is)),T(this,is,setTimeout(()=>{T(this,is,null),u(this,Ia)[0]=u(this,Ia)[1]=0,this.addCommands({cmd:()=>{for(const l of a)u(this,Ir).has(l.id)&&(l.translateInPage(n,s),l.translationDone())},undo:()=>{for(const l of a)u(this,Ir).has(l.id)&&(l.translateInPage(-n,-s),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(e,t),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),T(this,ts,new Map);for(const e of u(this,Ht))u(this,ts).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!u(this,ts))return!1;this.disableUserSelect(!1);const e=u(this,ts);T(this,ts,null);let t=!1;for(const[{x:n,y:s,pageIndex:a},o]of e)o.newX=n,o.newY=s,o.newPageIndex=a,t||(t=n!==o.savedX||s!==o.savedY||a!==o.savedPageIndex);if(!t)return!1;const r=(n,s,a,o)=>{if(u(this,Ir).has(n.id)){const l=u(this,Yr).get(o);l?n._setParentAndPosition(l,s,a):(n.pageIndex=o,n.x=s,n.y=a)}};return this.addCommands({cmd:()=>{for(const[n,{newX:s,newY:a,newPageIndex:o}]of e)r(n,s,a,o)},undo:()=>{for(const[n,{savedX:s,savedY:a,savedPageIndex:o}]of e)r(n,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(u(this,ts))for(const r of u(this,ts).keys())r.drag(e,t)}rebuild(e){if(e.parent===null){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||u(this,Ht).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return u(this,Vn)===e}getActive(){return u(this,Vn)}getMode(){return u(this,zr)}get imageManager(){return Ct(this,"imageManager",new a0)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let c=0,h=t.rangeCount;c<h;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:n,width:s,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,h,d,p)=>({x:(h-n)/a,y:1-(c+d-r)/s,width:p/a,height:d/s});break;case"180":o=(c,h,d,p)=>({x:1-(c+d-r)/s,y:1-(h+p-n)/a,width:d/s,height:p/a});break;case"270":o=(c,h,d,p)=>({x:1-(h+p-n)/a,y:(c-r)/s,width:p/a,height:d/s});break;default:o=(c,h,d,p)=>({x:(c-r)/s,y:(h-n)/a,width:d/s,height:p/a});break}const l=[];for(let c=0,h=t.rangeCount;c<h;c++){const d=t.getRangeAt(c);if(!d.collapsed)for(const{x:p,y:g,width:y,height:b}of d.getClientRects())y===0||b===0||l.push(o(p,g,y,b))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:t}){(u(this,Su)||T(this,Su,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){var t;(t=u(this,Su))==null||t.delete(e)}renderAnnotationElement(e){var n;const t=(n=u(this,Su))==null?void 0:n.get(e.data.id);if(!t)return;const r=u(this,Is).getRawValue(t);r&&(u(this,zr)===ot.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}setMissingCanvas(e,t,r){var s;const n=(s=u(this,Pa))==null?void 0:s.get(e);n&&(n.setCanvas(t,r),u(this,Pa).delete(e))}addMissingCanvas(e,t){(u(this,Pa)||T(this,Pa,new Map)).set(e,t)}};_u=new WeakMap,Vn=new WeakMap,Ir=new WeakMap,Yr=new WeakMap,Cu=new WeakMap,Is=new WeakMap,Su=new WeakMap,di=new WeakMap,_a=new WeakMap,Ca=new WeakMap,Tu=new WeakMap,Mo=new WeakMap,ts=new WeakMap,Ni=new WeakMap,Lo=new WeakMap,rd=new WeakMap,nd=new WeakMap,ku=new WeakMap,id=new WeakMap,rs=new WeakMap,Sa=new WeakMap,Du=new WeakMap,Ta=new WeakMap,ns=new WeakMap,ug=new WeakMap,ka=new WeakMap,sd=new WeakMap,Da=new WeakMap,Oo=new WeakMap,Fo=new WeakMap,Pa=new WeakMap,ad=new WeakMap,zr=new WeakMap,Ht=new WeakMap,Ns=new WeakMap,Ra=new WeakMap,Bo=new WeakMap,od=new WeakMap,ld=new WeakMap,Ia=new WeakMap,is=new WeakMap,Ms=new WeakMap,ud=new WeakMap,cd=new WeakMap,fi=new WeakMap,ze=new WeakSet,bp=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},l0=function(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const r of u(this,Yr).values())if(r.hasTextLayer(e))return r;return null},m1=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=L(this,ze,bp).call(this,e).closest(".textLayer"),n=this.getSelectionBoxes(r);n&&(u(this,ns)||T(this,ns,new O_(this)),u(this,ns).show(r,n,this.direction==="ltr"))},b1=function(){var s,a,o;const e=document.getSelection();if(!e||e.isCollapsed){u(this,Ns)&&((s=u(this,ns))==null||s.hide(),T(this,Ns,null),L(this,ze,yn).call(this,{hasSelectedText:!1}));return}const{anchorNode:t}=e;if(t===u(this,Ns))return;const n=L(this,ze,bp).call(this,e).closest(".textLayer");if(!n){u(this,Ns)&&((a=u(this,ns))==null||a.hide(),T(this,Ns,null),L(this,ze,yn).call(this,{hasSelectedText:!1}));return}if((o=u(this,ns))==null||o.hide(),T(this,Ns,t),L(this,ze,yn).call(this,{hasSelectedText:!0}),!(u(this,zr)!==ot.HIGHLIGHT&&u(this,zr)!==ot.NONE)&&(u(this,zr)===ot.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),T(this,Ta,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=u(this,zr)===ot.HIGHLIGHT?L(this,ze,l0).call(this,n):null;l==null||l.toggleDrawing();const c=new AbortController,h=this.combinedSignal(c),d=p=>{p.type==="pointerup"&&p.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),p.type==="pointerup"&&L(this,ze,vp).call(this,"main_toolbar"))};window.addEventListener("pointerup",d,{signal:h}),window.addEventListener("blur",d,{signal:h})}},vp=function(e=""){u(this,zr)===ot.HIGHLIGHT?this.highlightSelection(e):u(this,rd)&&L(this,ze,m1).call(this)},v1=function(){document.addEventListener("selectionchange",L(this,ze,b1).bind(this),{signal:this._signal})},y1=function(){if(u(this,Sa))return;T(this,Sa,new AbortController);const e=this.combinedSignal(u(this,Sa));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},w1=function(){var e;(e=u(this,Sa))==null||e.abort(),T(this,Sa,null)},u0=function(){if(u(this,Da))return;T(this,Da,new AbortController);const e=this.combinedSignal(u(this,Da));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},x1=function(){var e;(e=u(this,Da))==null||e.abort(),T(this,Da,null)},c0=function(){if(u(this,_a))return;T(this,_a,new AbortController);const e=this.combinedSignal(u(this,_a));document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})},h0=function(){var e;(e=u(this,_a))==null||e.abort(),T(this,_a,null)},A1=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},yn=function(e){Object.entries(e).some(([r,n])=>u(this,ld)[r]!==n)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(u(this,ld),e)}),u(this,zr)===ot.HIGHLIGHT&&e.hasSelectedEditor===!1&&L(this,ze,ks).call(this,[[kt.HIGHLIGHT_FREE,!0]]))},ks=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},E1=async function(){if(!u(this,ka)){T(this,ka,!0);const e=[];for(const t of u(this,Yr).values())e.push(t.enable());await Promise.all(e);for(const t of u(this,Ir).values())t.enable()}},_1=function(){if(this.unselectAll(),u(this,ka)){T(this,ka,!1);for(const e of u(this,Yr).values())e.disable();for(const e of u(this,Ir).values())e.disable()}},d0=function(e){const t=u(this,Yr).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},C1=function(){let e=null;for(e of u(this,Ht));return e},lh=function(){if(u(this,Ir).size===0)return!0;if(u(this,Ir).size===1)for(const e of u(this,Ir).values())return e.isEmpty();return!1},f0=function(e){for(const t of u(this,Ht))t.unselect();u(this,Ht).clear();for(const t of e)t.isEmpty()||(u(this,Ht).add(t),t.select());L(this,ze,yn).call(this,{hasSelectedEditor:this.hasSelection})},Ie(gu,"TRANSLATE_SMALL",1),Ie(gu,"TRANSLATE_BIG",10);let oo=gu;var jr,ss,Mi,Pu,as,Gn,Ru,os,Rn,Ls,zo,ls,Na,qi,uh,yp;const wn=class wn{constructor(e){N(this,qi);N(this,jr,null);N(this,ss,!1);N(this,Mi,null);N(this,Pu,null);N(this,as,null);N(this,Gn,null);N(this,Ru,!1);N(this,os,null);N(this,Rn,null);N(this,Ls,null);N(this,zo,null);N(this,ls,!1);T(this,Rn,e),T(this,ls,e._uiManager.useNewAltTextFlow),u(wn,Na)||T(wn,Na,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){wn._l10n??(wn._l10n=e)}async render(){const e=T(this,Mi,document.createElement("button"));e.className="altText",e.tabIndex="0";const t=T(this,Pu,document.createElement("span"));e.append(t),u(this,ls)?(e.classList.add("new"),e.setAttribute("data-l10n-id",u(wn,Na).missing),t.setAttribute("data-l10n-id",u(wn,Na)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=u(this,Rn)._uiManager._signal;e.addEventListener("contextmenu",Ei,{signal:r}),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});const n=s=>{s.preventDefault(),u(this,Rn)._uiManager.editAltText(u(this,Rn)),u(this,ls)&&u(this,Rn)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:u(this,qi,uh)}})};return e.addEventListener("click",n,{capture:!0,signal:r}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(T(this,Ru,!0),n(s))},{signal:r}),await L(this,qi,yp).call(this),e}finish(){u(this,Mi)&&(u(this,Mi).focus({focusVisible:u(this,Ru)}),T(this,Ru,!1))}isEmpty(){return u(this,ls)?u(this,jr)===null:!u(this,jr)&&!u(this,ss)}hasData(){return u(this,ls)?u(this,jr)!==null||!!u(this,Ls):this.isEmpty()}get guessedText(){return u(this,Ls)}async setGuessedText(e){u(this,jr)===null&&(T(this,Ls,e),T(this,zo,await wn._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),L(this,qi,yp).call(this))}toggleAltTextBadge(e=!1){var t;if(!u(this,ls)||u(this,jr)){(t=u(this,os))==null||t.remove(),T(this,os,null);return}if(!u(this,os)){const r=T(this,os,document.createElement("div"));r.className="noAltTextBadge",u(this,Rn).div.append(r)}u(this,os).classList.toggle("hidden",!e)}serialize(e){let t=u(this,jr);return!e&&u(this,Ls)===t&&(t=u(this,zo)),{altText:t,decorative:u(this,ss),guessedText:u(this,Ls),textWithDisclaimer:u(this,zo)}}get data(){return{altText:u(this,jr),decorative:u(this,ss)}}set data({altText:e,decorative:t,guessedText:r,textWithDisclaimer:n,cancel:s=!1}){r&&(T(this,Ls,r),T(this,zo,n)),!(u(this,jr)===e&&u(this,ss)===t)&&(s||(T(this,jr,e),T(this,ss,t)),L(this,qi,yp).call(this))}toggle(e=!1){u(this,Mi)&&(!e&&u(this,Gn)&&(clearTimeout(u(this,Gn)),T(this,Gn,null)),u(this,Mi).disabled=!e)}shown(){u(this,Rn)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:u(this,qi,uh)}})}destroy(){var e,t;(e=u(this,Mi))==null||e.remove(),T(this,Mi,null),T(this,Pu,null),T(this,as,null),(t=u(this,os))==null||t.remove(),T(this,os,null)}};jr=new WeakMap,ss=new WeakMap,Mi=new WeakMap,Pu=new WeakMap,as=new WeakMap,Gn=new WeakMap,Ru=new WeakMap,os=new WeakMap,Rn=new WeakMap,Ls=new WeakMap,zo=new WeakMap,ls=new WeakMap,Na=new WeakMap,qi=new WeakSet,uh=function(){return u(this,jr)&&"added"||u(this,jr)===null&&this.guessedText&&"review"||"missing"},yp=async function(){var n,s,a;const e=u(this,Mi);if(!e)return;if(u(this,ls)){if(e.classList.toggle("done",!!u(this,jr)),e.setAttribute("data-l10n-id",u(wn,Na)[u(this,qi,uh)]),(n=u(this,Pu))==null||n.setAttribute("data-l10n-id",u(wn,Na)[`${u(this,qi,uh)}-label`]),!u(this,jr)){(s=u(this,as))==null||s.remove();return}}else{if(!u(this,jr)&&!u(this,ss)){e.classList.remove("done"),(a=u(this,as))==null||a.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=u(this,as);if(!t){T(this,as,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${u(this,Rn).id}`;const o=100,l=u(this,Rn)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(u(this,Gn)),T(this,Gn,null)},{once:!0}),e.addEventListener("mouseenter",()=>{T(this,Gn,setTimeout(()=>{T(this,Gn,null),u(this,as).classList.add("show"),u(this,Rn)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),e.addEventListener("mouseleave",()=>{var c;u(this,Gn)&&(clearTimeout(u(this,Gn)),T(this,Gn,null)),(c=u(this,as))==null||c.classList.remove("show")},{signal:l})}u(this,ss)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=u(this,jr)),t.parentNode||e.append(t);const r=u(this,Rn).getElementForAltText();r==null||r.setAttribute("aria-describedby",t.id)},N(wn,Na,null),Ie(wn,"_l10n",null);let Yp=wn;var Iu,jo,hd,dd,fd,pd,gd,Os,Uo,Fs,Ho,Bs,po,S1,T1,k1;const bv=class bv{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:r=null,onPinchStart:n=null,onPinching:s=null,onPinchEnd:a=null,signal:o}){N(this,po);N(this,Iu);N(this,jo,!1);N(this,hd,null);N(this,dd);N(this,fd);N(this,pd);N(this,gd);N(this,Os,null);N(this,Uo);N(this,Fs,null);N(this,Ho);N(this,Bs,null);T(this,Iu,e),T(this,hd,r),T(this,dd,t),T(this,fd,n),T(this,pd,s),T(this,gd,a),T(this,Ho,new AbortController),T(this,Uo,AbortSignal.any([o,u(this,Ho).signal])),e.addEventListener("touchstart",L(this,po,S1).bind(this),{passive:!1,signal:u(this,Uo)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Wi.pixelRatio}destroy(){var e,t;(e=u(this,Ho))==null||e.abort(),T(this,Ho,null),(t=u(this,Os))==null||t.abort(),T(this,Os,null)}};Iu=new WeakMap,jo=new WeakMap,hd=new WeakMap,dd=new WeakMap,fd=new WeakMap,pd=new WeakMap,gd=new WeakMap,Os=new WeakMap,Uo=new WeakMap,Fs=new WeakMap,Ho=new WeakMap,Bs=new WeakMap,po=new WeakSet,S1=function(e){var n,s,a;if((n=u(this,dd))!=null&&n.call(this))return;if(e.touches.length===1){if(u(this,Os))return;const o=T(this,Os,new AbortController),l=AbortSignal.any([u(this,Uo),o.signal]),c=u(this,Iu),h={capture:!0,signal:l,passive:!1},d=p=>{var g;p.pointerType==="touch"&&((g=u(this,Os))==null||g.abort(),T(this,Os,null))};c.addEventListener("pointerdown",p=>{p.pointerType==="touch"&&(_r(p),d(p))},h),c.addEventListener("pointerup",d,h),c.addEventListener("pointercancel",d,h);return}if(!u(this,Bs)){T(this,Bs,new AbortController);const o=AbortSignal.any([u(this,Uo),u(this,Bs).signal]),l=u(this,Iu),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",L(this,po,T1).bind(this),c);const h=L(this,po,k1).bind(this);l.addEventListener("touchend",h,c),l.addEventListener("touchcancel",h,c),c.capture=!0,l.addEventListener("pointerdown",_r,c),l.addEventListener("pointermove",_r,c),l.addEventListener("pointercancel",_r,c),l.addEventListener("pointerup",_r,c),(s=u(this,fd))==null||s.call(this)}if(_r(e),e.touches.length!==2||(a=u(this,hd))!=null&&a.call(this)){T(this,Fs,null);return}let[t,r]=e.touches;t.identifier>r.identifier&&([t,r]=[r,t]),T(this,Fs,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:r.screenX,touch1Y:r.screenY})},T1=function(e){var _;if(!u(this,Fs)||e.touches.length!==2)return;_r(e);let[t,r]=e.touches;t.identifier>r.identifier&&([t,r]=[r,t]);const{screenX:n,screenY:s}=t,{screenX:a,screenY:o}=r,l=u(this,Fs),{touch0X:c,touch0Y:h,touch1X:d,touch1Y:p}=l,g=d-c,y=p-h,b=a-n,w=o-s,v=Math.hypot(b,w)||1,A=Math.hypot(g,y)||1;if(!u(this,jo)&&Math.abs(A-v)<=bv.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=n,l.touch0Y=s,l.touch1X=a,l.touch1Y=o,!u(this,jo)){T(this,jo,!0);return}const E=[(n+a)/2,(s+o)/2];(_=u(this,pd))==null||_.call(this,E,A,v)},k1=function(e){var t;e.touches.length>=2||(u(this,Bs)&&(u(this,Bs).abort(),T(this,Bs,null),(t=u(this,gd))==null||t.call(this)),u(this,Fs)&&(_r(e),T(this,Fs,null),T(this,jo,!1)))};let Ih=bv;var $o,Li,or,Nu,Ma,md,Vo,Zr,Go,zs,La,bd,qo,qn,vd,Wo,js,us,Mu,Lu,pi,Xo,yd,cg,tt,p0,wd,g0,wp,D1,P1,m0,xp,b0,R1,I1,N1,v0,M1,y0,L1,O1,F1,w0,ch;const vt=class vt{constructor(e){N(this,tt);N(this,$o,null);N(this,Li,null);N(this,or,null);N(this,Nu,!1);N(this,Ma,null);N(this,md,"");N(this,Vo,!1);N(this,Zr,null);N(this,Go,null);N(this,zs,null);N(this,La,null);N(this,bd,"");N(this,qo,!1);N(this,qn,null);N(this,vd,!1);N(this,Wo,!1);N(this,js,!1);N(this,us,null);N(this,Mu,0);N(this,Lu,0);N(this,pi,null);N(this,Xo,null);Ie(this,"isSelected",!1);Ie(this,"_isCopy",!1);Ie(this,"_editToolbar",null);Ie(this,"_initialOptions",Object.create(null));Ie(this,"_initialData",null);Ie(this,"_isVisible",!0);Ie(this,"_uiManager",null);Ie(this,"_focusEventsAllowed",!0);N(this,yd,!1);N(this,cg,vt._zIndex++);this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null;const{rotation:t,rawDims:{pageWidth:r,pageHeight:n,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,n],this.pageTranslation=[s,a];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=vt.prototype._resizeWithKeyboard,t=oo.TRANSLATE_SMALL,r=oo.TRANSLATE_BIG;return Ct(this,"_resizerKeyboardManager",new Df([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],vt.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Ct(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new z_({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(vt._l10n??(vt._l10n=e),vt._l10nResizer||(vt._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),vt._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);vt._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Wt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return u(this,yd)}set _isDraggable(e){var t;T(this,yd,e),(t=this.div)==null||t.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=u(this,cg)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):L(this,tt,ch).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(u(this,qo)?T(this,qo,!1):this.parent.setSelected(this))}focusout(e){var r;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const t=e.relatedTarget;t!=null&&t.closest(`#${this.id}`)||(e.preventDefault(),(r=this.parent)!=null&&r.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,r,n){const[s,a]=this.parentDimensions;[r,n]=this.screenToPageTranslation(r,n),this.x=(e+r)/s,this.y=(t+n)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){const[r,n]=this.parentDimensions;this.setAt(e*r,t*n,this.width*r,this.height*n),this._onTranslated()}translate(e,t){L(this,tt,p0).call(this,this.parentDimensions,e,t)}translateInPage(e,t){u(this,qn)||T(this,qn,[this.x,this.y,this.width,this.height]),L(this,tt,p0).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){u(this,qn)||T(this,qn,[this.x,this.y,this.width,this.height]);const{div:r,parentDimensions:[n,s]}=this;if(this.x+=e/n,this.y+=t/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:p}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,p)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,c]=this.getBaseTranslation();a+=l,o+=c;const{style:h}=r;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),r.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!u(this,qn)&&(u(this,qn)[0]!==this.x||u(this,qn)[1]!==this.y)}get _hasBeenResized(){return!!u(this,qn)&&(u(this,qn)[2]!==this.width||u(this,qn)[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:r}=vt,n=r/e,s=r/t;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[r,n]}=this;let{x:s,y:a,width:o,height:l}=this;if(o*=r,l*=n,s*=r,a*=n,this._mustFixPosition)switch(e){case 0:s=dn(s,0,r-o),a=dn(a,0,n-l);break;case 90:s=dn(s,0,r-l),a=dn(a,o,n);break;case 180:s=dn(s,o,r),a=dn(a,l,n);break;case 270:s=dn(s,l,r),a=dn(a,0,n-o);break}this.x=s/=r,this.y=a/=n;const[c,h]=this.getBaseTranslation();s+=c,a+=h,t.left=`${(100*s).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var r;return L(r=vt,wd,g0).call(r,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var r;return L(r=vt,wd,g0).call(r,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,r]}=this;return[t*e,r*e]}setDims(e,t){const[r,n]=this.parentDimensions,{style:s}=this.div;s.width=`${(100*e/r).toFixed(2)}%`,u(this,Vo)||(s.height=`${(100*t/n).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:r}=e,n=r.endsWith("%"),s=!u(this,Vo)&&t.endsWith("%");if(n&&s)return;const[a,o]=this.parentDimensions;n||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),!u(this,Vo)&&!s&&(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=u(this,or))==null||e.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||u(this,Wo))return this._editToolbar;this._editToolbar=new s0(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[t,r]of e)await this._editToolbar.addButton(t,r);return this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){var e;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(e=u(this,or))==null||e.destroy())}addContainer(e){var r;const t=(r=this._editToolbar)==null?void 0:r.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return u(this,or)||(Yp.initialize(vt._l10n),T(this,or,new Yp(this)),u(this,$o)&&(u(this,or).data=u(this,$o),T(this,$o,null))),u(this,or)}get altTextData(){var e;return(e=u(this,or))==null?void 0:e.data}set altTextData(e){u(this,or)&&(u(this,or).data=e)}get guessedAltText(){var e;return(e=u(this,or))==null?void 0:e.guessedText}async setGuessedAltText(e){var t;await((t=u(this,or))==null?void 0:t.setGuessedText(e))}serializeAltText(e){var t;return(t=u(this,or))==null?void 0:t.serialize(e)}hasAltText(){return!!u(this,or)&&!u(this,or).isEmpty()}hasAltTextData(){var e;return((e=u(this,or))==null?void 0:e.hasData())??!1}render(){var a;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=u(this,Nu)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),L(this,tt,y0).call(this);const[t,r]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*r/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/r).toFixed(2)}%`);const[n,s]=this.getInitialTranslation();return this.translate(n,s),p1(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(u(this,Xo)||T(this,Xo,new Ih({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:L(this,tt,R1).bind(this),onPinching:L(this,tt,I1).bind(this),onPinchEnd:L(this,tt,N1).bind(this),signal:this._uiManager._signal}))),(a=this._uiManager._editorUndoBar)==null||a.hide(),e}pointerdown(e){const{isMac:t}=qr.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(T(this,qo,!0),this._isDraggable){L(this,tt,M1).call(this,e);return}L(this,tt,v0).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){u(this,us)&&clearTimeout(u(this,us)),T(this,us,setTimeout(()=>{var e;T(this,us,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,r){e.changeParent(this),this.x=t,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,r=this.rotation){const n=this.parentScale,[s,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/n,h=t/n,d=this.x*s,p=this.y*a,g=this.width*s,y=this.height*a;switch(r){case 0:return[d+c+o,a-p-h-y+l,d+c+g+o,a-p-h+l];case 90:return[d+h+o,a-p+c+l,d+h+y+o,a-p+c+g+l];case 180:return[d-c-g+o,a-p+h+l,d-c+o,a-p+h+y+l];case 270:return[d-h-y+o,a-p-c-g+l,d-h+o,a-p-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[r,n,s,a]=e,o=s-r,l=a-n;switch(this.rotation){case 0:return[r,t-a,o,l];case 90:return[r,t-n,l,o];case 180:return[s,t-n,o,l];case 270:return[s,t-a,l,o];default:throw new Error("Invalid rotation")}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),T(this,Wo,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),T(this,Wo,!1),!0):!1}isInEditMode(){return u(this,Wo)}shouldGetKeyboardEvents(){return u(this,js)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:r,right:n}=this.getClientDimensions(),{innerHeight:s,innerWidth:a}=window;return t<a&&n>0&&e<s&&r>0}rebuild(){L(this,tt,y0).call(this)}rotate(e){}resize(){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,t=null){Wt("An editor must be serializable")}static async deserialize(e,t,r){const n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:r,annotationElementId:e.annotationElementId});n.rotation=e.rotation,T(n,$o,e.accessibilityData),n._isCopy=e.isCopy||!1;const[s,a]=n.pageDimensions,[o,l,c,h]=n.getRectInCurrentCoords(e.rect,a);return n.x=o/s,n.y=l/a,n.width=c/s,n.height=h/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,t;if((e=u(this,La))==null||e.abort(),T(this,La,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),u(this,us)&&(clearTimeout(u(this,us)),T(this,us,null)),L(this,tt,ch).call(this),this.removeEditToolbar(),u(this,pi)){for(const r of u(this,pi).values())clearTimeout(r);T(this,pi,null)}this.parent=null,(t=u(this,Xo))==null||t.destroy(),T(this,Xo,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(L(this,tt,D1).call(this),u(this,Zr).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),T(this,zs,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=u(this,Zr).children;if(!u(this,Li)){T(this,Li,Array.from(t));const a=L(this,tt,L1).bind(this),o=L(this,tt,O1).bind(this),l=this._uiManager._signal;for(const c of u(this,Li)){const h=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",L(this,tt,F1).bind(this,h),{signal:l}),c.setAttribute("data-l10n-id",vt._l10nResizer[h])}}const r=u(this,Li)[0];let n=0;for(const a of t){if(a===r)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(u(this,Li).length/4);if(s!==n){if(s<n)for(let o=0;o<n-s;o++)u(this,Zr).append(u(this,Zr).firstChild);else if(s>n)for(let o=0;o<s-n;o++)u(this,Zr).firstChild.before(u(this,Zr).lastChild);let a=0;for(const o of t){const c=u(this,Li)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",vt._l10nResizer[c])}}L(this,tt,w0).call(this,0),T(this,js,!0),u(this,Zr).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){u(this,js)&&L(this,tt,b0).call(this,u(this,bd),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){L(this,tt,ch).call(this),this.div.focus()}select(){var e,t,r;if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var n,s;(n=this.div)!=null&&n.classList.contains("selectedEditor")&&((s=this._editToolbar)==null||s.show())});return}(t=this._editToolbar)==null||t.show(),(r=u(this,or))==null||r.toggleAltTextBadge(!1)}}unselect(){var e,t,r,n,s;this.isSelected&&(this.isSelected=!1,(e=u(this,Zr))==null||e.classList.add("hidden"),(t=this.div)==null||t.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(n=this._editToolbar)==null||n.hide(),(s=u(this,or))==null||s.toggleAltTextBadge(!0))}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return u(this,vd)}set isEditing(e){T(this,vd,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){T(this,Vo,!0);const r=e/t,{style:n}=this.div;n.aspectRatio=r,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){u(this,pi)||T(this,pi,new Map);const{action:r}=e;let n=u(this,pi).get(r);n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(e),u(this,pi).delete(r),u(this,pi).size===0&&T(this,pi,null)},vt._telemetryTimeout),u(this,pi).set(r,n);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),T(this,Nu,!1)}disable(){this.div&&(this.div.tabIndex=-1),T(this,Nu,!0)}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){const r=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),r.before(t)}return t}resetAnnotationElement(e){const{firstChild:t}=e.container;(t==null?void 0:t.nodeName)==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};$o=new WeakMap,Li=new WeakMap,or=new WeakMap,Nu=new WeakMap,Ma=new WeakMap,md=new WeakMap,Vo=new WeakMap,Zr=new WeakMap,Go=new WeakMap,zs=new WeakMap,La=new WeakMap,bd=new WeakMap,qo=new WeakMap,qn=new WeakMap,vd=new WeakMap,Wo=new WeakMap,js=new WeakMap,us=new WeakMap,Mu=new WeakMap,Lu=new WeakMap,pi=new WeakMap,Xo=new WeakMap,yd=new WeakMap,cg=new WeakMap,tt=new WeakSet,p0=function([e,t],r,n){[r,n]=this.screenToPageTranslation(r,n),this.x+=r/e,this.y+=n/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},wd=new WeakSet,g0=function(e,t,r){switch(r){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},wp=function(e){switch(e){case 90:{const[t,r]=this.pageDimensions;return[0,-t/r,r/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,r]=this.pageDimensions;return[0,t/r,-r/t,0]}default:return[1,0,0,1]}},D1=function(){if(u(this,Zr))return;T(this,Zr,document.createElement("div")),u(this,Zr).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const r of e){const n=document.createElement("div");u(this,Zr).append(n),n.classList.add("resizer",r),n.setAttribute("data-resizer-name",r),n.addEventListener("pointerdown",L(this,tt,P1).bind(this,r),{signal:t}),n.addEventListener("contextmenu",Ei,{signal:t}),n.tabIndex=-1}this.div.prepend(u(this,Zr))},P1=function(e,t){var h;t.preventDefault();const{isMac:r}=qr.platform;if(t.button!==0||t.ctrlKey&&r)return;(h=u(this,or))==null||h.toggle(!1);const n=this._isDraggable;this._isDraggable=!1,T(this,Go,[t.screenX,t.screenY]);const s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",L(this,tt,b0).bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",_r,{passive:!1,signal:a}),window.addEventListener("contextmenu",Ei,{signal:a}),T(this,zs,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const c=()=>{var d;s.abort(),this.parent.togglePointerEvents(!0),(d=u(this,or))==null||d.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=o,this.div.style.cursor=l,L(this,tt,xp).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})},m0=function(e,t,r,n){this.width=r,this.height=n,this.x=e,this.y=t;const[s,a]=this.parentDimensions;this.setDims(s*r,a*n),this.fixAndSetPosition(),this._onResized()},xp=function(){if(!u(this,zs))return;const{savedX:e,savedY:t,savedWidth:r,savedHeight:n}=u(this,zs);T(this,zs,null);const s=this.x,a=this.y,o=this.width,l=this.height;s===e&&a===t&&o===r&&l===n||this.addCommands({cmd:L(this,tt,m0).bind(this,s,a,o,l),undo:L(this,tt,m0).bind(this,e,t,r,n),mustExec:!0})},b0=function(e,t){const[r,n]=this.parentDimensions,s=this.x,a=this.y,o=this.width,l=this.height,c=vt.MIN_SIZE/r,h=vt.MIN_SIZE/n,d=L(this,tt,wp).call(this,this.rotation),p=(Y,W)=>[d[0]*Y+d[2]*W,d[1]*Y+d[3]*W],g=L(this,tt,wp).call(this,360-this.rotation),y=(Y,W)=>[g[0]*Y+g[2]*W,g[1]*Y+g[3]*W];let b,w,v=!1,A=!1;switch(e){case"topLeft":v=!0,b=(Y,W)=>[0,0],w=(Y,W)=>[Y,W];break;case"topMiddle":b=(Y,W)=>[Y/2,0],w=(Y,W)=>[Y/2,W];break;case"topRight":v=!0,b=(Y,W)=>[Y,0],w=(Y,W)=>[0,W];break;case"middleRight":A=!0,b=(Y,W)=>[Y,W/2],w=(Y,W)=>[0,W/2];break;case"bottomRight":v=!0,b=(Y,W)=>[Y,W],w=(Y,W)=>[0,0];break;case"bottomMiddle":b=(Y,W)=>[Y/2,W],w=(Y,W)=>[Y/2,0];break;case"bottomLeft":v=!0,b=(Y,W)=>[0,W],w=(Y,W)=>[Y,0];break;case"middleLeft":A=!0,b=(Y,W)=>[0,W/2],w=(Y,W)=>[Y,W/2];break}const E=b(o,l),_=w(o,l);let C=p(..._);const I=vt._round(s+C[0]),k=vt._round(a+C[1]);let D=1,R=1,z,G;if(t.fromKeyboard)({deltaX:z,deltaY:G}=t);else{const{screenX:Y,screenY:W}=t,[fe,K]=u(this,Go);[z,G]=this.screenToPageTranslation(Y-fe,W-K),u(this,Go)[0]=Y,u(this,Go)[1]=W}if([z,G]=y(z/r,G/n),v){const Y=Math.hypot(o,l);D=R=Math.max(Math.min(Math.hypot(_[0]-E[0]-z,_[1]-E[1]-G)/Y,1/o,1/l),c/o,h/l)}else A?D=dn(Math.abs(_[0]-E[0]-z),c,1)/o:R=dn(Math.abs(_[1]-E[1]-G),h,1)/l;const O=vt._round(o*D),X=vt._round(l*R);C=p(...w(O,X));const S=I-C[0],J=k-C[1];u(this,qn)||T(this,qn,[this.x,this.y,this.width,this.height]),this.width=O,this.height=X,this.x=S,this.y=J,this.setDims(r*O,n*X),this.fixAndSetPosition(),this._onResizing()},R1=function(){var e;T(this,zs,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(e=u(this,or))==null||e.toggle(!1),this.parent.togglePointerEvents(!1)},I1=function(e,t,r){let s=.7*(r/t)+1-.7;if(s===1)return;const a=L(this,tt,wp).call(this,this.rotation),o=(I,k)=>[a[0]*I+a[2]*k,a[1]*I+a[3]*k],[l,c]=this.parentDimensions,h=this.x,d=this.y,p=this.width,g=this.height,y=vt.MIN_SIZE/l,b=vt.MIN_SIZE/c;s=Math.max(Math.min(s,1/p,1/g),y/p,b/g);const w=vt._round(p*s),v=vt._round(g*s);if(w===p&&v===g)return;u(this,qn)||T(this,qn,[h,d,p,g]);const A=o(p/2,g/2),E=vt._round(h+A[0]),_=vt._round(d+A[1]),C=o(w/2,v/2);this.x=E-C[0],this.y=_-C[1],this.width=w,this.height=v,this.setDims(l*w,c*v),this.fixAndSetPosition(),this._onResizing()},N1=function(){var e;(e=u(this,or))==null||e.toggle(!0),this.parent.togglePointerEvents(!0),L(this,tt,xp).call(this)},v0=function(e){const{isMac:t}=qr.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},M1=function(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let r=!1;const n=new AbortController,s=this._uiManager.combinedSignal(n),a={capture:!0,passive:!1,signal:s},o=c=>{n.abort(),T(this,Ma,null),T(this,qo,!1),this._uiManager.endDragSession()||L(this,tt,v0).call(this,c),r&&this._onStopDragging()};t&&(T(this,Mu,e.clientX),T(this,Lu,e.clientY),T(this,Ma,e.pointerId),T(this,md,e.pointerType),window.addEventListener("pointermove",c=>{r||(r=!0,this._onStartDragging());const{clientX:h,clientY:d,pointerId:p}=c;if(p!==u(this,Ma)){_r(c);return}const[g,y]=this.screenToPageTranslation(h-u(this,Mu),d-u(this,Lu));T(this,Mu,h),T(this,Lu,d),this._uiManager.dragSelectedEditors(g,y)},a),window.addEventListener("touchmove",_r,a),window.addEventListener("pointerdown",c=>{c.pointerType===u(this,md)&&(u(this,Xo)||c.isPrimary)&&o(c),_r(c)},a));const l=c=>{if(!u(this,Ma)||u(this,Ma)===c.pointerId){o(c);return}_r(c)};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})},y0=function(){if(u(this,La)||!this.div)return;T(this,La,new AbortController);const e=this._uiManager.combinedSignal(u(this,La));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},L1=function(e){vt._resizerKeyboardManager.exec(this,e)},O1=function(e){var t;u(this,js)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==u(this,Zr)&&L(this,tt,ch).call(this)},F1=function(e){T(this,bd,u(this,js)?e:"")},w0=function(e){if(u(this,Li))for(const t of u(this,Li))t.tabIndex=e},ch=function(){T(this,js,!1),L(this,tt,w0).call(this,-1),L(this,tt,xp).call(this)},N(vt,wd),Ie(vt,"_l10n",null),Ie(vt,"_l10nResizer",null),Ie(vt,"_borderLineWidth",-1),Ie(vt,"_colorManager",new o0),Ie(vt,"_zIndex",1),Ie(vt,"_telemetryTimeout",1e3);let tr=vt;class z_ extends tr{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Kv=3285377520,ci=4294901760,Qi=65535;class B1{constructor(e){this.h1=e?e&4294967295:Kv,this.h2=e?e&4294967295:Kv}update(e){let t,r;if(typeof e=="string"){t=new Uint8Array(e.length*2),r=0;for(let b=0,w=e.length;b<w;b++){const v=e.charCodeAt(b);v<=255?t[r++]=v:(t[r++]=v>>>8,t[r++]=v&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),r=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const n=r>>2,s=r-n*4,a=new Uint32Array(t.buffer,0,n);let o=0,l=0,c=this.h1,h=this.h2;const d=3432918353,p=461845907,g=d&Qi,y=p&Qi;for(let b=0;b<n;b++)b&1?(o=a[b],o=o*d&ci|o*g&Qi,o=o<<15|o>>>17,o=o*p&ci|o*y&Qi,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[b],l=l*d&ci|l*g&Qi,l=l<<15|l>>>17,l=l*p&ci|l*y&Qi,h^=l,h=h<<13|h>>>19,h=h*5+3864292196);switch(o=0,s){case 3:o^=t[n*4+2]<<16;case 2:o^=t[n*4+1]<<8;case 1:o^=t[n*4],o=o*d&ci|o*g&Qi,o=o<<15|o>>>17,o=o*p&ci|o*y&Qi,n&1?c^=o:h^=o}this.h1=c,this.h2=h}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&ci|e*36045&Qi,t=t*4283543511&ci|((t<<16|e>>>16)*2950163797&ci)>>>16,e^=t>>>1,e=e*444984403&ci|e*60499&Qi,t=t*3301882366&ci|((t<<16|e>>>16)*3120437893&ci)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const x0=Object.freeze({map:null,hash:"",transfer:void 0});var Yo,Zo,Kr,hg,z1;class Lb{constructor(){N(this,hg);N(this,Yo,!1);N(this,Zo,null);N(this,Kr,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const r=u(this,Kr).get(e);return r===void 0?t:Object.assign(t,r)}getRawValue(e){return u(this,Kr).get(e)}remove(e){if(u(this,Kr).delete(e),u(this,Kr).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const t of u(this,Kr).values())if(t instanceof tr)return;this.onAnnotationEditor(null)}}setValue(e,t){const r=u(this,Kr).get(e);let n=!1;if(r!==void 0)for(const[s,a]of Object.entries(t))r[s]!==a&&(n=!0,r[s]=a);else n=!0,u(this,Kr).set(e,t);n&&L(this,hg,z1).call(this),t instanceof tr&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return u(this,Kr).has(e)}get size(){return u(this,Kr).size}resetModified(){u(this,Yo)&&(T(this,Yo,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new j1(this)}get serializable(){if(u(this,Kr).size===0)return x0;const e=new Map,t=new B1,r=[],n=Object.create(null);let s=!1;for(const[a,o]of u(this,Kr)){const l=o instanceof tr?o.serialize(!1,n):o;l&&(e.set(a,l),t.update(`${a}:${JSON.stringify(l)}`),s||(s=!!l.bitmap))}if(s)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:r}:x0}get editorStats(){let e=null;const t=new Map;for(const r of u(this,Kr).values()){if(!(r instanceof tr))continue;const n=r.telemetryFinalData;if(!n)continue;const{type:s}=n;t.has(s)||t.set(s,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const a=e[s]||(e[s]=new Map);for(const[o,l]of Object.entries(n)){if(o==="type")continue;let c=a.get(o);c||(c=new Map,a.set(o,c));const h=c.get(l)??0;c.set(l,h+1)}}for(const[r,n]of t)e[r]=n.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){T(this,Zo,null)}get modifiedIds(){if(u(this,Zo))return u(this,Zo);const e=[];for(const t of u(this,Kr).values())!(t instanceof tr)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return T(this,Zo,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return u(this,Kr).entries()}}Yo=new WeakMap,Zo=new WeakMap,Kr=new WeakMap,hg=new WeakSet,z1=function(){u(this,Yo)||(T(this,Yo,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var xd;class j1 extends Lb{constructor(t){super();N(this,xd);const{map:r,hash:n,transfer:s}=t.serializable,a=structuredClone(r,s?{transfer:s}:null);T(this,xd,{map:a,hash:n,transfer:s})}get print(){Wt("Should not call PrintAnnotationStorage.print")}get serializable(){return u(this,xd)}get modifiedIds(){return Ct(this,"modifiedIds",{ids:new Set,hash:""})}}xd=new WeakMap;var Ou;class j_{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){N(this,Ou,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),u(this,Ou).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:r}){if(!(!e||u(this,Ou).has(e.loadedName))){if(Dr(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:s,style:a}=e,o=new FontFace(n,s,a);this.addNativeFontFace(o);try{await o.load(),u(this,Ou).add(n),r==null||r(e)}catch{ut(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Wt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(n){throw ut(`Failed to load font '${r.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const n=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){var t;const e=!!((t=this._document)!=null&&t.fonts);return Ct(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Ct(this,"isSyncFontLoadingSupported",_n||qr.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(Dr(!n.done,"completeRequest() cannot be called twice."),n.done=!0;r.length>0&&r[0].done;){const s=r.shift();setTimeout(s.callback,0)}}const{loadingRequests:r}=this,n={done:!1,complete:t,callback:e};return r.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Ct(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function r(_,C){return _.charCodeAt(C)<<24|_.charCodeAt(C+1)<<16|_.charCodeAt(C+2)<<8|_.charCodeAt(C+3)&255}function n(_,C,I,k){const D=_.substring(0,C),R=_.substring(C+I);return D+k+R}let s,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function h(_,C){if(++c>30){ut("Load test font never loaded."),C();return}if(l.font="30px "+_,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(h.bind(null,_,C))}const d=`lt${Date.now()}${this.loadTestFontId++}`;let p=this._loadTestFont;p=n(p,976,d.length,d);const y=16,b=1482184792;let w=r(p,y);for(s=0,a=d.length-3;s<a;s+=4)w=w-b+r(d,s)|0;s<d.length&&(w=w-b+r(d+"XXX",s)|0),p=n(p,y,4,k_(w));const v=`url(data:font/opentype;base64,${btoa(p)});`,A=`@font-face {font-family:"${d}";src:${v}}`;this.insertRule(A);const E=this._document.createElement("div");E.style.visibility="hidden",E.style.width=E.style.height="10px",E.style.position="absolute",E.style.top=E.style.left="0px";for(const _ of[e.loadedName,d]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=_,E.append(C)}this._document.body.append(E),h(d,()=>{E.remove(),t.complete()})}}Ou=new WeakMap;class U_{constructor(e,t=null){this.compiledGlyphs=Object.create(null);for(const r in e)this[r]=e[r];this._inspectFont=t}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(t=this._inspectFont)==null||t.call(this,this),e}createFontFaceRule(){var r;if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${i1(this.data)});`;let t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return(r=this._inspectFont)==null||r.call(this,this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];const r=this.loadedName+"_path_"+t;let n;try{n=e.get(r)}catch(a){ut(`getPathGenerator - ignoring character: "${a}".`)}const s=new Path2D(n||"");return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[t]=s}}function H_(i){if(i instanceof URL)return i.href;if(typeof i=="string"){if(_n)return i;const e=URL.parse(i,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function $_(i){if(_n&&typeof Buffer<"u"&&i instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength)return i;if(typeof i=="string")return Sf(i);if(i instanceof ArrayBuffer||ArrayBuffer.isView(i)||typeof i=="object"&&!isNaN(i==null?void 0:i.length))return new Uint8Array(i);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function tp(i){if(typeof i!="string")return null;if(i.endsWith("/"))return i;throw new Error(`Invalid factory url: "${i}" must include trailing slash.`)}const A0=i=>typeof i=="object"&&Number.isInteger(i==null?void 0:i.num)&&i.num>=0&&Number.isInteger(i==null?void 0:i.gen)&&i.gen>=0,V_=i=>typeof i=="object"&&typeof(i==null?void 0:i.name)=="string",U1=I_.bind(null,A0,V_);var Us,dg;class G_{constructor(){N(this,Us,new Map);N(this,dg,Promise.resolve())}postMessage(e,t){const r={data:structuredClone(e,t?{transfer:t}:null)};u(this,dg).then(()=>{for(const[n]of u(this,Us))n.call(this,r)})}addEventListener(e,t,r=null){let n=null;if((r==null?void 0:r.signal)instanceof AbortSignal){const{signal:s}=r;if(s.aborted){ut("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,t);n=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}u(this,Us).set(t,n)}removeEventListener(e,t){const r=u(this,Us).get(t);r==null||r(),u(this,Us).delete(t)}terminate(){for(const[,e]of u(this,Us))e==null||e();u(this,Us).clear()}}Us=new WeakMap,dg=new WeakMap;const rp={DATA:1,ERROR:2},Tr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Qv(){}function Dn(i){if(i instanceof ha||i instanceof Wp||i instanceof Xv||i instanceof Rh||i instanceof dm)return i;switch(i instanceof Error||typeof i=="object"&&i!==null||Wt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),i.name){case"AbortException":return new ha(i.message);case"InvalidPDFException":return new Wp(i.message);case"PasswordException":return new Xv(i.message,i.code);case"ResponseException":return new Rh(i.message,i.status,i.missing);case"UnknownErrorException":return new dm(i.message,i.details)}return new dm(i.message,i.toString())}var Fu,Ai,H1,$1,V1,Ap;class hh{constructor(e,t,r){N(this,Ai);N(this,Fu,new AbortController);this.sourceName=e,this.targetName=t,this.comObj=r,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),r.addEventListener("message",L(this,Ai,H1).bind(this),{signal:u(this,Fu).signal})}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},r)}catch(a){s.reject(a)}return s.promise}sendWithStream(e,t,r,n){const s=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const h=Promise.withResolvers();return this.streamControllers[s]={controller:c,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:s,data:t,desiredSize:c.desiredSize},n),h.promise},pull:c=>{const h=Promise.withResolvers();return this.streamControllers[s].pullCall=h,l.postMessage({sourceName:a,targetName:o,stream:Tr.PULL,streamId:s,desiredSize:c.desiredSize}),h.promise},cancel:c=>{Dr(c instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[s].cancelCall=h,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:Tr.CANCEL,streamId:s,reason:Dn(c)}),h.promise}},r)}destroy(){var e;(e=u(this,Fu))==null||e.abort(),T(this,Fu,null)}}Fu=new WeakMap,Ai=new WeakSet,H1=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){L(this,Ai,V1).call(this,e);return}if(e.callback){const r=e.callbackId,n=this.callbackCapabilities[r];if(!n)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===rp.DATA)n.resolve(e.data);else if(e.callback===rp.ERROR)n.reject(Dn(e.reason));else throw new Error("Unexpected callback case");return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,n=e.sourceName,s=this.comObj;Promise.try(t,e.data).then(function(a){s.postMessage({sourceName:r,targetName:n,callback:rp.DATA,callbackId:e.callbackId,data:a})},function(a){s.postMessage({sourceName:r,targetName:n,callback:rp.ERROR,callbackId:e.callbackId,reason:Dn(a)})});return}if(e.streamId){L(this,Ai,$1).call(this,e);return}t(e.data)},$1=function(e){const t=e.streamId,r=this.sourceName,n=e.sourceName,s=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(c,h=1,d){if(this.isCancelled)return;const p=this.desiredSize;this.desiredSize-=h,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:r,targetName:n,stream:Tr.ENQUEUE,streamId:t,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:n,stream:Tr.CLOSE,streamId:t}),delete a.streamSinks[t])},error(c){Dr(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:n,stream:Tr.ERROR,streamId:t,reason:Dn(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,Promise.try(o,e.data,l).then(function(){s.postMessage({sourceName:r,targetName:n,stream:Tr.START_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:r,targetName:n,stream:Tr.START_COMPLETE,streamId:t,reason:Dn(c)})})},V1=function(e){const t=e.streamId,r=this.sourceName,n=e.sourceName,s=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case Tr.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Dn(e.reason));break;case Tr.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Dn(e.reason));break;case Tr.PULL:if(!o){s.postMessage({sourceName:r,targetName:n,stream:Tr.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||Qv).then(function(){s.postMessage({sourceName:r,targetName:n,stream:Tr.PULL_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:r,targetName:n,stream:Tr.PULL_COMPLETE,streamId:t,reason:Dn(c)})});break;case Tr.ENQUEUE:if(Dr(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case Tr.CLOSE:if(Dr(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),L(this,Ai,Ap).call(this,a,t);break;case Tr.ERROR:Dr(a,"error should have stream controller"),a.controller.error(Dn(e.reason)),L(this,Ai,Ap).call(this,a,t);break;case Tr.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Dn(e.reason)),L(this,Ai,Ap).call(this,a,t);break;case Tr.CANCEL:if(!o)break;const l=Dn(e.reason);Promise.try(o.onCancel||Qv,l).then(function(){s.postMessage({sourceName:r,targetName:n,stream:Tr.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:r,targetName:n,stream:Tr.CANCEL_COMPLETE,streamId:t,reason:Dn(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},Ap=async function(e,t){var r,n,s;await Promise.allSettled([(r=e.startCall)==null?void 0:r.promise,(n=e.pullCall)==null?void 0:n.promise,(s=e.cancelCall)==null?void 0:s.promise]),delete this.streamControllers[t]};var Ad;class G1{constructor({enableHWA:e=!1}){N(this,Ad,!1);T(this,Ad,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,t);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!u(this,Ad)})}}reset(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Wt("Abstract method `_createCanvas` called.")}}Ad=new WeakMap;class q_ extends G1{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const r=this._document.createElement("canvas");return r.width=e,r.height=t,r}}class q1{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){Wt("Abstract method `_fetch` called.")}}class Jv extends q1{async _fetch(e){const t=await Nc(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):Sf(t)}}class W1{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,r,n,s){return"none"}destroy(e=!1){}}var Ko,Bu,Hs,$s,cn,Qo,Jo,Ge,ln,dh,au,Ep,ou,X1,E0,lu,fh,ph,_0,gh;class W_ extends W1{constructor({docId:t,ownerDocument:r=globalThis.document}){super();N(this,Ge);N(this,Ko);N(this,Bu);N(this,Hs);N(this,$s);N(this,cn);N(this,Qo);N(this,Jo,0);T(this,$s,t),T(this,cn,r)}addFilter(t){if(!t)return"none";let r=u(this,Ge,ln).get(t);if(r)return r;const[n,s,a]=L(this,Ge,Ep).call(this,t),o=t.length===1?n:`${n}${s}${a}`;if(r=u(this,Ge,ln).get(o),r)return u(this,Ge,ln).set(t,r),r;const l=`g_${u(this,$s)}_transfer_map_${bn(this,Jo)._++}`,c=L(this,Ge,ou).call(this,l);u(this,Ge,ln).set(t,c),u(this,Ge,ln).set(o,c);const h=L(this,Ge,lu).call(this,l);return L(this,Ge,ph).call(this,n,s,a,h),c}addHCMFilter(t,r){var y;const n=`${t}-${r}`,s="base";let a=u(this,Ge,dh).get(s);if((a==null?void 0:a.key)===n||(a?((y=a.filter)==null||y.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},u(this,Ge,dh).set(s,a)),!t||!r))return a.url;const o=L(this,Ge,gh).call(this,t);t=Qe.makeHexColor(...o);const l=L(this,Ge,gh).call(this,r);if(r=Qe.makeHexColor(...l),u(this,Ge,au).style.color="",t==="#000000"&&r==="#ffffff"||t===r)return a.url;const c=new Array(256);for(let b=0;b<=255;b++){const w=b/255;c[b]=w<=.03928?w/12.92:((w+.055)/1.055)**2.4}const h=c.join(","),d=`g_${u(this,$s)}_hcm_filter`,p=a.filter=L(this,Ge,lu).call(this,d);L(this,Ge,ph).call(this,h,h,h,p),L(this,Ge,E0).call(this,p);const g=(b,w)=>{const v=o[b]/255,A=l[b]/255,E=new Array(w+1);for(let _=0;_<=w;_++)E[_]=v+_/w*(A-v);return E.join(",")};return L(this,Ge,ph).call(this,g(0,5),g(1,5),g(2,5),p),a.url=L(this,Ge,ou).call(this,d),a.url}addAlphaFilter(t){let r=u(this,Ge,ln).get(t);if(r)return r;const[n]=L(this,Ge,Ep).call(this,[t]),s=`alpha_${n}`;if(r=u(this,Ge,ln).get(s),r)return u(this,Ge,ln).set(t,r),r;const a=`g_${u(this,$s)}_alpha_map_${bn(this,Jo)._++}`,o=L(this,Ge,ou).call(this,a);u(this,Ge,ln).set(t,o),u(this,Ge,ln).set(s,o);const l=L(this,Ge,lu).call(this,a);return L(this,Ge,_0).call(this,n,l),o}addLuminosityFilter(t){let r=u(this,Ge,ln).get(t||"luminosity");if(r)return r;let n,s;if(t?([n]=L(this,Ge,Ep).call(this,[t]),s=`luminosity_${n}`):s="luminosity",r=u(this,Ge,ln).get(s),r)return u(this,Ge,ln).set(t,r),r;const a=`g_${u(this,$s)}_luminosity_map_${bn(this,Jo)._++}`,o=L(this,Ge,ou).call(this,a);u(this,Ge,ln).set(t,o),u(this,Ge,ln).set(s,o);const l=L(this,Ge,lu).call(this,a);return L(this,Ge,X1).call(this,l),t&&L(this,Ge,_0).call(this,n,l),o}addHighlightHCMFilter(t,r,n,s,a){var A;const o=`${r}-${n}-${s}-${a}`;let l=u(this,Ge,dh).get(t);if((l==null?void 0:l.key)===o||(l?((A=l.filter)==null||A.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},u(this,Ge,dh).set(t,l)),!r||!n))return l.url;const[c,h]=[r,n].map(L(this,Ge,gh).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[g,y]=[s,a].map(L(this,Ge,gh).bind(this));p<d&&([d,p,g,y]=[p,d,y,g]),u(this,Ge,au).style.color="";const b=(E,_,C)=>{const I=new Array(256),k=(p-d)/C,D=E/255,R=(_-E)/(255*C);let z=0;for(let G=0;G<=C;G++){const O=Math.round(d+G*k),X=D+G*R;for(let S=z;S<=O;S++)I[S]=X;z=O+1}for(let G=z;G<256;G++)I[G]=I[z-1];return I.join(",")},w=`g_${u(this,$s)}_hcm_${t}_filter`,v=l.filter=L(this,Ge,lu).call(this,w);return L(this,Ge,E0).call(this,v),L(this,Ge,ph).call(this,b(g[0],y[0],5),b(g[1],y[1],5),b(g[2],y[2],5),v),l.url=L(this,Ge,ou).call(this,w),l.url}destroy(t=!1){var r,n,s,a;t&&((r=u(this,Qo))!=null&&r.size)||((n=u(this,Hs))==null||n.parentNode.parentNode.remove(),T(this,Hs,null),(s=u(this,Bu))==null||s.clear(),T(this,Bu,null),(a=u(this,Qo))==null||a.clear(),T(this,Qo,null),T(this,Jo,0))}}Ko=new WeakMap,Bu=new WeakMap,Hs=new WeakMap,$s=new WeakMap,cn=new WeakMap,Qo=new WeakMap,Jo=new WeakMap,Ge=new WeakSet,ln=function(){return u(this,Bu)||T(this,Bu,new Map)},dh=function(){return u(this,Qo)||T(this,Qo,new Map)},au=function(){if(!u(this,Hs)){const t=u(this,cn).createElement("div"),{style:r}=t;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const n=u(this,cn).createElementNS(Ts,"svg");n.setAttribute("width",0),n.setAttribute("height",0),T(this,Hs,u(this,cn).createElementNS(Ts,"defs")),t.append(n),n.append(u(this,Hs)),u(this,cn).body.append(t)}return u(this,Hs)},Ep=function(t){if(t.length===1){const c=t[0],h=new Array(256);for(let p=0;p<256;p++)h[p]=c[p]/255;const d=h.join(",");return[d,d,d]}const[r,n,s]=t,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=r[c]/255,o[c]=n[c]/255,l[c]=s[c]/255;return[a.join(","),o.join(","),l.join(",")]},ou=function(t){if(u(this,Ko)===void 0){T(this,Ko,"");const r=u(this,cn).URL;r!==u(this,cn).baseURI&&(kf(r)?ut('#createUrl: ignore "data:"-URL for performance reasons.'):T(this,Ko,Rb(r,"")))}return`url(${u(this,Ko)}#${t})`},X1=function(t){const r=u(this,cn).createElementNS(Ts,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(r)},E0=function(t){const r=u(this,cn).createElementNS(Ts,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(r)},lu=function(t){const r=u(this,cn).createElementNS(Ts,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),u(this,Ge,au).append(r),r},fh=function(t,r,n){const s=u(this,cn).createElementNS(Ts,r);s.setAttribute("type","discrete"),s.setAttribute("tableValues",n),t.append(s)},ph=function(t,r,n,s){const a=u(this,cn).createElementNS(Ts,"feComponentTransfer");s.append(a),L(this,Ge,fh).call(this,a,"feFuncR",t),L(this,Ge,fh).call(this,a,"feFuncG",r),L(this,Ge,fh).call(this,a,"feFuncB",n)},_0=function(t,r){const n=u(this,cn).createElementNS(Ts,"feComponentTransfer");r.append(n),L(this,Ge,fh).call(this,n,"feFuncA",t)},gh=function(t){return u(this,Ge,au).style.color=t,Mb(getComputedStyle(u(this,Ge,au)).getPropertyValue("color"))};class Y1{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(r=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){Wt("Abstract method `_fetch` called.")}}class ey extends Y1{async _fetch(e){const t=await Nc(e,"arraybuffer");return new Uint8Array(t)}}class Z1{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(r=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){Wt("Abstract method `_fetch` called.")}}class ty extends Z1{async _fetch(e){const t=await Nc(e,"arraybuffer");return new Uint8Array(t)}}_n&&ut("Please use the `legacy` build in Node.js environments.");async function Ob(i){const t=await process.getBuiltinModule("fs").promises.readFile(i);return new Uint8Array(t)}class X_ extends W1{}class Y_ extends G1{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:um&&um.tagName.toUpperCase()==="SCRIPT"&&um.src||new URL("index.cjs",document.baseURI).href)("@napi-rs/canvas").createCanvas(e,t)}}class Z_ extends q1{async _fetch(e){return Ob(e)}}class K_ extends Y1{async _fetch(e){return Ob(e)}}class Q_ extends Z1{async _fetch(e){return Ob(e)}}const tn={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function C0(i,e){if(!e)return;const t=e[2]-e[0],r=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],t,r),i.clip(n)}class Fb{isModifyingCurrentTransform(){return!1}getPattern(){Wt("Abstract method `getPattern` called.")}}class J_ extends Fb{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)t.addColorStop(r[0],r[1]);return t}getPattern(e,t,r,n){let s;if(n===tn.STROKE||n===tn.FILL){const a=t.current.getClippedPathBoundingBox(n,hr(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=t.cachedCanvases.getCanvas("pattern",o,l),h=c.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),r=Qe.transform(r,[1,0,0,1,a[0],a[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),C0(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=e.createPattern(c.canvas,"no-repeat");const d=new DOMMatrix(r);s.setTransform(d)}else C0(e,this._bbox),s=this._createGradient(e);return s}}function gm(i,e,t,r,n,s,a,o){const l=e.coords,c=e.colors,h=i.data,d=i.width*4;let p;l[t+1]>l[r+1]&&(p=t,t=r,r=p,p=s,s=a,a=p),l[r+1]>l[n+1]&&(p=r,r=n,n=p,p=a,a=o,o=p),l[t+1]>l[r+1]&&(p=t,t=r,r=p,p=s,s=a,a=p);const g=(l[t]+e.offsetX)*e.scaleX,y=(l[t+1]+e.offsetY)*e.scaleY,b=(l[r]+e.offsetX)*e.scaleX,w=(l[r+1]+e.offsetY)*e.scaleY,v=(l[n]+e.offsetX)*e.scaleX,A=(l[n+1]+e.offsetY)*e.scaleY;if(y>=A)return;const E=c[s],_=c[s+1],C=c[s+2],I=c[a],k=c[a+1],D=c[a+2],R=c[o],z=c[o+1],G=c[o+2],O=Math.round(y),X=Math.round(A);let S,J,Y,W,fe,K,be,te;for(let j=O;j<=X;j++){if(j<w){const le=j<y?0:(y-j)/(y-w);S=g-(g-b)*le,J=E-(E-I)*le,Y=_-(_-k)*le,W=C-(C-D)*le}else{let le;j>A?le=1:w===A?le=0:le=(w-j)/(w-A),S=b-(b-v)*le,J=I-(I-R)*le,Y=k-(k-z)*le,W=D-(D-G)*le}let ie;j<y?ie=0:j>A?ie=1:ie=(y-j)/(y-A),fe=g-(g-v)*ie,K=E-(E-R)*ie,be=_-(_-z)*ie,te=C-(C-G)*ie;const ae=Math.round(Math.min(S,fe)),H=Math.round(Math.max(S,fe));let se=d*j+ae*4;for(let le=ae;le<=H;le++)ie=(S-le)/(S-fe),ie<0?ie=0:ie>1&&(ie=1),h[se++]=J-(J-K)*ie|0,h[se++]=Y-(Y-be)*ie|0,h[se++]=W-(W-te)*ie|0,h[se++]=255}}function eC(i,e,t){const r=e.coords,n=e.colors;let s,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(r.length/o)-1,c=o-1;for(s=0;s<l;s++){let h=s*o;for(let d=0;d<c;d++,h++)gm(i,t,r[h],r[h+1],r[h+o],n[h],n[h+1],n[h+o]),gm(i,t,r[h+o+1],r[h+1],r[h+o],n[h+o+1],n[h+1],n[h+o])}break;case"triangles":for(s=0,a=r.length;s<a;s+=3)gm(i,t,r[s],r[s+1],r[s+2],n[s],n[s+1],n[s+2]);break;default:throw new Error("illegal figure")}}class tC extends Fb{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,r){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,h=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),p=Math.min(Math.ceil(Math.abs(h*e[1]*1.1)),3e3),g=c/d,y=h/p,b={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/g,scaleY:1/y},w=d+2*2,v=p+2*2,A=r.getCanvas("mesh",w,v),E=A.context,_=E.createImageData(d,p);if(t){const I=_.data;for(let k=0,D=I.length;k<D;k+=4)I[k]=t[0],I[k+1]=t[1],I[k+2]=t[2],I[k+3]=255}for(const I of this._figures)eC(_,I,b);return E.putImageData(_,2,2),{canvas:A.canvas,offsetX:o-2*g,offsetY:l-2*y,scaleX:g,scaleY:y}}isModifyingCurrentTransform(){return!0}getPattern(e,t,r,n){C0(e,this._bbox);const s=new Float32Array(2);if(n===tn.SHADING)Qe.singularValueDecompose2dScale(hr(e),s);else if(this.matrix){Qe.singularValueDecompose2dScale(this.matrix,s);const[o,l]=s;Qe.singularValueDecompose2dScale(t.baseTransform,s),s[0]*=o,s[1]*=l}else Qe.singularValueDecompose2dScale(t.baseTransform,s);const a=this._createMeshCanvas(s,n===tn.SHADING?null:this._background,t.cachedCanvases);return n!==tn.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class rC extends Fb{getPattern(){return"hotpink"}}function nC(i){switch(i[0]){case"RadialAxial":return new J_(i);case"Mesh":return new tC(i);case"Dummy":return new rC}throw new Error(`Unknown IR type: ${i[0]}`)}const ry={COLORED:1,UNCOLORED:2},fg=class fg{constructor(e,t,r,n){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=r,this.baseTransform=n}createPatternCanvas(e){const{bbox:t,operatorList:r,paintType:n,tilingType:s,color:a,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),Sg("TilingType: "+s);const h=t[0],d=t[1],p=t[2],g=t[3],y=p-h,b=g-d,w=new Float32Array(2);Qe.singularValueDecompose2dScale(this.matrix,w);const[v,A]=w;Qe.singularValueDecompose2dScale(this.baseTransform,w);const E=v*w[0],_=A*w[1];let C=y,I=b,k=!1,D=!1;const R=Math.ceil(l*E),z=Math.ceil(c*_),G=Math.ceil(y*E),O=Math.ceil(b*_);R>=G?C=l:k=!0,z>=O?I=c:D=!0;const X=this.getSizeAndScale(C,this.ctx.canvas.width,E),S=this.getSizeAndScale(I,this.ctx.canvas.height,_),J=e.cachedCanvases.getCanvas("pattern",X.size,S.size),Y=J.context,W=o.createCanvasGraphics(Y);if(W.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(W,n,a),Y.translate(-X.scale*h,-S.scale*d),W.transform(X.scale,0,0,S.scale,0,0),Y.save(),this.clipBbox(W,h,d,p,g),W.baseTransform=hr(W.ctx),W.executeOperatorList(r),W.endDrawing(),Y.restore(),k||D){const fe=J.canvas;k&&(C=l),D&&(I=c);const K=this.getSizeAndScale(C,this.ctx.canvas.width,E),be=this.getSizeAndScale(I,this.ctx.canvas.height,_),te=K.size,j=be.size,ie=e.cachedCanvases.getCanvas("pattern-workaround",te,j),ae=ie.context,H=k?Math.floor(y/l):0,se=D?Math.floor(b/c):0;for(let le=0;le<=H;le++)for(let oe=0;oe<=se;oe++)ae.drawImage(fe,te*le,j*oe,te,j,0,0,te,j);return{canvas:ie.canvas,scaleX:K.scale,scaleY:be.scale,offsetX:h,offsetY:d}}return{canvas:J.canvas,scaleX:X.scale,scaleY:S.scale,offsetX:h,offsetY:d}}getSizeAndScale(e,t,r){const n=Math.max(fg.MAX_PATTERN_SIZE,t);let s=Math.ceil(e*r);return s>=n?s=n:r=s/e,{scale:r,size:s}}clipBbox(e,t,r,n,s){const a=n-t,o=s-r;e.ctx.rect(t,r,a,o),Qe.axialAlignedBoundingBox([t,r,n,s],hr(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,r){const n=e.ctx,s=e.current;switch(t){case ry.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;n.fillStyle=s.fillColor=a,n.strokeStyle=s.strokeColor=o;break;case ry.UNCOLORED:n.fillStyle=n.strokeStyle=r,s.fillColor=s.strokeColor=r;break;default:throw new T_(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,r,n){let s=r;n!==tn.SHADING&&(s=Qe.transform(s,t.baseTransform),this.matrix&&(s=Qe.transform(s,this.matrix)));const a=this.createPatternCanvas(t);let o=new DOMMatrix(s);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=e.createPattern(a.canvas,"repeat");return l.setTransform(o),l}};Ie(fg,"MAX_PATTERN_SIZE",3e3);let S0=fg;function iC({src:i,srcPos:e=0,dest:t,width:r,height:n,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=qr.isLittleEndian?4278190080:255,[l,c]=a?[s,o]:[o,s],h=r>>3,d=r&7,p=i.length;t=new Uint32Array(t.buffer);let g=0;for(let y=0;y<n;y++){for(const w=e+h;e<w;e++){const v=e<p?i[e]:255;t[g++]=v&128?c:l,t[g++]=v&64?c:l,t[g++]=v&32?c:l,t[g++]=v&16?c:l,t[g++]=v&8?c:l,t[g++]=v&4?c:l,t[g++]=v&2?c:l,t[g++]=v&1?c:l}if(d===0)continue;const b=e<p?i[e++]:255;for(let w=0;w<d;w++)t[g++]=b&1<<7-w?c:l}return{srcPos:e,destPos:g}}const ny=16,iy=100,sC=15,sy=10,Mn=16,mm=new DOMMatrix,si=new Float32Array(2),fu=new Float32Array([1/0,1/0,-1/0,-1/0]);function aC(i,e){if(i._removeMirroring)throw new Error("Context is already forwarding operations.");i.__originalSave=i.save,i.__originalRestore=i.restore,i.__originalRotate=i.rotate,i.__originalScale=i.scale,i.__originalTranslate=i.translate,i.__originalTransform=i.transform,i.__originalSetTransform=i.setTransform,i.__originalResetTransform=i.resetTransform,i.__originalClip=i.clip,i.__originalMoveTo=i.moveTo,i.__originalLineTo=i.lineTo,i.__originalBezierCurveTo=i.bezierCurveTo,i.__originalRect=i.rect,i.__originalClosePath=i.closePath,i.__originalBeginPath=i.beginPath,i._removeMirroring=()=>{i.save=i.__originalSave,i.restore=i.__originalRestore,i.rotate=i.__originalRotate,i.scale=i.__originalScale,i.translate=i.__originalTranslate,i.transform=i.__originalTransform,i.setTransform=i.__originalSetTransform,i.resetTransform=i.__originalResetTransform,i.clip=i.__originalClip,i.moveTo=i.__originalMoveTo,i.lineTo=i.__originalLineTo,i.bezierCurveTo=i.__originalBezierCurveTo,i.rect=i.__originalRect,i.closePath=i.__originalClosePath,i.beginPath=i.__originalBeginPath,delete i._removeMirroring},i.save=function(){e.save(),this.__originalSave()},i.restore=function(){e.restore(),this.__originalRestore()},i.translate=function(t,r){e.translate(t,r),this.__originalTranslate(t,r)},i.scale=function(t,r){e.scale(t,r),this.__originalScale(t,r)},i.transform=function(t,r,n,s,a,o){e.transform(t,r,n,s,a,o),this.__originalTransform(t,r,n,s,a,o)},i.setTransform=function(t,r,n,s,a,o){e.setTransform(t,r,n,s,a,o),this.__originalSetTransform(t,r,n,s,a,o)},i.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},i.rotate=function(t){e.rotate(t),this.__originalRotate(t)},i.clip=function(t){e.clip(t),this.__originalClip(t)},i.moveTo=function(t,r){e.moveTo(t,r),this.__originalMoveTo(t,r)},i.lineTo=function(t,r){e.lineTo(t,r),this.__originalLineTo(t,r)},i.bezierCurveTo=function(t,r,n,s,a,o){e.bezierCurveTo(t,r,n,s,a,o),this.__originalBezierCurveTo(t,r,n,s,a,o)},i.rect=function(t,r,n,s){e.rect(t,r,n,s),this.__originalRect(t,r,n,s)},i.closePath=function(){e.closePath(),this.__originalClosePath()},i.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class oC{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,r){let n;return this.cache[e]!==void 0?(n=this.cache[e],this.canvasFactory.reset(n,t,r)):(n=this.canvasFactory.create(t,r),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function np(i,e,t,r,n,s,a,o,l,c){const[h,d,p,g,y,b]=hr(i);if(d===0&&p===0){const A=a*h+y,E=Math.round(A),_=o*g+b,C=Math.round(_),I=(a+l)*h+y,k=Math.abs(Math.round(I)-E)||1,D=(o+c)*g+b,R=Math.abs(Math.round(D)-C)||1;return i.setTransform(Math.sign(h),0,0,Math.sign(g),E,C),i.drawImage(e,t,r,n,s,0,0,k,R),i.setTransform(h,d,p,g,y,b),[k,R]}if(h===0&&g===0){const A=o*p+y,E=Math.round(A),_=a*d+b,C=Math.round(_),I=(o+c)*p+y,k=Math.abs(Math.round(I)-E)||1,D=(a+l)*d+b,R=Math.abs(Math.round(D)-C)||1;return i.setTransform(0,Math.sign(d),Math.sign(p),0,E,C),i.drawImage(e,t,r,n,s,0,0,R,k),i.setTransform(h,d,p,g,y,b),[R,k]}i.drawImage(e,t,r,n,s,a,o,l,c);const w=Math.hypot(h,d),v=Math.hypot(p,g);return[w*l,v*c]}class ay{constructor(e,t){Ie(this,"alphaIsShape",!1);Ie(this,"fontSize",0);Ie(this,"fontSizeScale",1);Ie(this,"textMatrix",null);Ie(this,"textMatrixScale",1);Ie(this,"fontMatrix",n0);Ie(this,"leading",0);Ie(this,"x",0);Ie(this,"y",0);Ie(this,"lineX",0);Ie(this,"lineY",0);Ie(this,"charSpacing",0);Ie(this,"wordSpacing",0);Ie(this,"textHScale",1);Ie(this,"textRenderingMode",on.FILL);Ie(this,"textRise",0);Ie(this,"fillColor","#000000");Ie(this,"strokeColor","#000000");Ie(this,"patternFill",!1);Ie(this,"patternStroke",!1);Ie(this,"fillAlpha",1);Ie(this,"strokeAlpha",1);Ie(this,"lineWidth",1);Ie(this,"activeSMask",null);Ie(this,"transferMaps","none");this.clipBox=new Float32Array([0,0,e,t]),this.minMax=fu.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=tn.FILL,t=null){const r=this.minMax.slice();if(e===tn.STROKE){t||Wt("Stroke bounding box must include transform."),Qe.singularValueDecompose2dScale(t,si);const n=si[0]*this.lineWidth/2,s=si[1]*this.lineWidth/2;r[0]-=n,r[1]-=s,r[2]+=n,r[3]+=s}return r}updateClipFromPath(){const e=Qe.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(fu,0)}getClippedPathBoundingBox(e=tn.FILL,t=null){return Qe.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function oy(i,e){if(e instanceof ImageData){i.putImageData(e,0,0);return}const t=e.height,r=e.width,n=t%Mn,s=(t-n)/Mn,a=n===0?s:s+1,o=i.createImageData(r,Mn);let l=0,c;const h=e.data,d=o.data;let p,g,y,b;if(e.kind===Th.GRAYSCALE_1BPP){const w=h.byteLength,v=new Uint32Array(d.buffer,0,d.byteLength>>2),A=v.length,E=r+7>>3,_=4294967295,C=qr.isLittleEndian?4278190080:255;for(p=0;p<a;p++){for(y=p<s?Mn:n,c=0,g=0;g<y;g++){const I=w-l;let k=0;const D=I>E?r:I*8-7,R=D&-8;let z=0,G=0;for(;k<R;k+=8)G=h[l++],v[c++]=G&128?_:C,v[c++]=G&64?_:C,v[c++]=G&32?_:C,v[c++]=G&16?_:C,v[c++]=G&8?_:C,v[c++]=G&4?_:C,v[c++]=G&2?_:C,v[c++]=G&1?_:C;for(;k<D;k++)z===0&&(G=h[l++],z=128),v[c++]=G&z?_:C,z>>=1}for(;c<A;)v[c++]=0;i.putImageData(o,0,p*Mn)}}else if(e.kind===Th.RGBA_32BPP){for(g=0,b=r*Mn*4,p=0;p<s;p++)d.set(h.subarray(l,l+b)),l+=b,i.putImageData(o,0,g),g+=Mn;p<a&&(b=r*n*4,d.set(h.subarray(l,l+b)),i.putImageData(o,0,g))}else if(e.kind===Th.RGB_24BPP)for(y=Mn,b=r*y,p=0;p<a;p++){for(p>=s&&(y=n,b=r*y),c=0,g=b;g--;)d[c++]=h[l++],d[c++]=h[l++],d[c++]=h[l++],d[c++]=255;i.putImageData(o,0,p*Mn)}else throw new Error(`bad image kind: ${e.kind}`)}function ly(i,e){if(e.bitmap){i.drawImage(e.bitmap,0,0);return}const t=e.height,r=e.width,n=t%Mn,s=(t-n)/Mn,a=n===0?s:s+1,o=i.createImageData(r,Mn);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const p=d<s?Mn:n;({srcPos:l}=iC({src:c,srcPos:l,dest:h,width:r,height:p,nonBlackColor:0})),i.putImageData(o,0,d*Mn)}}function Zc(i,e){const t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of t)i[r]!==void 0&&(e[r]=i[r]);i.setLineDash!==void 0&&(e.setLineDash(i.getLineDash()),e.lineDashOffset=i.lineDashOffset)}function ip(i){i.strokeStyle=i.fillStyle="#000000",i.fillRule="nonzero",i.globalAlpha=1,i.lineWidth=1,i.lineCap="butt",i.lineJoin="miter",i.miterLimit=10,i.globalCompositeOperation="source-over",i.font="10px sans-serif",i.setLineDash!==void 0&&(i.setLineDash([]),i.lineDashOffset=0);const{filter:e}=i;e!=="none"&&e!==""&&(i.filter="none")}function uy(i,e){if(e)return!0;Qe.singularValueDecompose2dScale(i,si);const t=Math.fround(Wi.pixelRatio*da.PDF_TO_CSS_UNITS);return si[0]<=t&&si[1]<=t}const lC=["butt","round","square"],uC=["miter","round","bevel"],cC={},cy={};var Yi,T0,k0,D0;const vv=class vv{constructor(e,t,r,n,s,{optionalContentConfig:a,markedContentStack:o=null},l,c){N(this,Yi);this.ctx=e,this.current=new ay(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=r,this.canvasFactory=n,this.filterFactory=s,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new oC(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:r=!1,background:n=null}){const s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,r){const l=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...hr(this.compositeCtx))}this.ctx.save(),ip(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=hr(this.ctx)}executeOperatorList(e,t,r,n){const s=e.argsArray,a=e.fnArray;let o=t||0;const l=s.length;if(l===o)return o;const c=l-o>sy&&typeof r=="function",h=c?Date.now()+sC:0;let d=0;const p=this.commonObjs,g=this.objs;let y;for(;;){if(n!==void 0&&o===n.nextBreakPoint)return n.breakIt(o,r),o;if(y=a[o],y!==Ph.dependency)this[y].apply(this,s[o]);else for(const b of s[o]){const w=b.startsWith("g_")?p:g;if(!w.has(b))return w.get(b,r),o}if(o++,o===l)return o;if(c&&++d>sy){if(Date.now()>h)return r(),o;d=0}}}endDrawing(){L(this,Yi,T0).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),L(this,Yi,k0).call(this)}_scaleImage(e,t){const r=e.width??e.displayWidth,n=e.height??e.displayHeight;let s=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=r,l=n,c="prescale1",h,d;for(;s>2&&o>1||a>2&&l>1;){let p=o,g=l;s>2&&o>1&&(p=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/p),a>2&&l>1&&(g=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/g),h=this.cachedCanvases.getCanvas(c,p,g),d=h.context,d.clearRect(0,0,p,g),d.drawImage(e,0,0,o,l,0,0,p,g),e=h.canvas,o=p,l=g,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e){const t=this.ctx,{width:r,height:n}=e,s=this.current.fillColor,a=this.current.patternFill,o=hr(t);let l,c,h,d;if((e.bitmap||e.data)&&e.count>1){const R=e.bitmap||e.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),s]),l=this._cachedBitmapsMap.get(R),l||(l=new Map,this._cachedBitmapsMap.set(R,l));const z=l.get(c);if(z&&!a){const G=Math.round(Math.min(o[0],o[2])+o[4]),O=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:z,offsetX:G,offsetY:O}}h=z}h||(d=this.cachedCanvases.getCanvas("maskCanvas",r,n),ly(d.context,e));let p=Qe.transform(o,[1/r,0,0,-1/n,0,0]);p=Qe.transform(p,[1,0,0,1,0,-n]);const g=fu.slice();Qe.axialAlignedBoundingBox([0,0,r,n],p,g);const[y,b,w,v]=g,A=Math.round(w-y)||1,E=Math.round(v-b)||1,_=this.cachedCanvases.getCanvas("fillCanvas",A,E),C=_.context,I=y,k=b;C.translate(-I,-k),C.transform(...p),h||(h=this._scaleImage(d.canvas,Ki(C)),h=h.img,l&&a&&l.set(c,h)),C.imageSmoothingEnabled=uy(hr(C),e.interpolate),np(C,h,0,0,h.width,h.height,0,0,r,n),C.globalCompositeOperation="source-in";const D=Qe.transform(Ki(C),[1,0,0,1,-I,-k]);return C.fillStyle=a?s.getPattern(t,this,D,tn.FILL):s,C.fillRect(0,0,r,n),l&&!a&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,_.canvas)),{canvas:_.canvas,offsetX:Math.round(I),offsetY:Math.round(k)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=lC[e]}setLineJoin(e){this.ctx.lineJoin=uC[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,r]of e)switch(t){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(r,e,t);this.suspendedCtx=this.ctx;const s=this.ctx=n.context;s.setTransform(this.suspendedCtx.getTransform()),Zc(this.suspendedCtx,s),aC(s,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Zc(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,r,n){const s=n[0],a=n[1],o=n[2]-s,l=n[3]-a;o===0||l===0||(this.genericComposeSMask(t.context,r,o,l,t.subtype,t.backdrop,t.transferMap,s,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,t,r,n,s,a,o,l,c,h,d){let p=e.canvas,g=l-h,y=c-d;if(a)if(g<0||y<0||g+r>p.width||y+n>p.height){const w=this.cachedCanvases.getCanvas("maskExtension",r,n),v=w.context;v.drawImage(p,-g,-y),v.globalCompositeOperation="destination-atop",v.fillStyle=a,v.fillRect(0,0,r,n),v.globalCompositeOperation="source-over",p=w.canvas,g=y=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(g,y,r,n),e.clip(w),e.globalCompositeOperation="destination-atop",e.fillStyle=a,e.fillRect(g,y,r,n),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),s==="Alpha"&&o?t.filter=this.filterFactory.addAlphaFilter(o):s==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(o));const b=new Path2D;b.rect(l,c,r,n),t.clip(b),t.globalCompositeOperation="destination-in",t.drawImage(p,g,y,r,n,l,c,r,n),t.restore()}save(){this.inSMaskMode&&Zc(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){if(this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Zc(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,r,n,s,a){this.ctx.transform(e,t,r,n,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,r){let[n]=t;if(!r){n||(n=t[0]=new Path2D),this[e](n);return}if(!(n instanceof Path2D)){const s=t[0]=new Path2D;for(let a=0,o=n.length;a<o;)switch(n[a++]){case ep.moveTo:s.moveTo(n[a++],n[a++]);break;case ep.lineTo:s.lineTo(n[a++],n[a++]);break;case ep.curveTo:s.bezierCurveTo(n[a++],n[a++],n[a++],n[a++],n[a++],n[a++]);break;case ep.closePath:s.closePath();break;default:ut(`Unrecognized drawing path operator: ${n[a-1]}`);break}n=s}Qe.axialAlignedBoundingBox(r,hr(this.ctx),this.current.minMax),this[e](n)}closePath(){this.ctx.closePath()}stroke(e,t=!0){const r=this.ctx,n=this.current.strokeColor;if(r.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof n=="object"&&(n!=null&&n.getPattern)){const s=n.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.strokeStyle=n.getPattern(r,this,Ki(r),tn.STROKE),s){const a=new Path2D;a.addPath(e,r.getTransform().invertSelf().multiplySelf(s)),e=a}this.rescaleAndStroke(e,!1),r.restore()}else this.rescaleAndStroke(e,!0);t&&this.consumePath(e,this.current.getClippedPathBoundingBox(tn.STROKE,hr(this.ctx))),r.globalAlpha=this.current.fillAlpha}closeStroke(e){this.stroke(e)}fill(e,t=!0){const r=this.ctx,n=this.current.fillColor,s=this.current.patternFill;let a=!1;if(s){const l=n.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.fillStyle=n.getPattern(r,this,Ki(r),tn.FILL),l){const c=new Path2D;c.addPath(e,r.getTransform().invertSelf().multiplySelf(l)),e=c}a=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(r.fill(e,"evenodd"),this.pendingEOFill=!1):r.fill(e)),a&&r.restore(),t&&this.consumePath(e,o)}eoFill(e){this.pendingEOFill=!0,this.fill(e)}fillStroke(e){this.fill(e,!1),this.stroke(e,!1),this.consumePath(e)}eoFillStroke(e){this.pendingEOFill=!0,this.fillStroke(e)}closeFillStroke(e){this.fillStroke(e)}closeEOFillStroke(e){this.pendingEOFill=!0,this.fillStroke(e)}endPath(e){this.consumePath(e)}rawFillPath(e){this.ctx.fill(e)}clip(){this.pendingClip=cC}eoClip(){this.pendingClip=cy}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(e===void 0)return;const r=new Path2D,n=t.getTransform().invertSelf();for(const{transform:s,x:a,y:o,fontSize:l,path:c}of e)r.addPath(c,new DOMMatrix(s).preMultiplySelf(n).translate(a,o).scale(l,-l));t.clip(r),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){var h;const r=this.commonObjs.get(e),n=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=r.fontMatrix||n0,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&ut("Invalid font matrix for font "+e),t<0?(t=-t,n.fontDirection=-1):n.fontDirection=1,this.current.font=r,this.current.fontSize=t,r.isType3Font)return;const s=r.loadedName||"sans-serif",a=((h=r.systemFontInfo)==null?void 0:h.css)||`"${s}", ${r.fallbackName}`;let o="normal";r.black?o="900":r.bold&&(o="bold");const l=r.italic?"italic":"normal";let c=t;t<ny?c=ny:t>iy&&(c=iy),this.current.fontSizeScale=t/c,this.ctx.font=`${l} ${o} ${c}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e){const{current:t}=this;t.textMatrix=e,t.textMatrixScale=Math.hypot(e[0],e[1]),t.x=t.lineX=0,t.y=t.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,r,n,s){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&on.FILL_STROKE_MASK,p=!!(c&on.ADD_TO_PATH_FLAG),g=o.patternFill&&!l.missingFile,y=o.patternStroke&&!l.missingFile;let b;if((l.disableFontFace||p||g||y)&&(b=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||g||y){a.save(),a.translate(t,r),a.scale(h,-h);let w;if((d===on.FILL||d===on.FILL_STROKE)&&(n?(w=a.getTransform(),a.setTransform(...n),a.fill(L(this,Yi,D0).call(this,b,w,n))):a.fill(b)),d===on.STROKE||d===on.FILL_STROKE)if(s){w||(w=a.getTransform()),a.setTransform(...s);const{a:v,b:A,c:E,d:_}=w,C=Qe.inverseTransform(s),I=Qe.transform([v,A,E,_,0,0],C);Qe.singularValueDecompose2dScale(I,si),a.lineWidth*=Math.max(si[0],si[1])/h,a.stroke(L(this,Yi,D0).call(this,b,w,s))}else a.lineWidth/=h,a.stroke(b);a.restore()}else(d===on.FILL||d===on.FILL_STROKE)&&a.fillText(e,t,r),(d===on.STROKE||d===on.FILL_STROKE)&&a.strokeText(e,t,r);p&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:hr(a),x:t,y:r,fontSize:h,path:b})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let r=!1;for(let n=3;n<t.length;n+=4)if(t[n]>0&&t[n]<255){r=!0;break}return Ct(this,"isFontSubpixelAAEnabled",r)}showText(e){const t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);const n=t.fontSize;if(n===0)return;const s=this.ctx,a=t.fontSizeScale,o=t.charSpacing,l=t.wordSpacing,c=t.fontDirection,h=t.textHScale*c,d=e.length,p=r.vertical,g=p?1:-1,y=r.defaultVMetrics,b=n*t.fontMatrix[0],w=t.textRenderingMode===on.FILL&&!r.disableFontFace&&!t.patternFill;s.save(),t.textMatrix&&s.transform(...t.textMatrix),s.translate(t.x,t.y+t.textRise),c>0?s.scale(h,-1):s.scale(h,1);let v,A;if(t.patternFill){s.save();const k=t.fillColor.getPattern(s,this,Ki(s),tn.FILL);v=hr(s),s.restore(),s.fillStyle=k}if(t.patternStroke){s.save();const k=t.strokeColor.getPattern(s,this,Ki(s),tn.STROKE);A=hr(s),s.restore(),s.strokeStyle=k}let E=t.lineWidth;const _=t.textMatrixScale;if(_===0||E===0){const k=t.textRenderingMode&on.FILL_STROKE_MASK;(k===on.STROKE||k===on.FILL_STROKE)&&(E=this.getSinglePixelWidth())}else E/=_;if(a!==1&&(s.scale(a,a),E/=a),s.lineWidth=E,r.isInvalidPDFjsFont){const k=[];let D=0;for(const R of e)k.push(R.unicode),D+=R.width;s.fillText(k.join(""),0,0),t.x+=D*b*h,s.restore(),this.compose();return}let C=0,I;for(I=0;I<d;++I){const k=e[I];if(typeof k=="number"){C+=g*k*n/1e3;continue}let D=!1;const R=(k.isSpace?l:0)+o,z=k.fontChar,G=k.accent;let O,X,S=k.width;if(p){const Y=k.vmetric||y,W=-(k.vmetric?Y[1]:S*.5)*b,fe=Y[2]*b;S=Y?-Y[0]:S,O=W/a,X=(C+fe)/a}else O=C/a,X=0;if(r.remeasure&&S>0){const Y=s.measureText(z).width*1e3/n*a;if(S<Y&&this.isFontSubpixelAAEnabled){const W=S/Y;D=!0,s.save(),s.scale(W,1),O/=W}else S!==Y&&(O+=(S-Y)/2e3*n/a)}if(this.contentVisible&&(k.isInFont||r.missingFile)){if(w&&!G)s.fillText(z,O,X);else if(this.paintChar(z,O,X,v,A),G){const Y=O+n*G.offset.x/a,W=X-n*G.offset.y/a;this.paintChar(G.fontChar,Y,W,v,A)}}const J=p?S*b-R*c:S*b+R*c;C+=J,D&&s.restore()}p?t.y-=C:t.x+=C*h,s.restore(),this.compose()}showType3Text(e){const t=this.ctx,r=this.current,n=r.font,s=r.fontSize,a=r.fontDirection,o=n.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,h=r.textHScale*a,d=r.fontMatrix||n0,p=e.length,g=r.textRenderingMode===on.INVISIBLE;let y,b,w,v;if(!(g||s===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),r.textMatrix&&t.transform(...r.textMatrix),t.translate(r.x,r.y+r.textRise),t.scale(h,a),y=0;y<p;++y){if(b=e[y],typeof b=="number"){v=o*b*s/1e3,this.ctx.translate(v,0),r.x+=v*h;continue}const A=(b.isSpace?c:0)+l,E=n.charProcOperatorList[b.operatorListId];E?this.contentVisible&&(this.save(),t.scale(s,s),t.transform(...d),this.executeOperatorList(E),this.restore()):ut(`Type3 character "${b.operatorListId}" is not available.`);const _=[b.width,0];Qe.applyTransform(_,d),w=_[0]*s+A,t.translate(w,0),r.x+=w*h}t.restore()}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,r,n,s,a){const o=new Path2D;o.rect(r,n,s-r,a-n),this.ctx.clip(o),this.endPath()}getColorN_Pattern(e){let t;if(e[0]==="TilingPattern"){const r=this.baseTransform||hr(this.ctx),n={createCanvasGraphics:s=>new vv(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new S0(e,this.ctx,n,r)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e){this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e){this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=nC(this.getObject(e)),this.cachedPatterns.set(e,r)),t&&(r.matrix=t),r}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const r=this._getPattern(e);t.fillStyle=r.getPattern(t,this,Ki(t),tn.SHADING);const n=Ki(t);if(n){const{width:s,height:a}=t.canvas,o=fu.slice();Qe.axialAlignedBoundingBox([0,0,s,a],n,o);const[l,c,h,d]=o;this.ctx.fillRect(l,c,h-l,d-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Wt("Should not call beginInlineImage")}beginImageData(){Wt("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=hr(this.ctx),t)){Qe.axialAlignedBoundingBox(t,this.baseTransform,this.current.minMax);const[r,n,s,a]=t,o=new Path2D;o.rect(r,n,s-r,a-n),this.ctx.clip(o),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||Sg("TODO: Support non-isolated groups."),e.knockout&&ut("Knockout groups not supported.");const r=hr(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let n=fu.slice();Qe.axialAlignedBoundingBox(e.bbox,hr(t),n);const s=[0,0,t.canvas.width,t.canvas.height];n=Qe.intersect(n,s)||[0,0,0,0];const a=Math.floor(n[0]),o=Math.floor(n[1]),l=Math.max(Math.ceil(n[2])-a,1),c=Math.max(Math.ceil(n[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let h="groupAt"+this.groupLevel;e.smask&&(h+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(h,l,c),p=d.context;p.translate(-a,-o),p.transform(...r);let g=new Path2D;const[y,b,w,v]=e.bbox;if(g.rect(y,b,w-y,v-b),e.matrix){const A=new Path2D;A.addPath(g,new DOMMatrix(e.matrix)),g=A}p.clip(g),e.smask?this.smaskStack.push({canvas:d.canvas,context:p,offsetX:a,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,o),t.save()),Zc(t,p),this.ctx=p,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const n=hr(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...n);const s=fu.slice();Qe.axialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],n,s),this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,r,n,s){if(L(this,Yi,T0).call(this),ip(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){const a=t[2]-t[0],o=t[3]-t[1];if(s&&this.annotationCanvasMap){r=r.slice(),r[4]-=t[0],r[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=a,t[3]=o,Qe.singularValueDecompose2dScale(hr(this.ctx),si);const{viewportScale:l}=this,c=Math.ceil(a*this.outputScaleX*l),h=Math.ceil(o*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,h);const{canvas:d,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(si[0],0,0,-si[1],0,o*si[1]),ip(this.ctx)}else{ip(this.ctx),this.endPath();const l=new Path2D;l.rect(t[0],t[1],a,o),this.ctx.clip(l)}}this.current=new ay(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),L(this,Yi,k0).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;e=this.getObject(e.data,e),e.count=t;const r=this.ctx,n=this._createMaskCanvas(e),s=n.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(s,n.offsetX,n.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,r=0,n=0,s,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const o=this.ctx;o.save();const l=hr(o);o.transform(t,r,n,s,0,0);const c=this._createMaskCanvas(e);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let h=0,d=a.length;h<d;h+=2){const p=Qe.transform(l,[t,r,n,s,a[h],a[h+1]]);o.drawImage(c.canvas,p[4],p[5])}o.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,r=this.current.fillColor,n=this.current.patternFill;for(const s of e){const{data:a,width:o,height:l,transform:c}=s,h=this.cachedCanvases.getCanvas("maskCanvas",o,l),d=h.context;d.save();const p=this.getObject(a,s);ly(d,p),d.globalCompositeOperation="source-in",d.fillStyle=n?r.getPattern(d,this,Ki(t),tn.FILL):r,d.fillRect(0,0,o,l),d.restore(),t.save(),t.transform(...c),t.scale(1,-1),np(t,h.canvas,0,0,o,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);if(!t){ut("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t)}paintImageXObjectRepeat(e,t,r,n){if(!this.contentVisible)return;const s=this.getObject(e);if(!s){ut("Dependent image isn't ready yet");return}const a=s.width,o=s.height,l=[];for(let c=0,h=n.length;c<h;c+=2)l.push({transform:[t,0,0,r,n[c],n[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:t,width:r,height:n}=e,s=this.cachedCanvases.getCanvas("inlineImage",r,n),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter="none",s.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,r=e.height,n=this.ctx;this.save();const{filter:s}=n;s!=="none"&&s!==""&&(n.filter="none"),n.scale(1/t,-1/r);let a;if(e.bitmap)a=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)a=e;else{const c=this.cachedCanvases.getCanvas("inlineImage",t,r).context;oy(c,e),a=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(a,Ki(n));n.imageSmoothingEnabled=uy(hr(n),e.interpolate),np(n,o.img,0,0,o.paintWidth,o.paintHeight,0,-r,t,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const r=this.ctx;let n;if(e.bitmap)n=e.bitmap;else{const s=e.width,a=e.height,l=this.cachedCanvases.getCanvas("inlineImage",s,a).context;oy(l,e),n=this.applyTransferMapsToCanvas(l)}for(const s of t)r.save(),r.transform(...s.transform),r.scale(1,-1),np(r,n,s.x,s.y,s.w,s.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e,t){const r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const n=this.ctx;this.pendingClip&&(r||(this.pendingClip===cy?n.clip(e,"evenodd"):n.clip(e)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=hr(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:t,b:r,c:n,d:s}=this.ctx.getTransform();let a,o;if(r===0&&n===0){const l=Math.abs(t),c=Math.abs(s);if(l===c)if(e===0)a=o=1/l;else{const h=l*e;a=o=h<1?1/h:1}else if(e===0)a=1/l,o=1/c;else{const h=l*e,d=c*e;a=h<1?1/h:1,o=d<1?1/d:1}}else{const l=Math.abs(t*s-r*n),c=Math.hypot(t,r),h=Math.hypot(n,s);if(e===0)a=h/l,o=c/l;else{const d=e*l;a=h>d?h/d:1,o=c>d?c/d:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:r,current:{lineWidth:n}}=this,[s,a]=this.getScaleForStroking();if(s===a){r.lineWidth=(n||1)*s,r.stroke(e);return}const o=r.getLineDash();t&&r.save(),r.scale(s,a),mm.a=1/s,mm.d=1/a;const l=new Path2D;if(l.addPath(e,mm),o.length>0){const c=Math.max(s,a);r.setLineDash(o.map(h=>h/c)),r.lineDashOffset/=c}r.lineWidth=n||1,r.stroke(l),t&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};Yi=new WeakSet,T0=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},k0=function(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}},D0=function(e,t,r){const n=new Path2D;return n.addPath(e,new DOMMatrix(r).invertSelf().multiplySelf(t)),n};let bu=vv;for(const i in Ph)bu.prototype[i]!==void 0&&(bu.prototype[Ph[i]]=bu.prototype[i]);var Ed,_d;class yi{static get workerPort(){return u(this,Ed)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");T(this,Ed,e)}static get workerSrc(){return u(this,_d)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");T(this,_d,e)}}Ed=new WeakMap,_d=new WeakMap,N(yi,Ed,null),N(yi,_d,"");var zu,Cd;class hC{constructor({parsedData:e,rawData:t}){N(this,zu);N(this,Cd);T(this,zu,e),T(this,Cd,t)}getRaw(){return u(this,Cd)}get(e){return u(this,zu).get(e)??null}[Symbol.iterator](){return u(this,zu).entries()}}zu=new WeakMap,Cd=new WeakMap;const uu=Symbol("INTERNAL");var Sd,Td,kd,ju;class dC{constructor(e,{name:t,intent:r,usage:n,rbGroups:s}){N(this,Sd,!1);N(this,Td,!1);N(this,kd,!1);N(this,ju,!0);T(this,Sd,!!(e&ii.DISPLAY)),T(this,Td,!!(e&ii.PRINT)),this.name=t,this.intent=r,this.usage=n,this.rbGroups=s}get visible(){if(u(this,kd))return u(this,ju);if(!u(this,ju))return!1;const{print:e,view:t}=this.usage;return u(this,Sd)?(t==null?void 0:t.viewState)!=="OFF":u(this,Td)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,t,r=!1){e!==uu&&Wt("Internal method `_setVisible` called."),T(this,kd,r),T(this,ju,t)}}Sd=new WeakMap,Td=new WeakMap,kd=new WeakMap,ju=new WeakMap;var Oa,Gt,Uu,Hu,Dd,P0;class fC{constructor(e,t=ii.DISPLAY){N(this,Dd);N(this,Oa,null);N(this,Gt,new Map);N(this,Uu,null);N(this,Hu,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,T(this,Hu,e.order);for(const r of e.groups)u(this,Gt).set(r.id,new dC(t,r));if(e.baseState==="OFF")for(const r of u(this,Gt).values())r._setVisible(uu,!1);for(const r of e.on)u(this,Gt).get(r)._setVisible(uu,!0);for(const r of e.off)u(this,Gt).get(r)._setVisible(uu,!1);T(this,Uu,this.getHash())}}isVisible(e){if(u(this,Gt).size===0)return!0;if(!e)return Sg("Optional content group not defined."),!0;if(e.type==="OCG")return u(this,Gt).has(e.id)?u(this,Gt).get(e.id).visible:(ut(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return L(this,Dd,P0).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const t of e.ids){if(!u(this,Gt).has(t))return ut(`Optional content group not found: ${t}`),!0;if(u(this,Gt).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const t of e.ids){if(!u(this,Gt).has(t))return ut(`Optional content group not found: ${t}`),!0;if(!u(this,Gt).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const t of e.ids){if(!u(this,Gt).has(t))return ut(`Optional content group not found: ${t}`),!0;if(!u(this,Gt).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const t of e.ids){if(!u(this,Gt).has(t))return ut(`Optional content group not found: ${t}`),!0;if(u(this,Gt).get(t).visible)return!1}return!0}return ut(`Unknown optional content policy ${e.policy}.`),!0}return ut(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,r=!0){var s;const n=u(this,Gt).get(e);if(!n){ut(`Optional content group not found: ${e}`);return}if(r&&t&&n.rbGroups.length)for(const a of n.rbGroups)for(const o of a)o!==e&&((s=u(this,Gt).get(o))==null||s._setVisible(uu,!1,!0));n._setVisible(uu,!!t,!0),T(this,Oa,null)}setOCGState({state:e,preserveRB:t}){let r;for(const n of e){switch(n){case"ON":case"OFF":case"Toggle":r=n;continue}const s=u(this,Gt).get(n);if(s)switch(r){case"ON":this.setVisibility(n,!0,t);break;case"OFF":this.setVisibility(n,!1,t);break;case"Toggle":this.setVisibility(n,!s.visible,t);break}}T(this,Oa,null)}get hasInitialVisibility(){return u(this,Uu)===null||this.getHash()===u(this,Uu)}getOrder(){return u(this,Gt).size?u(this,Hu)?u(this,Hu).slice():[...u(this,Gt).keys()]:null}getGroup(e){return u(this,Gt).get(e)||null}getHash(){if(u(this,Oa)!==null)return u(this,Oa);const e=new B1;for(const[t,r]of u(this,Gt))e.update(`${t}:${r.visible}`);return T(this,Oa,e.hexdigest())}[Symbol.iterator](){return u(this,Gt).entries()}}Oa=new WeakMap,Gt=new WeakMap,Uu=new WeakMap,Hu=new WeakMap,Dd=new WeakSet,P0=function(e){const t=e.length;if(t<2)return!0;const r=e[0];for(let n=1;n<t;n++){const s=e[n];let a;if(Array.isArray(s))a=L(this,Dd,P0).call(this,s);else if(u(this,Gt).has(s))a=u(this,Gt).get(s).visible;else return ut(`Optional content group not found: ${s}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"};class pC{constructor(e,{disableRange:t=!1,disableStream:r=!1}){Dr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:s,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(s==null?void 0:s.length)>0){const l=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!t,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const r=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const n=this._rangeReaders.some(function(s){return s._begin!==e?!1:(s._enqueue(r),!0)});Dr(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var t,r,n,s;e.total===void 0?(r=(t=this._rangeReaders[0])==null?void 0:t.onProgress)==null||r.call(t,{loaded:e.loaded}):(s=(n=this._fullRequestReader)==null?void 0:n.onProgress)==null||s.call(n,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Dr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new gC(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new mC(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class gC{constructor(e,t,r=!1,n=null){this._stream=e,this._done=r||!1,this._filename=kg(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class mC{constructor(e,t,r){this._stream=e,this._begin=t,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function bC(i){let e=!0,t=r("filename\\*","i").exec(i);if(t){t=t[1];let h=o(t);return h=unescape(h),h=l(h),h=c(h),s(h)}if(t=a(i),t){const h=c(t);return s(h)}if(t=r("filename","i").exec(i),t){t=t[1];let h=o(t);return h=c(h),s(h)}function r(h,d){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function n(h,d){if(h){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const p=new TextDecoder(h,{fatal:!0}),g=Sf(d);d=p.decode(g),e=!1}catch{}}return d}function s(h){return e&&/[\x80-\xff]/.test(h)&&(h=n("utf-8",h),e&&(h=n("iso-8859-1",h))),h}function a(h){const d=[];let p;const g=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=g.exec(h))!==null;){let[,b,w,v]=p;if(b=parseInt(b,10),b in d){if(b===0)break;continue}d[b]=[w,v]}const y=[];for(let b=0;b<d.length&&b in d;++b){let[w,v]=d[b];v=o(v),w&&(v=unescape(v),b===0&&(v=l(v))),y.push(v)}return y.join("")}function o(h){if(h.startsWith('"')){const d=h.slice(1).split('\\"');for(let p=0;p<d.length;++p){const g=d[p].indexOf('"');g!==-1&&(d[p]=d[p].slice(0,g),d.length=p+1),d[p]=d[p].replaceAll(/\\(.)/g,"$1")}h=d.join('"')}return h}function l(h){const d=h.indexOf("'");if(d===-1)return h;const p=h.slice(0,d),y=h.slice(d+1).replace(/^[^']*'/,"");return n(p,y)}function c(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,p,g,y){if(g==="q"||g==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(b,w){return String.fromCharCode(parseInt(w,16))}),n(p,y);try{y=atob(y)}catch{}return n(p,y)})}return""}function K1(i,e){const t=new Headers;if(!i||!e||typeof e!="object")return t;for(const r in e){const n=e[r];n!==void 0&&t.append(r,n)}return t}function Pg(i){var e;return((e=URL.parse(i))==null?void 0:e.origin)??null}function Q1({responseHeaders:i,isHttp:e,rangeChunkSize:t,disableRange:r}){const n={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(i.get("Content-Length"),10);return!Number.isInteger(s)||(n.suggestedLength=s,s<=2*t)||r||!e||i.get("Accept-Ranges")!=="bytes"||(i.get("Content-Encoding")||"identity")!=="identity"||(n.allowRangeRequests=!0),n}function J1(i){const e=i.get("Content-Disposition");if(e){let t=bC(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(kg(t))return t}return null}function Pf(i,e){return new Rh(`Unexpected server response (${i}) while retrieving PDF "${e}".`,i,i===404||i===0&&e.startsWith("file:"))}function ew(i){return i===200||i===206}function tw(i,e,t){return{method:"GET",headers:i,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function rw(i){return i instanceof Uint8Array?i.buffer:i instanceof ArrayBuffer?i:(ut(`getArrayBuffer - unexpected data format: ${i}`),new Uint8Array(i).buffer)}class vC{constructor(e){Ie(this,"_responseOrigin",null);this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=K1(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Dr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new yC(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new wC(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class yC{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const r=new Headers(e.headers),n=t.url;fetch(n,tw(r,this._withCredentials,this._abortController)).then(s=>{if(e._responseOrigin=Pg(s.url),!ew(s.status))throw Pf(s.status,n);this._reader=s.body.getReader(),this._headersCapability.resolve();const a=s.headers,{allowRangeRequests:o,suggestedLength:l}=Q1({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=J1(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ha("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:rw(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}class wC{constructor(e,t,r){this._stream=e,this._reader=null,this._loaded=0;const n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const s=new Headers(e.headers);s.append("Range",`bytes=${t}-${r-1}`);const a=n.url;fetch(a,tw(s,this._withCredentials,this._abortController)).then(o=>{const l=Pg(o.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!ew(o.status))throw Pf(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:rw(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}const bm=200,vm=206;function xC(i){const e=i.response;return typeof e!="string"?e:Sf(e).buffer}class AC{constructor({url:e,httpHeaders:t,withCredentials:r}){Ie(this,"_responseOrigin",null);this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=K1(this.isHttp,t),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const t=new XMLHttpRequest,r=this.currXhrId++,n=this.pendingRequests[r]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[s,a]of this.headers)t.setRequestHeader(s,a);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=vm):n.expectedStatus=bm,t.responseType="arraybuffer",Dr(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,r),t.onprogress=this.onProgress.bind(this,r),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),r}onProgress(e,t){var n;const r=this.pendingRequests[e];r&&((n=r.onProgress)==null||n.call(r,t))}onStateChange(e,t){const r=this.pendingRequests[e];if(!r)return;const n=r.xhr;if(n.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),n.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],n.status===0&&this.isHttp){r.onError(n.status);return}const s=n.status||bm;if(!(s===bm&&r.expectedStatus===vm)&&s!==r.expectedStatus){r.onError(n.status);return}const o=xC(n);if(s===vm){const l=n.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?r.onDone({begin:parseInt(c[1],10),chunk:o}):(ut('Missing or invalid "Content-Range" header.'),r.onError(0))}else o?r.onDone({begin:0,chunk:o}):r.onError(n.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class EC{constructor(e){this._source=e,this._manager=new AC(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Dr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new _C(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new CC(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class _C{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=Pg(t.responseURL);const r=t.getAllResponseHeaders(),n=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:a}=Q1({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=J1(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Pf(e,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;(t=this.onProgress)==null||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class CC{constructor(e,t,r){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var t;const e=Pg((t=this._manager.getRequestXhr(this._requestId))==null?void 0:t.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??(this._storedError=Pf(e,this._url));for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||(t=this.onProgress)==null||t.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const SC=/^[a-z][a-z0-9\-+.]+:/i;function TC(i){if(SC.test(i))return new URL(i);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(i))}class kC{constructor(e){this.source=e,this.url=TC(e.url),Dr(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Dr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new DC(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new PC(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class DC{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(n=>{this._contentLength=n.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},n=>{n.code==="ENOENT"&&(n=Pf(0,this._url.href)),this._storedError=n,this._headersCapability.reject(n)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ha("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class PC{constructor(e,t,r){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=e.source;this._isStreamingSupported=!n.disableStream;const s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:t,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Kc=Symbol("INITIAL_DATA");var Wn,Pd,R0;class nw{constructor(){N(this,Pd);N(this,Wn,Object.create(null))}get(e,t=null){if(t){const n=L(this,Pd,R0).call(this,e);return n.promise.then(()=>t(n.data)),null}const r=u(this,Wn)[e];if(!r||r.data===Kc)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const t=u(this,Wn)[e];return!!t&&t.data!==Kc}delete(e){const t=u(this,Wn)[e];return!t||t.data===Kc?!1:(delete u(this,Wn)[e],!0)}resolve(e,t=null){const r=L(this,Pd,R0).call(this,e);r.data=t,r.resolve()}clear(){var e;for(const t in u(this,Wn)){const{data:r}=u(this,Wn)[t];(e=r==null?void 0:r.bitmap)==null||e.close()}T(this,Wn,Object.create(null))}*[Symbol.iterator](){for(const e in u(this,Wn)){const{data:t}=u(this,Wn)[e];t!==Kc&&(yield[e,t])}}}Wn=new WeakMap,Pd=new WeakSet,R0=function(e){var t;return(t=u(this,Wn))[e]||(t[e]={...Promise.withResolvers(),data:Kc})};const RC=1e5,hy=30;var L2,Fa,In,Rd,Id,el,Vs,Nd,Md,tl,$u,Vu,Ba,Gu,Ld,qu,rl,Od,Fd,mr,Wu,nl,Bd,za,Xu,fa,iw,sw,I0,oi,_p,N0,aw,ow;let Nh=(mr=class{constructor({textContentSource:e,container:t,viewport:r}){N(this,fa);N(this,Fa,Promise.withResolvers());N(this,In,null);N(this,Rd,!1);N(this,Id,!!((L2=globalThis.FontInspector)!=null&&L2.enabled));N(this,el,null);N(this,Vs,null);N(this,Nd,0);N(this,Md,0);N(this,tl,null);N(this,$u,null);N(this,Vu,0);N(this,Ba,0);N(this,Gu,Object.create(null));N(this,Ld,[]);N(this,qu,null);N(this,rl,[]);N(this,Od,new WeakMap);N(this,Fd,null);var l;if(e instanceof ReadableStream)T(this,qu,e);else if(typeof e=="object")T(this,qu,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');T(this,In,T(this,$u,t)),T(this,Ba,r.scale*Wi.pixelRatio),T(this,Vu,r.rotation),T(this,Vs,{div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:s,pageX:a,pageY:o}=r.rawDims;T(this,Fd,[1,0,0,-1,-a,o+s]),T(this,Md,n),T(this,Nd,s),L(l=mr,oi,aw).call(l),ao(t,r),u(this,Fa).promise.finally(()=>{u(mr,Xu).delete(this),T(this,Vs,null),T(this,Gu,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=qr.platform;return Ct(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{u(this,tl).read().then(({value:t,done:r})=>{if(r){u(this,Fa).resolve();return}u(this,el)??T(this,el,t.lang),Object.assign(u(this,Gu),t.styles),L(this,fa,iw).call(this,t.items),e()},u(this,Fa).reject)};return T(this,tl,u(this,qu).getReader()),u(mr,Xu).add(this),e(),u(this,Fa).promise}update({viewport:e,onBefore:t=null}){var s;const r=e.scale*Wi.pixelRatio,n=e.rotation;if(n!==u(this,Vu)&&(t==null||t(),T(this,Vu,n),ao(u(this,$u),{rotation:n})),r!==u(this,Ba)){t==null||t(),T(this,Ba,r);const a={div:null,properties:null,ctx:L(s=mr,oi,_p).call(s,u(this,el))};for(const o of u(this,rl))a.properties=u(this,Od).get(o),a.div=o,L(this,fa,I0).call(this,a)}}cancel(){var t;const e=new ha("TextLayer task cancelled.");(t=u(this,tl))==null||t.cancel(e).catch(()=>{}),T(this,tl,null),u(this,Fa).reject(e)}get textDivs(){return u(this,rl)}get textContentItemsStr(){return u(this,Ld)}static cleanup(){if(!(u(this,Xu).size>0)){u(this,Wu).clear();for(const{canvas:e}of u(this,nl).values())e.remove();u(this,nl).clear()}}},Fa=new WeakMap,In=new WeakMap,Rd=new WeakMap,Id=new WeakMap,el=new WeakMap,Vs=new WeakMap,Nd=new WeakMap,Md=new WeakMap,tl=new WeakMap,$u=new WeakMap,Vu=new WeakMap,Ba=new WeakMap,Gu=new WeakMap,Ld=new WeakMap,qu=new WeakMap,rl=new WeakMap,Od=new WeakMap,Fd=new WeakMap,Wu=new WeakMap,nl=new WeakMap,Bd=new WeakMap,za=new WeakMap,Xu=new WeakMap,fa=new WeakSet,iw=function(e){var n,s;if(u(this,Rd))return;(s=u(this,Vs)).ctx??(s.ctx=L(n=mr,oi,_p).call(n,u(this,el)));const t=u(this,rl),r=u(this,Ld);for(const a of e){if(t.length>RC){ut("Ignoring additional textDivs for performance reasons."),T(this,Rd,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=u(this,In);T(this,In,document.createElement("span")),u(this,In).classList.add("markedContent"),a.id!==null&&u(this,In).setAttribute("id",`${a.id}`),o.append(u(this,In))}else a.type==="endMarkedContent"&&T(this,In,u(this,In).parentNode);continue}r.push(a.str),L(this,fa,sw).call(this,a)}},sw=function(e){var b;const t=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};u(this,rl).push(t);const n=Qe.transform(u(this,Fd),e.transform);let s=Math.atan2(n[1],n[0]);const a=u(this,Gu)[e.fontName];a.vertical&&(s+=Math.PI/2);let o=u(this,Id)&&a.fontSubstitution||a.fontFamily;o=mr.fontFamilyMap.get(o)||o;const l=Math.hypot(n[2],n[3]),c=l*L(b=mr,oi,ow).call(b,o,a,u(this,el));let h,d;s===0?(h=n[4],d=n[5]-c):(h=n[4]+c*Math.sin(s),d=n[5]-c*Math.cos(s));const p="calc(var(--total-scale-factor) *",g=t.style;u(this,In)===u(this,$u)?(g.left=`${(100*h/u(this,Md)).toFixed(2)}%`,g.top=`${(100*d/u(this,Nd)).toFixed(2)}%`):(g.left=`${p}${h.toFixed(2)}px)`,g.top=`${p}${d.toFixed(2)}px)`),g.fontSize=`${p}${(u(mr,za)*l).toFixed(2)}px)`,g.fontFamily=o,r.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,u(this,Id)&&(t.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),s!==0&&(r.angle=s*(180/Math.PI));let y=!1;if(e.str.length>1)y=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const w=Math.abs(e.transform[0]),v=Math.abs(e.transform[3]);w!==v&&Math.max(w,v)/Math.min(w,v)>1.5&&(y=!0)}if(y&&(r.canvasWidth=a.vertical?e.height:e.width),u(this,Od).set(t,r),u(this,Vs).div=t,u(this,Vs).properties=r,L(this,fa,I0).call(this,u(this,Vs)),r.hasText&&u(this,In).append(t),r.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),u(this,In).append(w)}},I0=function(e){var o;const{div:t,properties:r,ctx:n}=e,{style:s}=t;let a="";if(u(mr,za)>1&&(a=`scale(${1/u(mr,za)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:l}=s,{canvasWidth:c,fontSize:h}=r;L(o=mr,oi,N0).call(o,n,h*u(this,Ba),l);const{width:d}=n.measureText(t.textContent);d>0&&(a=`scaleX(${c*u(this,Ba)/d}) ${a}`)}r.angle!==0&&(a=`rotate(${r.angle}deg) ${a}`),a.length>0&&(s.transform=a)},oi=new WeakSet,_p=function(e=null){let t=u(this,nl).get(e||(e=""));if(!t){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),t=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),u(this,nl).set(e,t),u(this,Bd).set(t,{size:0,family:""})}return t},N0=function(e,t,r){const n=u(this,Bd).get(e);t===n.size&&r===n.family||(e.font=`${t}px ${r}`,n.size=t,n.family=r)},aw=function(){if(u(this,za)!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),T(this,za,e.getBoundingClientRect().height),e.remove()},ow=function(e,t,r){const n=u(this,Wu).get(e);if(n)return n;const s=L(this,oi,_p).call(this,r);s.canvas.width=s.canvas.height=hy,L(this,oi,N0).call(this,s,hy,e);const a=s.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let c=.8;return o?c=o/(o+l):(qr.platform.isFirefox&&ut("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),u(this,Wu).set(e,c),c},N(mr,oi),N(mr,Wu,new Map),N(mr,nl,new Map),N(mr,Bd,new WeakMap),N(mr,za,null),N(mr,Xu,new Set),mr);class Mh{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};function n(s){var l;if(!s)return;let a=null;const o=s.name;if(o==="#text")a=s.value;else if(Mh.shouldBuildText(o))(l=s==null?void 0:s.attributes)!=null&&l.textContent?a=s.attributes.textContent:s.value&&(a=s.value);else return;if(a!==null&&t.push({str:a}),!!s.children)for(const c of s.children)n(c)}return n(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const IC=100;function Bb(i={}){typeof i=="string"||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const e=new M0,{docId:t}=e,r=i.url?H_(i.url):null,n=i.data?$_(i.data):null,s=i.httpHeaders||null,a=i.withCredentials===!0,o=i.password??null,l=i.range instanceof zb?i.range:null,c=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:2**16;let h=i.worker instanceof Tc?i.worker:null;const d=i.verbosity,p=typeof i.docBaseUrl=="string"&&!kf(i.docBaseUrl)?i.docBaseUrl:null,g=tp(i.cMapUrl),y=i.cMapPacked!==!1,b=i.CMapReaderFactory||(_n?Z_:Jv),w=tp(i.iccUrl),v=tp(i.standardFontDataUrl),A=i.StandardFontDataFactory||(_n?K_:ey),E=tp(i.wasmUrl),_=i.WasmFactory||(_n?Q_:ty),C=i.stopAtErrors!==!0,I=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,k=i.isEvalSupported!==!1,D=typeof i.isOffscreenCanvasSupported=="boolean"?i.isOffscreenCanvasSupported:!_n,R=typeof i.isImageDecoderSupported=="boolean"?i.isImageDecoderSupported:!_n&&(qr.platform.isFirefox||!globalThis.chrome),z=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,G=typeof i.disableFontFace=="boolean"?i.disableFontFace:_n,O=i.fontExtraProperties===!0,X=i.enableXfa===!0,S=i.ownerDocument||globalThis.document,J=i.disableRange===!0,Y=i.disableStream===!0,W=i.disableAutoFetch===!0,fe=i.pdfBug===!0,K=i.CanvasFactory||(_n?Y_:q_),be=i.FilterFactory||(_n?X_:W_),te=i.enableHWA===!0,j=i.useWasm!==!1,ie=l?l.length:i.length??NaN,ae=typeof i.useSystemFonts=="boolean"?i.useSystemFonts:!_n&&!G,H=typeof i.useWorkerFetch=="boolean"?i.useWorkerFetch:!!(b===Jv&&A===ey&&_===ty&&g&&v&&E&&ah(g,document.baseURI)&&ah(v,document.baseURI)&&ah(E,document.baseURI)),se=null;__(d);const le={canvasFactory:new K({ownerDocument:S,enableHWA:te}),filterFactory:new be({docId:t,ownerDocument:S}),cMapReaderFactory:H?null:new b({baseUrl:g,isCompressed:y}),standardFontDataFactory:H?null:new A({baseUrl:v}),wasmFactory:H?null:new _({baseUrl:E})};h||(h=Tc.create({verbosity:d,port:yi.workerPort}),e._worker=h);const oe={docId:t,apiVersion:"5.3.93",data:n,password:o,disableAutoFetch:W,rangeChunkSize:c,length:ie,docBaseUrl:p,enableXfa:X,evaluatorOptions:{maxImageSize:I,disableFontFace:G,ignoreErrors:C,isEvalSupported:k,isOffscreenCanvasSupported:D,isImageDecoderSupported:R,canvasMaxAreaInBytes:z,fontExtraProperties:O,useSystemFonts:ae,useWasm:j,useWorkerFetch:H,cMapUrl:g,iccUrl:w,standardFontDataUrl:v,wasmUrl:E}},ce={ownerDocument:S,pdfBug:fe,styleElement:se,loadingParams:{disableAutoFetch:W,enableXfa:X}};return h.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const Ae=h.messageHandler.sendWithPromise("GetDocRequest",oe,n?[n.buffer]:null);let Se;if(l)Se=new pC(l,{disableRange:J,disableStream:Y});else if(!n){if(!r)throw new Error("getDocument - no `url` parameter provided.");const Ne=ah(r)?vC:_n?kC:EC;Se=new Ne({url:r,length:ie,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:J,disableStream:Y})}return Ae.then(Ne=>{if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const Te=new hh(t,Ne,h.port),x=new LC(Te,e,Se,ce,le);e._transport=x,Te.send("Ready",null)})}).catch(e._capability.reject),e}var pg;const gg=class gg{constructor(){Ie(this,"_capability",Promise.withResolvers());Ie(this,"_transport",null);Ie(this,"_worker",null);Ie(this,"docId",`d${bn(gg,pg)._++}`);Ie(this,"destroyed",!1);Ie(this,"onPassword",null);Ie(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var e,t,r,n;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((t=this._transport)==null?void 0:t.destroy())}catch(s){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,s}this._transport=null,(n=this._worker)==null||n.destroy(),this._worker=null}async getData(){return this._transport.getData()}};pg=new WeakMap,N(gg,pg,0);let M0=gg;var il,zd,jd,Ud,Hd,O2;let zb=(O2=class{constructor(e,t,r=!1,n=null){N(this,il,Promise.withResolvers());N(this,zd,[]);N(this,jd,[]);N(this,Ud,[]);N(this,Hd,[]);this.length=e,this.initialData=t,this.progressiveDone=r,this.contentDispositionFilename=n}addRangeListener(e){u(this,Hd).push(e)}addProgressListener(e){u(this,Ud).push(e)}addProgressiveReadListener(e){u(this,jd).push(e)}addProgressiveDoneListener(e){u(this,zd).push(e)}onDataRange(e,t){for(const r of u(this,Hd))r(e,t)}onDataProgress(e,t){u(this,il).promise.then(()=>{for(const r of u(this,Ud))r(e,t)})}onDataProgressiveRead(e){u(this,il).promise.then(()=>{for(const t of u(this,jd))t(e)})}onDataProgressiveDone(){u(this,il).promise.then(()=>{for(const e of u(this,zd))e()})}transportReady(){u(this,il).resolve()}requestDataRange(e,t){Wt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},il=new WeakMap,zd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,Hd=new WeakMap,O2);class NC{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Ct(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}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(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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()}}var Gs,sl,mh;class MC{constructor(e,t,r,n=!1){N(this,sl);N(this,Gs,!1);this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=n?new Zv:null,this._pdfBug=n,this.commonObjs=r.commonObjs,this.objs=new nw,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:e,rotation:t=this.rotate,offsetX:r=0,offsetY:n=0,dontFlip:s=!1}={}){return new Tf({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:s})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Ct(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:t,intent:r="display",annotationMode:n=vs.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:d=!1}){var _,C;(_=this._stats)==null||_.time("Overall");const p=this._transport.getRenderingIntent(r,n,h,d),{renderingIntent:g,cacheKey:y}=p;T(this,Gs,!1),o||(o=this._transport.getOptionalContentConfig(g));let b=this._intentStates.get(y);b||(b=Object.create(null),this._intentStates.set(y,b)),b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const w=!!(g&ii.PRINT);b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(C=this._stats)==null||C.time("Page Request"),this._pumpOperatorList(p));const v=I=>{var k;b.renderTasks.delete(A),w&&T(this,Gs,!0),L(this,sl,mh).call(this),I?(A.capability.reject(I),this._abortOperatorList({intentState:b,reason:I instanceof Error?I:new Error(I)})):A.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(k=globalThis.Stats)!=null&&k.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},A=new L0({callback:v,params:{canvasContext:e,viewport:t,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:c});(b.renderTasks||(b.renderTasks=new Set)).add(A);const E=A.task;return Promise.all([b.displayReadyCapability.promise,o]).then(([I,k])=>{var D;if(this.destroyed){v();return}if((D=this._stats)==null||D.time("Rendering"),!(k.renderingIntent&g))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");A.initializeGraphics({transparency:I,optionalContentConfig:k}),A.operatorListChanged()}).catch(v),E}getOperatorList({intent:e="display",annotationMode:t=vs.ENABLE,printAnnotationStorage:r=null,isEditing:n=!1}={}){var c;function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,t,r,n,!0);let o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(n){return n.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>Mh.textContent(r));const t=this.streamTextContent(e);return new Promise(function(r,n){function s(){a.read().then(function({value:l,done:c}){if(c){r(o);return}o.lang??(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),s()},n)}const a=t.getReader(),o={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const r of t.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),T(this,Gs,!1),Promise.all(e)}cleanup(e=!1){T(this,Gs,!0);const t=L(this,sl,mh).call(this);return e&&t&&this._stats&&(this._stats=new Zv),t}_startRenderPage(e,t){var n,s;const r=this._intentStates.get(t);r&&((n=this._stats)==null||n.timeEnd("Page Request"),(s=r.displayReadyCapability)==null||s.resolve(e))}_renderPageChunk(e,t){for(let r=0,n=e.length;r<n;r++)t.operatorList.fnArray.push(e.fnArray[r]),t.operatorList.argsArray.push(e.argsArray[r]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const r of t.renderTasks)r.operatorListChanged();e.lastChunk&&L(this,sl,mh).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:r,modifiedIds:n}){const{map:s,transfer:a}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:s,modifiedIds:n},a).getReader(),c=this._intentStates.get(t);c.streamReader=l;const h=()=>{l.read().then(({value:d,done:p})=>{if(p){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),h())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const p of c.renderTasks)p.operatorListChanged();L(this,sl,mh).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};h()}_abortOperatorList({intentState:e,reason:t,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(t instanceof Tg){let n=IC;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new ha(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[n,s]of this._intentStates)if(s===e){this._intentStates.delete(n);break}this.cleanup()}}}get stats(){return this._stats}}Gs=new WeakMap,sl=new WeakSet,mh=function(){if(!u(this,Gs)||this.destroyed)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),T(this,Gs,!1),!0};var ja,Oi,qs,al,mg,ol,ll,Tn,Cp,lw,uw,bh,Yu,Sp;const ar=class ar{constructor({name:e=null,port:t=null,verbosity:r=C_()}={}){N(this,Tn);N(this,ja,Promise.withResolvers());N(this,Oi,null);N(this,qs,null);N(this,al,null);if(this.name=e,this.destroyed=!1,this.verbosity=r,t){if(u(ar,ll).has(t))throw new Error("Cannot use more than one PDFWorker per port.");u(ar,ll).set(t,this),L(this,Tn,lw).call(this,t)}else L(this,Tn,uw).call(this)}get promise(){return u(this,ja).promise}get port(){return u(this,qs)}get messageHandler(){return u(this,Oi)}destroy(){var e,t;this.destroyed=!0,(e=u(this,al))==null||e.terminate(),T(this,al,null),u(ar,ll).delete(u(this,qs)),T(this,qs,null),(t=u(this,Oi))==null||t.destroy(),T(this,Oi,null)}static create(e){const t=u(this,ll).get(e==null?void 0:e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new ar(e)}static get workerSrc(){if(yi.workerSrc)return yi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Ct(this,"_setupFakeWorkerGlobal",(async()=>u(this,Yu,Sp)?u(this,Yu,Sp):(await import(this.workerSrc)).WorkerMessageHandler)())}};ja=new WeakMap,Oi=new WeakMap,qs=new WeakMap,al=new WeakMap,mg=new WeakMap,ol=new WeakMap,ll=new WeakMap,Tn=new WeakSet,Cp=function(){u(this,ja).resolve(),u(this,Oi).send("configure",{verbosity:this.verbosity})},lw=function(e){T(this,qs,e),T(this,Oi,new hh("main","worker",e)),u(this,Oi).on("ready",()=>{}),L(this,Tn,Cp).call(this)},uw=function(){if(u(ar,ol)||u(ar,Yu,Sp)){L(this,Tn,bh).call(this);return}let{workerSrc:e}=ar;try{ar._isSameOrigin(window.location,e)||(e=ar._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),r=new hh("main","worker",t),n=()=>{s.abort(),r.destroy(),t.terminate(),this.destroyed?u(this,ja).reject(new Error("Worker was destroyed")):L(this,Tn,bh).call(this)},s=new AbortController;t.addEventListener("error",()=>{u(this,al)||n()},{signal:s.signal}),r.on("test",o=>{if(s.abort(),this.destroyed||!o){n();return}T(this,Oi,r),T(this,qs,t),T(this,al,t),L(this,Tn,Cp).call(this)}),r.on("ready",o=>{if(s.abort(),this.destroyed){n();return}try{a()}catch{L(this,Tn,bh).call(this)}});const a=()=>{const o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{Sg("The worker has been disabled.")}L(this,Tn,bh).call(this)},bh=function(){u(ar,ol)||(ut("Setting up fake worker."),T(ar,ol,!0)),ar._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){u(this,ja).reject(new Error("Worker was destroyed"));return}const t=new G_;T(this,qs,t);const r=`fake${bn(ar,mg)._++}`,n=new hh(r+"_worker",r,t);e.setup(n,t),T(this,Oi,new hh(r,r+"_worker",t)),L(this,Tn,Cp).call(this)}).catch(e=>{u(this,ja).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Yu=new WeakSet,Sp=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},N(ar,Yu),N(ar,mg,0),N(ar,ol,!1),N(ar,ll,new WeakMap),_n&&(T(ar,ol,!0),yi.workerSrc||(yi.workerSrc="./pdf.worker.mjs")),ar._isSameOrigin=(e,t)=>{const r=URL.parse(e);if(!(r!=null&&r.origin)||r.origin==="null")return!1;const n=new URL(t,r);return r.origin===n.origin},ar._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},ar.fromPort=e=>{if(M_("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return ar.create(e)};let Tc=ar;var Ws,cs,Zu,Ku,Xs,ul,vh;class LC{constructor(e,t,r,n,s){N(this,ul);N(this,Ws,new Map);N(this,cs,new Map);N(this,Zu,new Map);N(this,Ku,new Map);N(this,Xs,null);this.messageHandler=e,this.loadingTask=t,this.commonObjs=new nw,this.fontLoader=new j_({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Ct(this,"annotationStorage",new Lb)}getRenderingIntent(e,t=vs.ENABLE,r=null,n=!1,s=!1){let a=ii.DISPLAY,o=x0;switch(e){case"any":a=ii.ANY;break;case"display":break;case"print":a=ii.PRINT;break;default:ut(`getRenderingIntent - invalid intent: ${e}`)}const l=a&ii.PRINT&&r instanceof j1?r:this.annotationStorage;switch(t){case vs.DISABLE:a+=ii.ANNOTATIONS_DISABLE;break;case vs.ENABLE:break;case vs.ENABLE_FORMS:a+=ii.ANNOTATIONS_FORMS;break;case vs.ENABLE_STORAGE:a+=ii.ANNOTATIONS_STORAGE,o=l.serializable;break;default:ut(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(a+=ii.IS_EDITING),s&&(a+=ii.OPLIST);const{ids:c,hash:h}=l.modifiedIds,d=[a,o.hash,h];return{renderingIntent:a,cacheKey:d.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(r=u(this,Xs))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of u(this,cs).values())e.push(n._destroy());u(this,cs).clear(),u(this,Zu).clear(),u(this,Ku).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{var n,s;this.commonObjs.clear(),this.fontLoader.clear(),u(this,Ws).clear(),this.filterFactory.destroy(),Nh.cleanup(),(n=this._networkStream)==null||n.cancelAllRequests(new ha("Worker was terminated.")),(s=this.messageHandler)==null||s.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(r,n)=>{Dr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},n.onPull=()=>{this._fullReader.read().then(function({value:s,done:a}){if(a){n.close();return}Dr(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{n.error(s)})},n.onCancel=s=>{this._fullReader.cancel(s),n.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async r=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:s,contentLength:a}=this._fullReader;return(!n||!s)&&(this._lastProgress&&((o=t.onProgress)==null||o.call(t,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=t.onProgress)==null||c.call(t,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:n,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(r,n)=>{Dr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(r.begin,r.end);if(!s){n.close();return}n.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){n.close();return}Dr(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{n.error(a)})},n.onCancel=a=>{s.cancel(a),n.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,t._capability.resolve(new NC(r,this))}),e.on("DocException",r=>{t._capability.reject(Dn(r))}),e.on("PasswordRequest",r=>{T(this,Xs,Promise.withResolvers());try{if(!t.onPassword)throw Dn(r);const n=s=>{s instanceof Error?u(this,Xs).reject(s):u(this,Xs).resolve({password:s})};t.onPassword(n,r.code)}catch(n){u(this,Xs).reject(n)}return u(this,Xs).promise}),e.on("DataLoaded",r=>{var n;(n=t.onProgress)==null||n.call(t,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;u(this,cs).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,n,s])=>{var a;if(this.destroyed||this.commonObjs.has(r))return null;switch(n){case"Font":if("error"in s){const h=s.error;ut(`Error during font loading: ${h}`),this.commonObjs.resolve(r,h);break}const o=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(h,d)=>globalThis.FontInspector.fontAdded(h,d):null,l=new U_(s,o);this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(r,l)});break;case"CopyLocalImage":const{imageRef:c}=s;Dr(c,"The imageRef must be defined.");for(const h of u(this,cs).values())for(const[,d]of h.objs)if((d==null?void 0:d.ref)===c)return d.dataLen?(this.commonObjs.resolve(r,structuredClone(d)),d.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,s);break;default:throw new Error(`Got unknown common object type ${n}`)}return null}),e.on("obj",([r,n,s,a])=>{var l;if(this.destroyed)return;const o=u(this,cs).get(n);if(!o.objs.has(r)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(s){case"Image":case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",r=>{var n;this.destroyed||(n=t.onProgress)==null||n.call(t,{loaded:r.loaded,total:r.total})}),e.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");const n=this[r.type];if(!n)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return n.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&ut("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:((r=this._fullReader)==null?void 0:r.filename)??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,r=u(this,Zu).get(t);if(r)return r;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&u(this,Ku).set(s.refStr,e);const a=new MC(t,s,this,this._params.pdfBug);return u(this,cs).set(t,a),a});return u(this,Zu).set(t,n),n}getPageIndex(e){return A0(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return L(this,ul,vh).call(this,"GetFieldObjects")}hasJSActions(){return L(this,ul,vh).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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 L(this,ul,vh).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return L(this,ul,vh).call(this,"GetOptionalContentConfig").then(t=>new fC(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=u(this,Ws).get(e);if(t)return t;const r=this.messageHandler.sendWithPromise(e,null).then(n=>{var s,a;return{info:n[0],metadata:n[1]?new hC(n[1]):null,contentDispositionFilename:((s=this._fullReader)==null?void 0:s.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return u(this,Ws).set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of u(this,cs).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),u(this,Ws).clear(),this.filterFactory.destroy(!0),Nh.cleanup()}}cachedPageNumber(e){if(!A0(e))return null;const t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return u(this,Ku).get(t)??null}}Ws=new WeakMap,cs=new WeakMap,Zu=new WeakMap,Ku=new WeakMap,Xs=new WeakMap,ul=new WeakSet,vh=function(e,t=null){const r=u(this,Ws).get(e);if(r)return r;const n=this.messageHandler.sendWithPromise(e,t);return u(this,Ws).set(e,n),n};var Ua;class OC{constructor(e){N(this,Ua,null);Ie(this,"onContinue",null);Ie(this,"onError",null);T(this,Ua,e)}get promise(){return u(this,Ua).capability.promise}cancel(e=0){u(this,Ua).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=u(this,Ua).operatorList;if(!e)return!1;const{annotationCanvasMap:t}=u(this,Ua);return e.form||e.canvas&&(t==null?void 0:t.size)>0}}Ua=new WeakMap;var Ha,cl;const Do=class Do{constructor({callback:e,params:t,objs:r,commonObjs:n,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:p=null}){N(this,Ha,null);this.callback=e,this.params=t,this.objs=r,this.commonObjs=n,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new OC(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=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){var o,l;if(this.cancelled)return;if(this._canvas){if(u(Do,cl).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.");u(Do,cl).add(this._canvas)}this._pdfBug&&((o=globalThis.StepperManager)!=null&&o.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:n,transform:s,background:a}=this.params;this.gfx=new bu(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:n,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,(l=this.graphicsReadyCallback)==null||l.call(this)}cancel(e=null,t=0){var r,n,s;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),u(this,Ha)&&(window.cancelAnimationFrame(u(this,Ha)),T(this,Ha,null)),u(Do,cl).delete(this._canvas),e||(e=new Tg(`Rendering cancelled, page ${this._pageIndex+1}`,t)),this.callback(e),(s=(n=this.task).onError)==null||s.call(n,e)}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.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?T(this,Ha,window.requestAnimationFrame(()=>{T(this,Ha,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),u(Do,cl).delete(this._canvas),this.callback())))}};Ha=new WeakMap,cl=new WeakMap,N(Do,cl,new WeakSet);let L0=Do;const jb="5.3.93",cw="cbeef3233";function dy(i){return Math.floor(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function Qc(i){return Math.max(0,Math.min(255,255*i))}class fy{static CMYK_G([e,t,r,n]){return["G",1-Math.min(1,.3*e+.59*r+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Qc(e),[e,e,e]}static G_HTML([e]){const t=dy(e);return`#${t}${t}${t}`}static RGB_G([e,t,r]){return["G",.3*e+.59*t+.11*r]}static RGB_rgb(e){return e.map(Qc)}static RGB_HTML(e){return`#${e.map(dy).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,r,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,r+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,r,n]){return[Qc(1-Math.min(1,e+n)),Qc(1-Math.min(1,r+n)),Qc(1-Math.min(1,t+n))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,r]){const n=1-e,s=1-t,a=1-r,o=Math.min(n,s,a);return["CMYK",n,s,a,o]}}class FC{create(e,t,r=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),r||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Wt("Abstract method `_createSVG` called.")}}class Lh extends FC{_createSVG(e){return document.createElementNS(Ts,e)}}class Ub{static setupStorage(e,t,r,n,s){const a=n.getValue(t,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),s==="print")break;e.addEventListener("input",o=>{n.setValue(t,{value:o.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",o=>{n.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),s==="print")break;e.addEventListener("input",o=>{n.setValue(t,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const o of r.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;n.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:r=null,intent:n,linkService:s}){const{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${n}`);for(const[l,c]of Object.entries(a))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}o&&s.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,t,r)}static render(e){var d,p;const t=e.annotationStorage,r=e.linkService,n=e.xfaHtml,s=e.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:s,linkService:r});const o=s!=="richText",l=e.div;if(l.append(a),e.viewport){const g=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=g}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(n.children.length===0){if(n.value){const g=document.createTextNode(n.value);a.append(g),o&&Mh.shouldBuildText(n.name)&&c.push(g)}return{textDivs:c}}const h=[[n,-1,a]];for(;h.length>0;){const[g,y,b]=h.at(-1);if(y+1===g.children.length){h.pop();continue}const w=g.children[++h.at(-1)[1]];if(w===null)continue;const{name:v}=w;if(v==="#text"){const E=document.createTextNode(w.value);c.push(E),b.append(E);continue}const A=(d=w==null?void 0:w.attributes)!=null&&d.xmlns?document.createElementNS(w.attributes.xmlns,v):document.createElement(v);if(b.append(A),w.attributes&&this.setAttributes({html:A,element:w,storage:t,intent:s,linkService:r}),((p=w.children)==null?void 0:p.length)>0)h.push([w,-1,A]);else if(w.value){const E=document.createTextNode(w.value);o&&Mh.shouldBuildText(v)&&c.push(E),A.append(E)}}for(const g of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))g.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const BC=9,jl=new WeakSet;class py{static create(e){switch(e.data.annotationType){case wr.LINK:return new hw(e);case wr.TEXT:return new zC(e);case wr.WIDGET:switch(e.data.fieldType){case"Tx":return new jC(e);case"Btn":return e.data.radioButton?new pw(e):e.data.checkBox?new HC(e):new $C(e);case"Ch":return new VC(e);case"Sig":return new UC(e)}return new Xl(e);case wr.POPUP:return new F0(e);case wr.FREETEXT:return new yw(e);case wr.LINE:return new qC(e);case wr.SQUARE:return new WC(e);case wr.CIRCLE:return new XC(e);case wr.POLYLINE:return new ww(e);case wr.CARET:return new ZC(e);case wr.INK:return new Hb(e);case wr.POLYGON:return new YC(e);case wr.HIGHLIGHT:return new xw(e);case wr.UNDERLINE:return new KC(e);case wr.SQUIGGLY:return new QC(e);case wr.STRIKEOUT:return new JC(e);case wr.STAMP:return new Aw(e);case wr.FILEATTACHMENT:return new eS(e);default:return new Cr(e)}}}var hl,Qu,Ju,$d,O0;const yv=class yv{constructor(e,{isRenderable:t=!1,ignoreBorder:r=!1,createQuadrilaterals:n=!1}={}){N(this,$d);N(this,hl,null);N(this,Qu,!1);N(this,Ju,null);this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(r)),n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e!=null&&e.str||t!=null&&t.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return yv._hasPopupData(this.data)}updateEdited(e){var r;if(!this.container)return;u(this,hl)||T(this,hl,{rect:this.data.rect.slice(0)});const{rect:t}=e;t&&L(this,$d,O0).call(this,t),(r=u(this,Ju))==null||r.popup.updateEdited(e)}resetEdited(){var e;u(this,hl)&&(L(this,$d,O0).call(this,u(this,hl).rect),(e=u(this,Ju))==null||e.popup.resetEdited(),T(this,hl,null))}_createContainer(e){const{data:t,parent:{page:r,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),this instanceof Xl||(s.tabIndex=0);const{style:a}=s;if(a.zIndex=this.parent.zIndex++,t.alternativeText&&(s.title=t.alternativeText),t.noRotate&&s.classList.add("norotate"),!t.rect||this instanceof F0){const{rotation:b}=t;return!t.hasOwnCanvas&&b!==0&&this.setRotation(b,s),s}const{width:o,height:l}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;const b=t.borderStyle.horizontalCornerRadius,w=t.borderStyle.verticalCornerRadius;if(b>0||w>0){const A=`calc(${b}px * var(--total-scale-factor)) / calc(${w}px * var(--total-scale-factor))`;a.borderRadius=A}else if(this instanceof pw){const A=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=A}switch(t.borderStyle.style){case su.SOLID:a.borderStyle="solid";break;case su.DASHED:a.borderStyle="dashed";break;case su.BEVELED:ut("Unimplemented border style: beveled");break;case su.INSET:ut("Unimplemented border style: inset");break;case su.UNDERLINE:a.borderBottomStyle="solid";break}const v=t.borderColor||null;v?(T(this,Qu,!0),a.borderColor=Qe.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):a.borderWidth=0}const c=Qe.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]),{pageWidth:h,pageHeight:d,pageX:p,pageY:g}=n.rawDims;a.left=`${100*(c[0]-p)/h}%`,a.top=`${100*(c[1]-g)/d}%`;const{rotation:y}=t;return t.hasOwnCanvas||y===0?(a.width=`${100*o/h}%`,a.height=`${100*l/d}%`):this.setRotation(y,s),s}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:n}=this.parent.viewport.rawDims;let{width:s,height:a}=this;e%180!==0&&([s,a]=[a,s]),t.style.width=`${100*s/r}%`,t.style.height=`${100*a/n}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,r,n)=>{const s=n.detail[t],a=s[0],o=s.slice(1);n.target.style[r]=fy[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:fy[`${a}_rgb`](o)})};return Ct(this,"_commonActions",{display:t=>{const{display:r}=t.detail,n=r%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:r===1||r===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:r}=t.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{const r=t.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,t){const r=this._commonActions;for(const n of Object.keys(t.detail)){const s=e[n]||r[n];s==null||s(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const r=this._commonActions;for(const[n,s]of Object.entries(t)){const a=r[n];if(a){const o={detail:{[n]:s},target:e};a(o),delete t[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,r,n,s]=this.data.rect.map(b=>Math.fround(b));if(e.length===8){const[b,w,v,A]=e.subarray(2,6);if(n===b&&s===w&&t===v&&r===A)return}const{style:a}=this.container;let o;if(u(this,Qu)){const{borderColor:b,borderWidth:w}=a;a.borderWidth=0,o=["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="${b}" stroke-width="${w}">`],this.container.classList.add("hasBorder")}const l=n-t,c=s-r,{svgFactory:h}=this,d=h.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const p=h.createElement("defs");d.append(p);const g=h.createElement("clipPath"),y=`clippath_${this.data.id}`;g.setAttribute("id",y),g.setAttribute("clipPathUnits","objectBoundingBox"),p.append(g);for(let b=2,w=e.length;b<w;b+=8){const v=e[b],A=e[b+1],E=e[b+2],_=e[b+3],C=h.createElement("rect"),I=(E-t)/l,k=(s-A)/c,D=(v-E)/l,R=(A-_)/c;C.setAttribute("x",I),C.setAttribute("y",k),C.setAttribute("width",D),C.setAttribute("height",R),g.append(C),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${I}" y="${k}" width="${D}" height="${R}"/>`)}u(this,Qu)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(d),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{data:e}=this,t=T(this,Ju,new F0({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},parent:this.parent,elements:[this]}));this.parent.div.append(t.render())}render(){Wt("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const r=[];if(this._fieldObjects){const n=this._fieldObjects[e];if(n)for(const{page:s,id:a,exportValues:o}of n){if(s===-1||a===t)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!jl.has(c)){ut(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:l,domElement:c})}return r}for(const n of document.getElementsByName(e)){const{exportValue:s}=n,a=n.getAttribute("data-element-id");a!==t&&jl.has(n)&&r.push({id:a,exportValue:s,domElement:n})}return r}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};hl=new WeakMap,Qu=new WeakMap,Ju=new WeakMap,$d=new WeakSet,O0=function(e){const{container:{style:t},data:{rect:r,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}}}=this;r==null||r.splice(0,4,...e),t.left=`${100*(e[0]-o)/s}%`,t.top=`${100*(a-e[3]+l)/a}%`,n===0?(t.width=`${100*(e[2]-e[0])/s}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(n)};let Cr=yv;var ai,Co,dw,fw;class hw extends Cr{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});N(this,ai);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let s=!1;return t.url?(r.addLinkAttributes(n,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(n,t.action),s=!0):t.attachment?(L(this,ai,dw).call(this,n,t.attachment,t.attachmentDest),s=!0):t.setOCGState?(L(this,ai,fw).call(this,n,t.setOCGState),s=!0):t.dest?(this._bindLink(n,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),s=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(n,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&this.container.append(n),this.container}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&L(this,ai,Co).call(this)}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),L(this,ai,Co).call(this)}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(r.actions)){const a=n.get(s);a&&(t[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:s}}),!1})}t.onclick||(t.onclick=()=>!1),L(this,ai,Co).call(this)}_bindResetFormAction(t,r){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),L(this,ai,Co).call(this),!this._fieldObjects){ut('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{var d;n==null||n();const{fields:s,refs:a,include:o}=r,l=[];if(s.length!==0||a.length!==0){const p=new Set(a);for(const g of s){const y=this._fieldObjects[g]||[];for(const{id:b}of y)p.add(b)}for(const g of Object.values(this._fieldObjects))for(const y of g)p.has(y.id)===o&&l.push(y)}else for(const p of Object.values(this._fieldObjects))l.push(...p);const c=this.annotationStorage,h=[];for(const p of l){const{id:g}=p;switch(h.push(g),p.type){case"text":{const b=p.defaultValue||"";c.setValue(g,{value:b});break}case"checkbox":case"radiobutton":{const b=p.defaultValue===p.exportValues;c.setValue(g,{value:b});break}case"combobox":case"listbox":{const b=p.defaultValue||"";c.setValue(g,{value:b});break}default:continue}const y=document.querySelector(`[data-element-id="${g}"]`);if(y){if(!jl.has(y)){ut(`_bindResetFormAction - element not allowed: ${g}`);continue}}else continue;y.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((d=this.linkService.eventBus)==null||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}})),!1}}}ai=new WeakSet,Co=function(){this.container.setAttribute("data-internal-link","")},dw=function(t,r,n=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>{var s;return(s=this.downloadManager)==null||s.openOrDownloadData(r.content,r.filename,n),!1},L(this,ai,Co).call(this)},fw=function(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),L(this,ai,Co).call(this)};class zC extends Cr{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class Xl extends Cr{render(){return this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&(((t=e.previousSibling)==null?void 0:t.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return qr.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,r,n,s){r.includes("mouse")?e.addEventListener(r,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(r,a=>{var o;if(r==="blur"){if(!t.focused||!a.relatedTarget)return;t.focused=!1}else if(r==="focus"){if(t.focused)return;t.focused=!0}s&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(a)}}))})}_setEventListeners(e,t,r,n){var s,a,o;for(const[l,c]of r)(c==="Action"||(s=this.data.actions)!=null&&s[c])&&((c==="Focus"||c==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,l,c,n),c==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(e,t,"blur","Blur",null):c==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":Qe.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||BC,s=e.style;let a;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),h=Math.round(c/(hm*n))||1,d=c/h;a=Math.min(n,l(d/hm))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(n,l(c/hm))}s.fontSize=`calc(${a}px * var(--total-scale-factor))`,s.color=Qe.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(s.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class jC extends Xl{constructor(e){const t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,r,n){const s=this.annotationStorage;for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=r),s.setValue(a.id,{[n]:r})}render(){var n,s;const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const a=e.getValue(t,{value:this.data.fieldValue});let o=a.value||"";const l=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=a.formattedValue||((n=this.data.textContent)==null?void 0:n.join(`
32
32
  `))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const h={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=c??o,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",c??o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),jl.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;const d=this.data.dateFormat||this.data.timeFormat;d&&(r.title=d),this._setRequired(r,this.data.required),l&&(r.maxLength=l),r.addEventListener("input",g=>{e.setValue(t,{value:g.target.value}),this.setPropertyOnSiblings(r,"value",g.target.value,"value"),h.formattedValue=null}),r.addEventListener("resetform",g=>{const y=this.data.defaultFieldValue??"";r.value=h.userValue=y,h.formattedValue=null});let p=g=>{const{formattedValue:y}=h;y!=null&&(g.target.value=y),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",y=>{var w;if(h.focused)return;const{target:b}=y;h.userValue&&(b.value=h.userValue),h.lastCommittedValue=b.value,h.commitKey=1,(w=this.data.actions)!=null&&w.Focus||(h.focused=!0)}),r.addEventListener("updatefromsandbox",y=>{this.showElementAndHideCanvas(y.target);const b={value(w){h.userValue=w.detail.value??"",e.setValue(t,{value:h.userValue.toString()}),w.target.value=h.userValue},formattedValue(w){const{formattedValue:v}=w.detail;h.formattedValue=v,v!=null&&w.target!==document.activeElement&&(w.target.value=v),e.setValue(t,{formattedValue:v})},selRange(w){w.target.setSelectionRange(...w.detail.selRange)},charLimit:w=>{var _;const{charLimit:v}=w.detail,{target:A}=w;if(v===0){A.removeAttribute("maxLength");return}A.setAttribute("maxLength",v);let E=h.userValue;!E||E.length<=v||(E=E.slice(0,v),A.value=h.userValue=E,e.setValue(t,{value:E}),(_=this.linkService.eventBus)==null||_.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,willCommit:!0,commitKey:1,selStart:A.selectionStart,selEnd:A.selectionEnd}}))}};this._dispatchEventFromSandbox(b,y)}),r.addEventListener("keydown",y=>{var v;h.commitKey=1;let b=-1;if(y.key==="Escape"?b=0:y.key==="Enter"&&!this.data.multiLine?b=2:y.key==="Tab"&&(h.commitKey=3),b===-1)return;const{value:w}=y.target;h.lastCommittedValue!==w&&(h.lastCommittedValue=w,h.userValue=w,(v=this.linkService.eventBus)==null||v.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:w,willCommit:!0,commitKey:b,selStart:y.target.selectionStart,selEnd:y.target.selectionEnd}}))});const g=p;p=null,r.addEventListener("blur",y=>{var w,v;if(!h.focused||!y.relatedTarget)return;(w=this.data.actions)!=null&&w.Blur||(h.focused=!1);const{value:b}=y.target;h.userValue=b,h.lastCommittedValue!==b&&((v=this.linkService.eventBus)==null||v.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:h.commitKey,selStart:y.target.selectionStart,selEnd:y.target.selectionEnd}})),g(y)}),(s=this.data.actions)!=null&&s.Keystroke&&r.addEventListener("beforeinput",y=>{var I;h.lastCommittedValue=null;const{data:b,target:w}=y,{value:v,selectionStart:A,selectionEnd:E}=w;let _=A,C=E;switch(y.inputType){case"deleteWordBackward":{const k=v.substring(0,A).match(/\w*[^\w]*$/);k&&(_-=k[0].length);break}case"deleteWordForward":{const k=v.substring(A).match(/^[^\w]*\w*/);k&&(C+=k[0].length);break}case"deleteContentBackward":A===E&&(_-=1);break;case"deleteContentForward":A===E&&(C+=1);break}y.preventDefault(),(I=this.linkService.eventBus)==null||I.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,change:b||"",willCommit:!1,selStart:_,selEnd:C}})}),this._setEventListeners(r,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],y=>y.target.value)}if(p&&r.addEventListener("blur",p),this.data.comb){const y=(this.data.rect[2]-this.data.rect[0])/l;r.classList.add("comb"),r.style.letterSpacing=`calc(${y}px * var(--total-scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class UC extends Xl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class HC extends Xl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,r=t.id;let n=e.getValue(r,{value:t.exportValue===t.fieldValue}).value;typeof n=="string"&&(n=n!=="Off",e.setValue(r,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return jl.add(s),s.setAttribute("data-element-id",r),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=t.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",t.exportValue),s.tabIndex=0,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,r)){const h=l&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=h),e.setValue(c.id,{value:h})}e.setValue(r,{value:l})}),s.addEventListener("resetform",a=>{const o=t.defaultFieldValue||"Off";a.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class pw extends Xl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,r=t.id;let n=e.getValue(r,{value:t.fieldValue===t.buttonValue}).value;if(typeof n=="string"&&(n=n!==t.buttonValue,e.setValue(r,{value:n})),n)for(const a of this._getElementsByName(t.fieldName,r))e.setValue(a.id,{value:!1});const s=document.createElement("input");if(jl.add(s),s.setAttribute("data-element-id",r),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=t.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=0,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),s.addEventListener("resetform",a=>{const o=t.defaultFieldValue;a.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const a=t.buttonValue;s.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const h=a===c.detail.value;for(const d of this._getElementsByName(c.target.name)){const p=h&&d.id===r;d.domElement&&(d.domElement.checked=p),e.setValue(d.id,{value:p})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class $C extends hw{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class VC extends Xl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,r=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");jl.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",h=>{const d=this.data.defaultFieldValue;for(const p of n.options)p.selected=p.value===d});for(const h of this.data.options){const d=document.createElement("option");d.textContent=h.displayValue,d.value=h.exportValue,r.value.includes(h.exportValue)&&(d.setAttribute("selected",!0),s=!1),n.append(d)}let a=null;if(s){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),n.prepend(h),a=()=>{h.remove(),n.removeEventListener("input",a),a=null},n.addEventListener("input",a)}const o=h=>{const d=h?"value":"textContent",{options:p,multiple:g}=n;return g?Array.prototype.filter.call(p,y=>y.selected).map(y=>y[d]):p.selectedIndex===-1?null:p[p.selectedIndex][d]};let l=o(!1);const c=h=>{const d=h.target.options;return Array.prototype.map.call(d,p=>({displayValue:p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",h=>{const d={value(p){a==null||a();const g=p.detail.value,y=new Set(Array.isArray(g)?g:[g]);for(const b of n.options)b.selected=y.has(b.value);e.setValue(t,{value:o(!0)}),l=o(!1)},multipleSelection(p){n.multiple=!0},remove(p){const g=n.options,y=p.detail.remove;g[y].selected=!1,n.remove(y),g.length>0&&Array.prototype.findIndex.call(g,w=>w.selected)===-1&&(g[0].selected=!0),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},clear(p){for(;n.length!==0;)n.remove(0);e.setValue(t,{value:null,items:[]}),l=o(!1)},insert(p){const{index:g,displayValue:y,exportValue:b}=p.detail.insert,w=n.children[g],v=document.createElement("option");v.textContent=y,v.value=b,w?w.before(v):n.append(v),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},items(p){const{items:g}=p.detail;for(;n.length!==0;)n.remove(0);for(const y of g){const{displayValue:b,exportValue:w}=y,v=document.createElement("option");v.textContent=b,v.value=w,n.append(v)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},indices(p){const g=new Set(p.detail.indices);for(const y of p.target.options)y.selected=g.has(y.index);e.setValue(t,{value:o(!0)}),l=o(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(d,h)}),n.addEventListener("input",h=>{var g;const d=o(!0),p=o(!1);e.setValue(t,{value:d}),h.preventDefault(),(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,change:p,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],h=>h.target.value)):n.addEventListener("input",function(h){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class F0 extends Cr{constructor(e){const{data:t,elements:r}=e;super(e,{isRenderable:Cr._hasPopupData(t)}),this.elements=r,this.popup=null}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const t=this.popup=new GC({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}),r=[];for(const n of this.elements)n.popup=t,n.container.ariaHasPopup="dialog",r.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(n=>`${Nb}${n}`).join(",")),this.container}}var ec,bg,vg,tc,rc,pr,Ys,dl,Vd,Gd,nc,Zs,Fi,Ks,qd,Qs,Wd,fl,pl,Xt,Tp,B0,gw,mw,bw,vw,kp,Dp,z0;class GC{constructor({container:e,color:t,elements:r,titleObj:n,modificationDate:s,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d}){N(this,Xt);N(this,ec,L(this,Xt,bw).bind(this));N(this,bg,L(this,Xt,z0).bind(this));N(this,vg,L(this,Xt,Dp).bind(this));N(this,tc,L(this,Xt,kp).bind(this));N(this,rc,null);N(this,pr,null);N(this,Ys,null);N(this,dl,null);N(this,Vd,null);N(this,Gd,null);N(this,nc,null);N(this,Zs,!1);N(this,Fi,null);N(this,Ks,null);N(this,qd,null);N(this,Qs,null);N(this,Wd,null);N(this,fl,null);N(this,pl,!1);var p;T(this,pr,e),T(this,Wd,n),T(this,Ys,a),T(this,Qs,o),T(this,Gd,l),T(this,rc,t),T(this,qd,c),T(this,nc,h),T(this,Vd,r),T(this,dl,Dg.toDateObject(s)),this.trigger=r.flatMap(g=>g.getElementsToTriggerPopup());for(const g of this.trigger)g.addEventListener("click",u(this,tc)),g.addEventListener("mouseenter",u(this,vg)),g.addEventListener("mouseleave",u(this,bg)),g.classList.add("popupTriggerArea");for(const g of r)(p=g.container)==null||p.addEventListener("keydown",u(this,ec));u(this,pr).hidden=!0,d&&L(this,Xt,kp).call(this)}render(){if(u(this,Fi))return;const e=T(this,Fi,document.createElement("div"));if(e.className="popup",u(this,rc)){const s=e.style.outlineColor=Qe.makeHexColor(...u(this,rc));e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`}const t=document.createElement("span");t.className="header";const r=document.createElement("h1");if(t.append(r),{dir:r.dir,str:r.textContent}=u(this,Wd),e.append(t),u(this,dl)){const s=document.createElement("time");s.classList.add("popupDate"),s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:u(this,dl).valueOf()})),s.dateTime=u(this,dl).toISOString(),t.append(s)}const n=u(this,Xt,Tp);if(n)Ub.render({xfaHtml:n,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const s=this._formatContents(u(this,Ys));e.append(s)}u(this,pr).append(e)}_formatContents({str:e,dir:t}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=t;const n=e.split(/(?:\r\n?|\n)/);for(let s=0,a=n.length;s<a;++s){const o=n[s];r.append(document.createTextNode(o)),s<a-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:t}){var r;u(this,fl)||T(this,fl,{contentsObj:u(this,Ys),richText:u(this,Qs)}),e&&T(this,Ks,null),t&&(T(this,Qs,L(this,Xt,mw).call(this,t)),T(this,Ys,null)),(r=u(this,Fi))==null||r.remove(),T(this,Fi,null)}resetEdited(){var e;u(this,fl)&&({contentsObj:bn(this,Ys)._,richText:bn(this,Qs)._}=u(this,fl),T(this,fl,null),(e=u(this,Fi))==null||e.remove(),T(this,Fi,null),T(this,Ks,null))}forceHide(){T(this,pl,this.isVisible),u(this,pl)&&(u(this,pr).hidden=!0)}maybeShow(){u(this,pl)&&(u(this,Fi)||L(this,Xt,Dp).call(this),T(this,pl,!1),u(this,pr).hidden=!1)}get isVisible(){return u(this,pr).hidden===!1}}ec=new WeakMap,bg=new WeakMap,vg=new WeakMap,tc=new WeakMap,rc=new WeakMap,pr=new WeakMap,Ys=new WeakMap,dl=new WeakMap,Vd=new WeakMap,Gd=new WeakMap,nc=new WeakMap,Zs=new WeakMap,Fi=new WeakMap,Ks=new WeakMap,qd=new WeakMap,Qs=new WeakMap,Wd=new WeakMap,fl=new WeakMap,pl=new WeakMap,Xt=new WeakSet,Tp=function(){const e=u(this,Qs),t=u(this,Ys);return e!=null&&e.str&&(!(t!=null&&t.str)||t.str===e.str)&&u(this,Qs).html||null},B0=function(){var e,t,r;return((r=(t=(e=u(this,Xt,Tp))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:r.fontSize)||0},gw=function(){var e,t,r;return((r=(t=(e=u(this,Xt,Tp))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:r.color)||null},mw=function(e){const t=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},n={style:{color:u(this,Xt,gw),fontSize:u(this,Xt,B0)?`calc(${u(this,Xt,B0)}px * var(--total-scale-factor))`:""}};for(const s of e.split(`
33
33
  `))t.push({name:"span",value:s,attributes:n});return r},bw=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&u(this,Zs))&&L(this,Xt,kp).call(this)},vw=function(){if(u(this,Ks)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:r,pageX:n,pageY:s}}}=u(this,Gd);let a=!!u(this,nc),o=a?u(this,nc):u(this,qd);for(const y of u(this,Vd))if(!o||Qe.intersect(y.data.rect,o)!==null){o=y.data.rect,a=!0;break}const l=Qe.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),h=a?o[2]-o[0]+5:0,d=l[0]+h,p=l[1];T(this,Ks,[100*(d-n)/t,100*(p-s)/r]);const{style:g}=u(this,pr);g.left=`${u(this,Ks)[0]}%`,g.top=`${u(this,Ks)[1]}%`},kp=function(){T(this,Zs,!u(this,Zs)),u(this,Zs)?(L(this,Xt,Dp).call(this),u(this,pr).addEventListener("click",u(this,tc)),u(this,pr).addEventListener("keydown",u(this,ec))):(L(this,Xt,z0).call(this),u(this,pr).removeEventListener("click",u(this,tc)),u(this,pr).removeEventListener("keydown",u(this,ec)))},Dp=function(){u(this,Fi)||this.render(),this.isVisible?u(this,Zs)&&u(this,pr).classList.add("focused"):(L(this,Xt,vw).call(this),u(this,pr).hidden=!1,u(this,pr).style.zIndex=parseInt(u(this,pr).style.zIndex)+1e3)},z0=function(){u(this,pr).classList.remove("focused"),!(u(this,Zs)||!this.isVisible)&&(u(this,pr).hidden=!0,u(this,pr).style.zIndex=parseInt(u(this,pr).style.zIndex)-1e3)};class yw extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=ot.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const r=document.createElement("span");r.textContent=t,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Xd;class qC extends Cr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});N(this,Xd,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:r,height:n}=this,s=this.svgFactory.create(r,n,!0),a=T(this,Xd,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),a.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),a.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),a.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),a.setAttribute("stroke-width",t.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(this,Xd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Xd=new WeakMap;var Yd;class WC extends Cr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});N(this,Yd,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:r,height:n}=this,s=this.svgFactory.create(r,n,!0),a=t.borderStyle.width,o=T(this,Yd,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",n-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(this,Yd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Yd=new WeakMap;var Zd;class XC extends Cr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});N(this,Zd,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:r,height:n}=this,s=this.svgFactory.create(r,n,!0),a=t.borderStyle.width,o=T(this,Zd,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",n/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",n/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(this,Zd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Zd=new WeakMap;var Kd;class ww extends Cr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});N(this,Kd,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:r,borderStyle:n,popupRef:s},width:a,height:o}=this;if(!r)return this.container;const l=this.svgFactory.create(a,o,!0);let c=[];for(let d=0,p=r.length;d<p;d+=2){const g=r[d]-t[0],y=t[3]-r[d+1];c.push(`${g},${y}`)}c=c.join(" ");const h=T(this,Kd,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",c),h.setAttribute("stroke-width",n.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),l.append(h),this.container.append(l),!s&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(this,Kd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Kd=new WeakMap;class YC extends ww{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class ZC extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Qd,gl,Jd,j0;class Hb extends Cr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});N(this,Jd);N(this,Qd,null);N(this,gl,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?ot.HIGHLIGHT:ot.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:r,inkLists:n,borderStyle:s,popupRef:a}}=this,{transform:o,width:l,height:c}=L(this,Jd,j0).call(this,r,t),h=this.svgFactory.create(l,c,!0),d=T(this,Qd,this.svgFactory.createElement("svg:g"));h.append(d),d.setAttribute("stroke-width",s.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",o);for(let p=0,g=n.length;p<g;p++){const y=this.svgFactory.createElement(this.svgElementName);u(this,gl).push(y),y.setAttribute("points",n[p].join(",")),d.append(y)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:r,points:n,rect:s}=t,a=u(this,Qd);if(r>=0&&a.setAttribute("stroke-width",r||1),n)for(let o=0,l=u(this,gl).length;o<l;o++)u(this,gl)[o].setAttribute("points",n[o].join(","));if(s){const{transform:o,width:l,height:c}=L(this,Jd,j0).call(this,this.data.rotation,s);a.parentElement.setAttribute("viewBox",`0 0 ${l} ${c}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return u(this,gl)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qd=new WeakMap,gl=new WeakMap,Jd=new WeakSet,j0=function(t,r){switch(t){case 90:return{transform:`rotate(90) translate(${-r[0]},${r[1]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};case 180:return{transform:`rotate(180) translate(${-r[2]},${r[1]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]};case 270:return{transform:`rotate(270) translate(${-r[2]},${r[3]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};default:return{transform:`translate(${-r[0]},${r[3]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]}}};class xw extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=ot.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const r=document.createElement("mark");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class KC extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),e){const r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class QC extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),e){const r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class JC extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),e){const r=document.createElement("s");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class Aw extends Cr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=ot.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var ef,tf,U0;class eS extends Cr{constructor(t){var n;super(t,{isRenderable:!0});N(this,tf);N(this,ef,null);const{file:r}=this.data;this.filename=r.filename,this.content=r.content,(n=this.linkService.eventBus)==null||n.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:r}=this;let n;r.hasAppearance||r.fillAlpha===0?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),n.addEventListener("dblclick",L(this,tf,U0).bind(this)),T(this,ef,n);const{isMac:s}=qr.platform;return t.addEventListener("keydown",a=>{a.key==="Enter"&&(s?a.metaKey:a.ctrlKey)&&L(this,tf,U0).call(this)}),!r.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),t.append(n),t}getElementsToTriggerPopup(){return u(this,ef)}addHighlightArea(){this.container.classList.add("highlightArea")}}ef=new WeakMap,tf=new WeakSet,U0=function(){var t;(t=this.downloadManager)==null||t.openOrDownloadData(this.content,this.filename)};var rf,ml,$a,nf,go,H0,$0,ic;let $b=(ic=class{constructor({div:e,accessibilityManager:t,annotationCanvasMap:r,annotationEditorUIManager:n,page:s,viewport:a,structTreeLayer:o}){N(this,go);N(this,rf,null);N(this,ml,null);N(this,$a,new Map);N(this,nf,null);this.div=e,T(this,rf,t),T(this,ml,r),T(this,nf,o||null),this.page=s,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=n}hasEditableAnnotations(){return u(this,$a).size>0}async render(e){var a;const{annotations:t}=e,r=this.div;ao(r,this.viewport);const n=new Map,s={data:null,layer:r,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new Lh,annotationStorage:e.annotationStorage||new Lb,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const o of t){if(o.noHTML)continue;const l=o.annotationType===wr.POPUP;if(l){const d=n.get(o.id);if(!d)continue;s.elements=d}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;s.data=o;const c=py.create(s);if(!c.isRenderable)continue;if(!l&&o.popupRef){const d=n.get(o.popupRef);d?d.push(c):n.set(o.popupRef,[c])}const h=c.render();o.hidden&&(h.style.visibility="hidden"),await L(this,go,H0).call(this,h,o.id,s.elements),c._isEditable&&(u(this,$a).set(c.data.id,c),(a=this._annotationEditorUIManager)==null||a.renderAnnotationElement(c))}L(this,go,$0).call(this)}async addLinkAnnotations(e,t){const r={data:null,layer:this.div,linkService:t,svgFactory:new Lh,parent:this};for(const n of e){n.borderStyle||(n.borderStyle=ic._defaultBorderStyle),r.data=n;const s=py.create(r);if(!s.isRenderable)continue;const a=s.render();await L(this,go,H0).call(this,a,n.id,null)}}update({viewport:e}){const t=this.div;this.viewport=e,ao(t,{rotation:e.rotation}),L(this,go,$0).call(this),t.hidden=!1}getEditableAnnotations(){return Array.from(u(this,$a).values())}getEditableAnnotation(e){return u(this,$a).get(e)}static get _defaultBorderStyle(){return Ct(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:su.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},rf=new WeakMap,ml=new WeakMap,$a=new WeakMap,nf=new WeakMap,go=new WeakSet,H0=async function(e,t,r){var o,l;const n=e.firstChild||e,s=n.id=`${Nb}${t}`,a=await((o=u(this,nf))==null?void 0:o.getAriaAttributes(s));if(a)for(const[c,h]of a)n.setAttribute(c,h);r?r.at(-1).container.after(e):(this.div.append(e),(l=u(this,rf))==null||l.moveElementInDOM(this.div,e,n,!1))},$0=function(){var t;if(!u(this,ml))return;const e=this.div;for(const[r,n]of u(this,ml)){const s=e.querySelector(`[data-annotation-id="${r}"]`);if(!s)continue;n.className="annotationContent";const{firstChild:a}=s;a?a.nodeName==="CANVAS"?a.replaceWith(n):a.classList.contains("annotationContent")?a.after(n):a.before(n):s.append(n);const o=u(this,$a).get(r);o&&(o._hasNoCanvas?((t=this._annotationEditorUIManager)==null||t.setMissingCanvas(r,s.id,n),o._hasNoCanvas=!1):o.canvas=n)}u(this,ml).clear()},ic);const sp=/\r\n?|\n/g;var Bi,Xn,sf,bl,Yn,Pr,Ew,_w,Cw,Pp,ca,Rp,Ip,Sw,G0,Tw;const Jt=class Jt extends tr{constructor(t){super({...t,name:"freeTextEditor"});N(this,Pr);N(this,Bi);N(this,Xn,"");N(this,sf,`${this.id}-editor`);N(this,bl,null);N(this,Yn);T(this,Bi,t.color||Jt._defaultColor||tr._defaultLineColor),T(this,Yn,t.fontSize||Jt._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const t=Jt.prototype,r=a=>a.isEmpty(),n=oo.TRANSLATE_SMALL,s=oo.TRANSLATE_BIG;return Ct(this,"_keyboardManager",new Df([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[n,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,n],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:r}]]))}static initialize(t,r){tr.initialize(t,r);const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,r){switch(t){case kt.FREETEXT_SIZE:Jt._defaultFontSize=r;break;case kt.FREETEXT_COLOR:Jt._defaultColor=r;break}}updateParams(t,r){switch(t){case kt.FREETEXT_SIZE:L(this,Pr,Ew).call(this,r);break;case kt.FREETEXT_COLOR:L(this,Pr,_w).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[kt.FREETEXT_SIZE,Jt._defaultFontSize],[kt.FREETEXT_COLOR,Jt._defaultColor||tr._defaultLineColor]]}get propertiesToUpdate(){return[[kt.FREETEXT_SIZE,u(this,Yn)],[kt.FREETEXT_COLOR,u(this,Bi)]]}_translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}getInitialTranslation(){const t=this.parentScale;return[-Jt._internalPadding*t,-(Jt._internalPadding+u(this,Yn))*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),T(this,bl,new AbortController);const t=this._uiManager.combinedSignal(u(this,bl));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){var t;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",u(this,sf)),this._isDraggable=!0,(t=u(this,bl))==null||t.abort(),T(this,bl,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){var r;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),(r=this._initialOptions)!=null&&r.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=u(this,Xn),r=T(this,Xn,L(this,Pr,Cw).call(this).trimEnd());if(t===r)return;const n=s=>{if(T(this,Xn,s),!s){this.remove();return}L(this,Pr,Ip).call(this),this._uiManager.rebuild(this),L(this,Pr,Pp).call(this)};this.addCommands({cmd:()=>{n(r)},undo:()=>{n(t)},mustExec:!1}),L(this,Pr,Pp).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Jt._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,r;(this._isCopy||this.annotationElementId)&&(t=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",u(this,sf)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${u(this,Yn)}px * var(--total-scale-factor))`,n.color=u(this,Bi),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[s,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[h,d]=this.pageDimensions,[p,g]=this.pageTranslation;let y,b;switch(this.rotation){case 0:y=t+(o[0]-p)/h,b=r+this.height-(o[1]-g)/d;break;case 90:y=t+(o[0]-p)/h,b=r-(o[1]-g)/d,[l,c]=[c,-l];break;case 180:y=t-this.width+(o[0]-p)/h,b=r-(o[1]-g)/d,[l,c]=[-l,-c];break;case 270:y=t+(o[0]-p-this.height*d)/h,b=r+(o[1]-g-this.width*h)/d,[l,c]=[-c,l];break}this.setAt(y*s,b*a,l,c)}else this._moveAfterPaste(t,r);L(this,Pr,Ip).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var y,b,w;const r=t.clipboardData||window.clipboardData,{types:n}=r;if(n.length===1&&n[0]==="text/plain")return;t.preventDefault();const s=L(y=Jt,ca,G0).call(y,r.getData("text")||"").replaceAll(sp,`
package/dist/index.esm.js CHANGED
@@ -3882,7 +3882,7 @@ const P_ = () => {
3882
3882
  const v = /* @__PURE__ */ ve.jsx(nn, { variant: "text", color: "gray", children: /* @__PURE__ */ ve.jsx("a", { href: n, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ ve.jsx(i1, { className: "size-4" }) }) });
3883
3883
  return /* @__PURE__ */ ve.jsxs("div", { className: uo("shadow rounded-t-lg flex flex-col h-full", i), children: [
3884
3884
  /* @__PURE__ */ ve.jsx(n1.Header, { onClose: e, right: v, children: s }),
3885
- /* @__PURE__ */ ve.jsx("div", { className: "flex-1 grid", children: /* @__PURE__ */ ve.jsxs("div", { className: "grid relative", children: [
3885
+ /* @__PURE__ */ ve.jsx("div", { className: "flex flex-col h-full justify-between", children: /* @__PURE__ */ ve.jsxs("div", { className: "grid relative h-full", children: [
3886
3886
  /* @__PURE__ */ ve.jsx(
3887
3887
  "div",
3888
3888
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lateralus-ai/shipping-ui",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "Shared UI theme and components for Lateralus shipping applications",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.esm.js",
@@ -1,21 +1,21 @@
1
- import { IconButton, ButtonGroup, Tooltip } from "@material-tailwind/react";
2
- import { ModalPanel } from "../ModalPanel";
3
- import ExpandIcon from "../icons/ExpandIcon";
4
- import { Icon } from "@iconify/react";
5
- import { ChangeEvent, useEffect, useState } from "react";
6
- import { useZoom } from "./useZoom";
7
- import { useRotation } from "./useRotation";
8
- import { usePanning } from "./usePanning";
9
- import { usePageManagement } from "./usePageManagement";
10
- import { cn } from "../../utils/cn";
1
+ import { IconButton, ButtonGroup, Tooltip } from "@material-tailwind/react"
2
+ import { ModalPanel } from "../ModalPanel"
3
+ import ExpandIcon from "../icons/ExpandIcon"
4
+ import { Icon } from "@iconify/react"
5
+ import { ChangeEvent, useEffect, useState } from "react"
6
+ import { useZoom } from "./useZoom"
7
+ import { useRotation } from "./useRotation"
8
+ import { usePanning } from "./usePanning"
9
+ import { usePageManagement } from "./usePageManagement"
10
+ import { cn } from "../../utils/cn"
11
11
 
12
12
  interface ImageViewerProps {
13
- className?: string;
14
- documentUrl?: string;
15
- onClose: () => void;
16
- totalPages: number;
17
- getImageSrc: (page: number) => string | Promise<string>;
18
- title?: string;
13
+ className?: string
14
+ documentUrl?: string
15
+ onClose: () => void
16
+ totalPages: number
17
+ getImageSrc: (page: number) => string | Promise<string>
18
+ title?: string
19
19
  }
20
20
 
21
21
  export const ImageViewer = ({
@@ -26,33 +26,33 @@ export const ImageViewer = ({
26
26
  documentUrl,
27
27
  title = "PDF Viewer",
28
28
  }: ImageViewerProps) => {
29
- const [zoom, zoomActions] = useZoom();
30
- const [rotation, rotationActions] = useRotation();
31
- const [{ pan, isDragging }, panActions] = usePanning();
32
- const [{ currentPage }, pageActions] = usePageManagement(totalPages);
29
+ const [zoom, zoomActions] = useZoom()
30
+ const [rotation, rotationActions] = useRotation()
31
+ const [{ pan, isDragging }, panActions] = usePanning()
32
+ const [{ currentPage }, pageActions] = usePageManagement(totalPages)
33
33
  const [imageSrc, setImageSrc] = useState<string>(() => {
34
- const initialResult = getImageSrc(currentPage);
35
- return typeof initialResult === "string" ? initialResult : "";
36
- });
34
+ const initialResult = getImageSrc(currentPage)
35
+ return typeof initialResult === "string" ? initialResult : ""
36
+ })
37
37
 
38
38
  useEffect(() => {
39
- let isActive = true;
39
+ let isActive = true
40
40
 
41
41
  const loadImage = async () => {
42
- const result = getImageSrc(currentPage);
43
- const resolvedSrc = await Promise.resolve(result);
42
+ const result = getImageSrc(currentPage)
43
+ const resolvedSrc = await Promise.resolve(result)
44
44
 
45
45
  if (isActive) {
46
- setImageSrc(resolvedSrc);
46
+ setImageSrc(resolvedSrc)
47
47
  }
48
- };
48
+ }
49
49
 
50
- void loadImage();
50
+ void loadImage()
51
51
 
52
52
  return () => {
53
- isActive = false;
54
- };
55
- }, [currentPage, getImageSrc]);
53
+ isActive = false
54
+ }
55
+ }, [currentPage, getImageSrc])
56
56
 
57
57
  const rightButtons = (
58
58
  <IconButton variant="text" color="gray">
@@ -60,7 +60,7 @@ export const ImageViewer = ({
60
60
  <ExpandIcon className="size-4" />
61
61
  </a>
62
62
  </IconButton>
63
- );
63
+ )
64
64
 
65
65
  return (
66
66
  <div className={cn("shadow rounded-t-lg flex flex-col h-full", className)}>
@@ -68,8 +68,8 @@ export const ImageViewer = ({
68
68
  {title}
69
69
  </ModalPanel.Header>
70
70
 
71
- <div className="flex-1 grid">
72
- <div className="grid relative">
71
+ <div className="flex flex-col h-full justify-between">
72
+ <div className="grid relative h-full">
73
73
  <div
74
74
  className="overflow-hidden col-start-1 row-start-1 bg-gray-200 h-full relative"
75
75
  onMouseMove={panActions.handleMouseMove}
@@ -120,8 +120,8 @@ export const ImageViewer = ({
120
120
  <button
121
121
  className="!bg-white text-center cursor-pointer w-[60px]"
122
122
  onClick={() => {
123
- zoomActions.reset();
124
- panActions.reset();
123
+ zoomActions.reset()
124
+ panActions.reset()
125
125
  }}
126
126
  >
127
127
  {zoom}%
@@ -169,9 +169,9 @@ export const ImageViewer = ({
169
169
  className="bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]"
170
170
  value={currentPage}
171
171
  onChange={(e: ChangeEvent<HTMLInputElement>) => {
172
- const page = parseInt(e.target.value);
172
+ const page = parseInt(e.target.value)
173
173
  if (!isNaN(page)) {
174
- pageActions.goToPage(page);
174
+ pageActions.goToPage(page)
175
175
  }
176
176
  }}
177
177
  type="number"
@@ -195,5 +195,5 @@ export const ImageViewer = ({
195
195
  </div>
196
196
  </div>
197
197
  </div>
198
- );
199
- };
198
+ )
199
+ }