@lateralus-ai/shipping-ui 1.3.1 → 1.3.3

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
@@ -18,7 +18,7 @@
18
18
  `+le+Q}}var ce=!1,Ae;{var Se=typeof WeakMap=="function"?WeakMap:Map;Ae=new Se}function Ne(Q,Re){if(!Q||ce)return"";{var He=Ae.get(Q);if(He!==void 0)return He}var Je;ce=!0;var Pt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var jt;jt=se.current,se.current=null,ae();try{if(Re){var At=function(){throw Error()};if(Object.defineProperty(At.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(At,[])}catch(Xr){Je=Xr}Reflect.construct(Q,[],At)}else{try{At.call()}catch(Xr){Je=Xr}Q.call(At.prototype)}}else{try{throw Error()}catch(Xr){Je=Xr}Q()}}catch(Xr){if(Xr&&Je&&typeof Xr.stack=="string"){for(var yt=Xr.stack.split(`
19
19
  `),Br=Je.stack.split(`
20
20
  `),Yt=yt.length-1,Ut=Br.length-1;Yt>=1&&Ut>=0&&yt[Yt]!==Br[Ut];)Ut--;for(;Yt>=1&&Ut>=0;Yt--,Ut--)if(yt[Yt]!==Br[Ut]){if(Yt!==1||Ut!==1)do if(Yt--,Ut--,Ut<0||yt[Yt]!==Br[Ut]){var an=`
21
- `+yt[Yt].replace(" at new "," at ");return Q.displayName&&an.includes("<anonymous>")&&(an=an.replace("<anonymous>",Q.displayName)),typeof Q=="function"&&Ae.set(Q,an),an}while(Yt>=1&&Ut>=0);break}}}finally{ce=!1,se.current=jt,H(),Error.prepareStackTrace=Pt}var pa=Q?Q.displayName||Q.name:"",_s=pa?oe(pa):"";return typeof Q=="function"&&Ae.set(Q,_s),_s}function Te(Q,Re,He){return Ne(Q,!1)}function x(Q){var Re=Q.prototype;return!!(Re&&Re.isReactComponent)}function U(Q,Re,He){if(Q==null)return"";if(typeof Q=="function")return Ne(Q,x(Q));if(typeof Q=="string")return oe(Q);switch(Q){case c:return oe("Suspense");case h:return oe("SuspenseList")}if(typeof Q=="object")switch(Q.$$typeof){case l:return Te(Q.render);case d:return U(Q.type,Re,He);case p:{var Je=Q,Pt=Je._payload,jt=Je._init;try{return U(jt(Pt),Re,He)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,F={},M=v.ReactDebugCurrentFrame;function q(Q){if(Q){var Re=Q._owner,He=U(Q.type,Q._source,Re?Re.type:null);M.setExtraStackFrame(He)}else M.setExtraStackFrame(null)}function de(Q,Re,He,Je,Pt){{var jt=Function.call.bind(B);for(var At in Q)if(jt(Q,At)){var yt=void 0;try{if(typeof Q[At]!="function"){var Br=Error((Je||"React class")+": "+He+" type `"+At+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof Q[At]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Br.name="Invariant Violation",Br}yt=Q[At](Re,At,Je,He,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Yt){yt=Yt}yt&&!(yt instanceof Error)&&(q(Pt),A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Je||"React class",He,At,typeof yt),q(null)),yt instanceof Error&&!(yt.message in F)&&(F[yt.message]=!0,q(Pt),A("Failed %s type: %s",He,yt.message),q(null))}}}var we=Array.isArray;function ee(Q){return we(Q)}function Ee(Q){{var Re=typeof Symbol=="function"&&Symbol.toStringTag,He=Re&&Q[Symbol.toStringTag]||Q.constructor.name||"Object";return He}}function De(Q){try{return Ce(Q),!1}catch{return!0}}function Ce(Q){return""+Q}function Me(Q){if(De(Q))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ee(Q)),Ce(Q)}var $e=v.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Tt,nr;function yr(Q){if(B.call(Q,"ref")){var Re=Object.getOwnPropertyDescriptor(Q,"ref").get;if(Re&&Re.isReactWarning)return!1}return Q.ref!==void 0}function rr(Q){if(B.call(Q,"key")){var Re=Object.getOwnPropertyDescriptor(Q,"key").get;if(Re&&Re.isReactWarning)return!1}return Q.key!==void 0}function ge(Q,Re){typeof Q.ref=="string"&&$e.current}function ve(Q,Re){{var He=function(){Tt||(Tt=!0,A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};He.isReactWarning=!0,Object.defineProperty(Q,"key",{get:He,configurable:!0})}}function he(Q,Re){{var He=function(){nr||(nr=!0,A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};He.isReactWarning=!0,Object.defineProperty(Q,"ref",{get:He,configurable:!0})}}var me=function(Q,Re,He,Je,Pt,jt,At){var yt={$$typeof:e,type:Q,key:Re,ref:He,props:At,_owner:jt};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Je}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Pt}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function Fe(Q,Re,He,Je,Pt){{var jt,At={},yt=null,Br=null;He!==void 0&&(Me(He),yt=""+He),rr(Re)&&(Me(Re.key),yt=""+Re.key),yr(Re)&&(Br=Re.ref,ge(Re,Pt));for(jt in Re)B.call(Re,jt)&&!Xe.hasOwnProperty(jt)&&(At[jt]=Re[jt]);if(Q&&Q.defaultProps){var Yt=Q.defaultProps;for(jt in Yt)At[jt]===void 0&&(At[jt]=Yt[jt])}if(yt||Br){var Ut=typeof Q=="function"?Q.displayName||Q.name||"Unknown":Q;yt&&ve(At,Ut),Br&&he(At,Ut)}return me(Q,yt,Br,Pt,Je,$e.current,At)}}var Ue=v.ReactCurrentOwner,st=v.ReactDebugCurrentFrame;function Ye(Q){if(Q){var Re=Q._owner,He=U(Q.type,Q._source,Re?Re.type:null);st.setExtraStackFrame(He)}else st.setExtraStackFrame(null)}var ct;ct=!1;function pt(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===e}function mt(){{if(Ue.current){var Q=X(Ue.current.type);if(Q)return`
21
+ `+yt[Yt].replace(" at new "," at ");return Q.displayName&&an.includes("<anonymous>")&&(an=an.replace("<anonymous>",Q.displayName)),typeof Q=="function"&&Ae.set(Q,an),an}while(Yt>=1&&Ut>=0);break}}}finally{ce=!1,se.current=jt,H(),Error.prepareStackTrace=Pt}var pa=Q?Q.displayName||Q.name:"",_s=pa?oe(pa):"";return typeof Q=="function"&&Ae.set(Q,_s),_s}function Te(Q,Re,He){return Ne(Q,!1)}function x(Q){var Re=Q.prototype;return!!(Re&&Re.isReactComponent)}function U(Q,Re,He){if(Q==null)return"";if(typeof Q=="function")return Ne(Q,x(Q));if(typeof Q=="string")return oe(Q);switch(Q){case c:return oe("Suspense");case h:return oe("SuspenseList")}if(typeof Q=="object")switch(Q.$$typeof){case l:return Te(Q.render);case d:return U(Q.type,Re,He);case p:{var Je=Q,Pt=Je._payload,jt=Je._init;try{return U(jt(Pt),Re,He)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,F={},M=v.ReactDebugCurrentFrame;function q(Q){if(Q){var Re=Q._owner,He=U(Q.type,Q._source,Re?Re.type:null);M.setExtraStackFrame(He)}else M.setExtraStackFrame(null)}function de(Q,Re,He,Je,Pt){{var jt=Function.call.bind(B);for(var At in Q)if(jt(Q,At)){var yt=void 0;try{if(typeof Q[At]!="function"){var Br=Error((Je||"React class")+": "+He+" type `"+At+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof Q[At]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Br.name="Invariant Violation",Br}yt=Q[At](Re,At,Je,He,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Yt){yt=Yt}yt&&!(yt instanceof Error)&&(q(Pt),A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Je||"React class",He,At,typeof yt),q(null)),yt instanceof Error&&!(yt.message in F)&&(F[yt.message]=!0,q(Pt),A("Failed %s type: %s",He,yt.message),q(null))}}}var ye=Array.isArray;function ee(Q){return ye(Q)}function Ee(Q){{var Re=typeof Symbol=="function"&&Symbol.toStringTag,He=Re&&Q[Symbol.toStringTag]||Q.constructor.name||"Object";return He}}function De(Q){try{return Ce(Q),!1}catch{return!0}}function Ce(Q){return""+Q}function Me(Q){if(De(Q))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ee(Q)),Ce(Q)}var $e=v.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Tt,nr;function yr(Q){if(B.call(Q,"ref")){var Re=Object.getOwnPropertyDescriptor(Q,"ref").get;if(Re&&Re.isReactWarning)return!1}return Q.ref!==void 0}function rr(Q){if(B.call(Q,"key")){var Re=Object.getOwnPropertyDescriptor(Q,"key").get;if(Re&&Re.isReactWarning)return!1}return Q.key!==void 0}function ge(Q,Re){typeof Q.ref=="string"&&$e.current}function ve(Q,Re){{var He=function(){Tt||(Tt=!0,A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};He.isReactWarning=!0,Object.defineProperty(Q,"key",{get:He,configurable:!0})}}function he(Q,Re){{var He=function(){nr||(nr=!0,A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};He.isReactWarning=!0,Object.defineProperty(Q,"ref",{get:He,configurable:!0})}}var me=function(Q,Re,He,Je,Pt,jt,At){var yt={$$typeof:e,type:Q,key:Re,ref:He,props:At,_owner:jt};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Je}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Pt}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function Fe(Q,Re,He,Je,Pt){{var jt,At={},yt=null,Br=null;He!==void 0&&(Me(He),yt=""+He),rr(Re)&&(Me(Re.key),yt=""+Re.key),yr(Re)&&(Br=Re.ref,ge(Re,Pt));for(jt in Re)B.call(Re,jt)&&!Xe.hasOwnProperty(jt)&&(At[jt]=Re[jt]);if(Q&&Q.defaultProps){var Yt=Q.defaultProps;for(jt in Yt)At[jt]===void 0&&(At[jt]=Yt[jt])}if(yt||Br){var Ut=typeof Q=="function"?Q.displayName||Q.name||"Unknown":Q;yt&&ve(At,Ut),Br&&he(At,Ut)}return me(Q,yt,Br,Pt,Je,$e.current,At)}}var Ue=v.ReactCurrentOwner,st=v.ReactDebugCurrentFrame;function Ye(Q){if(Q){var Re=Q._owner,He=U(Q.type,Q._source,Re?Re.type:null);st.setExtraStackFrame(He)}else st.setExtraStackFrame(null)}var ct;ct=!1;function pt(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===e}function mt(){{if(Ue.current){var Q=X(Ue.current.type);if(Q)return`
22
22
 
23
23
  Check the render method of \``+Q+"`."}return""}}function Ft(Q){return""}var at={};function nn(Q){{var Re=mt();if(!Re){var He=typeof Q=="string"?Q:Q.displayName||Q.name;He&&(Re=`
24
24
 
@@ -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} />`,Jl,_s,Kg,_s),Un[_s+Jl]=!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=PE():t0.exports=RE();var ye=t0.exports;const IE=()=>ye.jsx("div",{className:"bg-red-800 text-white p-2",children:"Hello world"});function NE(){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 ME(i){var e=OE(i);function t(n){var s=n.split(Db);return s[0]===""&&s.length!==1&&s.shift(),B2(s,e)||LE(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 LE(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 OE(i){var e=i.theme,t=i.prefix,r={nextPart:new Map,validators:[]},n=BE(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(FE(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 FE(i){return i.isThemeGetter}function BE(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 zE(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 jE(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 UE(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 HE(i){return{cache:zE(i.cacheSize),splitModifiers:jE(i),...ME(i)}}var $E=/\s+/;function VE(i,e){var t=e.splitModifiers,r=e.getClassGroupId,n=e.getConflictingClassGroupIds,s=new Set;return i.trim().split($E).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=UE(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 GE(){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=HE(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=VE(c,r);return s(c,d),d}return function(){return a(NE.apply(null,arguments))}}function sr(i){var e=function(r){return r[i]||[]};return e.isThemeGetter=!0,e}var j2=/^\[(?:([a-z-]+):)?(.+)\]$/i,qE=/^\d+\/\d+$/,WE=new Set(["px","full","screen"]),XE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh)/,ZE=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Di(i){return Sh(i)||WE.has(i)||qE.test(i)||Eo(i)}function Eo(i){return Gl(i,"length",t_)}function KE(i){return Gl(i,"size",U2)}function QE(i){return Gl(i,"position",U2)}function JE(i){return Gl(i,"url",r_)}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 XE.test(i)}function e_(i){return Gl(i,"",n_)}function Gl(i,e,t){var r=j2.exec(i);return r?r[1]?r[1]===e:t(r[2]):!1}function t_(i){return YE.test(i)}function U2(){return!1}function r_(i){return i.startsWith("url(")}function Wv(i){return Number.isInteger(Number(i))}function n_(i){return ZE.test(i)}function i_(){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,Eo],brightness:K(),borderColor:[i],borderRadius:["none","","full",ma,Eo],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,Eo]}],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,Eo]}],"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",Eo]}],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",Eo]}],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(),[QE])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",KE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},JE]}],"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,e_]}],"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 s_=GE(i_);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 a_(){for(var i,e,t=0,r="";t<arguments.length;)(i=arguments[t++])&&(e=H2(i))&&(r&&(r+=" "),r+=e);return r}function zl(...i){return s_(a_(i))}function o_({className:i="",size:e="1em"}){return ye.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:[ye.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"}),ye.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 l_({className:i="",size:e="1em"}){return ye.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:ye.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 u_=({tooltipContent:i="Send message",className:e,...t})=>{const[r,n]=Pe.useState(!1);return ye.jsx(Mt.Tooltip,{content:i,children:ye.jsx(Mt.IconButton,{variant:"text",color:"gray",className:zl(e,"hover:rounded-lg hover:bg-gray-100"),type:"submit",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),...t,children:r?ye.jsx(l_,{className:"size-6 "}):ye.jsx(o_,{className:"size-6 "})})})},$2=({onSubmit:i=()=>{},...e})=>ye.jsx(TE,{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}),c_=({bottom:i,right:e,top:t,textArea:r=ye.jsx($2,{}),...n})=>ye.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,ye.jsxs("div",{className:"flex gap-2 p-4 rounded-lg bg-white",children:[ye.jsxs("div",{className:"grow flex flex-col items-start justify-center",children:[r,i]}),ye.jsx("div",{className:"shrink flex items-end justify-end",children:e})]})]}),h_=Object.freeze(Object.defineProperty({__proto__:null,Container:c_,SubmitButton:u_,Textarea:$2},Symbol.toStringTag,{value:"Module"})),Ic=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 ye.jsx(Ic.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(Ic);return ye.jsx("div",{className:zl(i,r&&"shadow-lg",r&&!n?"w-auto":"w-[280px]","bg-gray-50 p-2 flex flex-col justify-between items-center rounded-lg"),onMouseEnter:()=>r&&s(!0),onMouseLeave:()=>r&&s(!1),...t,children:e})},d_=({className:i,children:e,isCollapsed:t,onSwitchLayout:r,...n})=>ye.jsx(V2,{isCollapsed:t,onSwitchLayout:r,children:ye.jsx(G2,{className:i,...n,children:e})}),f_=({icon:i,children:e,...t})=>{const{isCollapsed:r,isHovered:n}=Pe.useContext(Ic);return ye.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 p_(i){return ye.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ye.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 g_(i){return ye.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ye.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 m_=()=>{const{isCollapsed:i,isHovered:e,toggleCollapsed:t}=Pe.useContext(Ic);return i&&!e?null:ye.jsx(Mt.IconButton,{variant:"text",color:"gray",onClick:()=>t(),children:i?ye.jsx(p_,{className:"size-4"}):ye.jsx(g_,{className:"size-4"})})},b_=({children:i,className:e,icon:t,isActive:r,trailing:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(Ic);return ye.jsxs("div",{className:zl(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:[ye.jsxs("div",{className:"flex items-center gap-2",children:[t,(!a||o)&&i]}),(!a||o)&&n]})},v_=({children:i,className:e,isActive:t,trailing:r,icon:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(Ic);return ye.jsxs("div",{className:zl(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:[ye.jsxs("div",{className:"flex items-center gap-2 overflow-auto",children:[(!a||o)&&n," ",(!a||o)&&i]}),(!a||o)&&r]})},y_=Object.freeze(Object.defineProperty({__proto__:null,Button:f_,Container:G2,Item:b_,Layout:d_,Provider:V2,SecondaryItem:v_,ToggleCollapseButton:m_},Symbol.toStringTag,{value:"Module"})),w_=i=>ye.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ye.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"})}),x_=({onClose:i,right:e,children:t})=>ye.jsxs("div",{className:"bg-gray-50 flex gap-2 items-center px-2 py-3 rounded-t-xl",children:[ye.jsx("div",{className:"grow text-subheader-em",children:t}),ye.jsxs("div",{className:"flex items-center gap-4",children:[e,ye.jsx(Mt.IconButton,{variant:"text",size:"sm",color:"gray",className:"rounded-full",onClick:i,children:ye.jsx(w_,{className:"size-4 text-gray-600"})})]})]}),q2={Header:x_},W2=i=>ye.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:ye.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"})}),X2=(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)))}}]},Y2=()=>{const[i,e]=Pe.useState(0);return[i,{rotateClockwise:()=>e(r=>(r+90)%360),rotateCounterClockwise:()=>e(r=>(r-90+360)%360)}]},Z2=()=>{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})}]},K2=(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]},A_=({className:i,onClose:e,totalPages:t,getImageSrc:r,documentUrl:n,title:s="PDF Viewer"})=>{const[a,o]=X2(),[l,c]=Y2(),[{pan:h,isDragging:d},p]=Z2(),[{currentPage:g},y]=K2(t),b=ye.jsx(Mt.IconButton,{variant:"text",color:"gray",children:ye.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:ye.jsx(W2,{className:"size-4"})})});return ye.jsxs("div",{className:zl("shadow rounded-t-lg flex flex-col h-full",i),children:[ye.jsx(q2.Header,{onClose:e,right:b,children:s}),ye.jsx("div",{className:"flex-1 grid",children:ye.jsxs("div",{className:"grid relative",children:[ye.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:ye.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:ye.jsx("div",{style:{transform:`scale(${a/100}) rotate(${l}deg)`,transformOrigin:"center",transition:d?"none":"transform 0.3s ease"},children:ye.jsx("img",{src:r(g),style:{userSelect:"none",pointerEvents:"none"}})})})}),ye.jsxs("div",{className:"col-start-1 row-start-1 self-end p-4 flex gap-2 justify-between w-full z-10",children:[ye.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomOut,children:ye.jsx(vi.Icon,{icon:"lucide:minus"})}),ye.jsx(Mt.Tooltip,{content:"Click to reset zoom and pan",children:ye.jsxs("button",{className:"!bg-white text-center cursor-pointer w-[60px]",onClick:()=>{o.reset(),p.reset()},children:[a,"%"]})}),ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomIn,children:ye.jsx(vi.Icon,{icon:"lucide:plus"})})]}),ye.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateClockwise,children:ye.jsx(vi.Icon,{icon:"lucide:iteration-cw"})}),ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateCounterClockwise,children:ye.jsx(vi.Icon,{icon:"lucide:iteration-ccw"})})]}),ye.jsxs(Mt.ButtonGroup,{className:"divide-x-0 ",children:[ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.prevPage,disabled:g===1,children:ye.jsx(vi.Icon,{icon:"lucide:chevron-left"})}),ye.jsx("input",{className:"bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]",value:g,onChange:w=>{const v=parseInt(w.target.value);isNaN(v)||y.goToPage(v)},type:"number",min:"1",max:t}),ye.jsxs("div",{className:"flex items-center bg-white px-2",children:["of ",t]}),ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.nextPage,disabled:g===t,children:ye.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},Q2="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},J2={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},iu={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},e1={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Cg=Cf.WARNINGS;function E_(i){Number.isInteger(i)&&(Cg=i)}function __(){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 C_(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=P_(i)}catch{}}const r=e?URL.parse(i,e):URL.parse(i);return C_(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 ql=function(){function e(t,r){this.message=t,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class Xv extends ql{constructor(e,t){super(e,"PasswordException"),this.code=t}}class dm extends ql{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class Wp extends ql{constructor(e){super(e,"InvalidPDFException")}}class Rh extends ql{constructor(e,t,r){super(e,"ResponseException"),this.status=t,this.missing=r}}class S_ extends ql{constructor(e){super(e,"FormatError")}}class ha extends ql{constructor(e){super(e,"AbortException")}}function t1(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 T_(i){return String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255)}function k_(){const i=new Uint8Array(4);return i[0]=1,new Uint32Array(i.buffer,0,1)[0]===1}function D_(){try{return new Function(""),!0}catch{return!1}}class qr{static get isLittleEndian(){return Ct(this,"isLittleEndian",k_())}static get isEvalSupported(){return Ct(this,"isEvalSupported",D_())}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 P_(i){return decodeURIComponent(escape(i))}let pm=null,Yv=null;function r1(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),t1(i)}const Nb="pdfjs_internal_id_";function R_(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 n1(i){return Uint8Array.prototype.toBase64?i.toBase64():btoa(t1(i))}function I_(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",To=class To{};Ie(To,"CSS",96),Ie(To,"PDF",72),Ie(To,"PDF_TO_CSS_UNITS",To.CSS/To.PDF);let da=To;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 ql{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 i1(i){return[i]=i.split(/[#?]/,1),i.substring(i.lastIndexOf("/")+1)}function s1(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} />`,Jl,_s,Kg,_s),Un[_s+Jl]=!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=PE():t0.exports=RE();var we=t0.exports;const IE=()=>we.jsx("div",{className:"bg-red-800 text-white p-2",children:"Hello world"});function NE(){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 ME(i){var e=OE(i);function t(n){var s=n.split(Db);return s[0]===""&&s.length!==1&&s.shift(),B2(s,e)||LE(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 LE(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 OE(i){var e=i.theme,t=i.prefix,r={nextPart:new Map,validators:[]},n=BE(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(FE(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 FE(i){return i.isThemeGetter}function BE(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 zE(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 jE(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 UE(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 HE(i){return{cache:zE(i.cacheSize),splitModifiers:jE(i),...ME(i)}}var $E=/\s+/;function VE(i,e){var t=e.splitModifiers,r=e.getClassGroupId,n=e.getConflictingClassGroupIds,s=new Set;return i.trim().split($E).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=UE(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 GE(){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=HE(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=VE(c,r);return s(c,d),d}return function(){return a(NE.apply(null,arguments))}}function sr(i){var e=function(r){return r[i]||[]};return e.isThemeGetter=!0,e}var j2=/^\[(?:([a-z-]+):)?(.+)\]$/i,qE=/^\d+\/\d+$/,WE=new Set(["px","full","screen"]),XE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh)/,ZE=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Di(i){return Sh(i)||WE.has(i)||qE.test(i)||Eo(i)}function Eo(i){return Gl(i,"length",t_)}function KE(i){return Gl(i,"size",U2)}function QE(i){return Gl(i,"position",U2)}function JE(i){return Gl(i,"url",r_)}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 XE.test(i)}function e_(i){return Gl(i,"",n_)}function Gl(i,e,t){var r=j2.exec(i);return r?r[1]?r[1]===e:t(r[2]):!1}function t_(i){return YE.test(i)}function U2(){return!1}function r_(i){return i.startsWith("url(")}function Wv(i){return Number.isInteger(Number(i))}function n_(i){return ZE.test(i)}function i_(){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,Eo],brightness:K(),borderColor:[i],borderRadius:["none","","full",ma,Eo],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,Eo]}],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,Eo]}],"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",Eo]}],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",Eo]}],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(),[QE])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",KE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},JE]}],"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,e_]}],"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 s_=GE(i_);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 a_(){for(var i,e,t=0,r="";t<arguments.length;)(i=arguments[t++])&&(e=H2(i))&&(r&&(r+=" "),r+=e);return r}function zl(...i){return s_(a_(i))}function o_({className:i="",size:e="1em"}){return we.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:[we.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"}),we.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 l_({className:i="",size:e="1em"}){return we.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:we.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 u_=({tooltipContent:i="Send message",className:e,...t})=>{const[r,n]=Pe.useState(!1);return we.jsx(Mt.Tooltip,{content:i,children:we.jsx(Mt.IconButton,{variant:"text",color:"gray",className:zl(e,"hover:rounded-lg hover:bg-gray-100"),type:"submit",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),...t,children:r?we.jsx(l_,{className:"size-6 "}):we.jsx(o_,{className:"size-6 "})})})},$2=({onSubmit:i=()=>{},...e})=>we.jsx(TE,{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}),c_=({bottom:i,right:e,top:t,textArea:r=we.jsx($2,{}),...n})=>we.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,we.jsxs("div",{className:"flex gap-2 p-4 rounded-lg bg-white",children:[we.jsxs("div",{className:"grow flex flex-col items-start justify-center",children:[r,i]}),we.jsx("div",{className:"shrink flex items-end justify-end",children:e})]})]}),h_=Object.freeze(Object.defineProperty({__proto__:null,Container:c_,SubmitButton:u_,Textarea:$2},Symbol.toStringTag,{value:"Module"})),Ic=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 we.jsx(Ic.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(Ic);return we.jsx("div",{className:zl(i,r&&"shadow-lg",r&&!n?"w-auto":"w-[280px]","bg-gray-50 p-2 flex flex-col justify-between items-center rounded-lg"),onMouseEnter:()=>r&&s(!0),onMouseLeave:()=>r&&s(!1),...t,children:e})},d_=({className:i,children:e,isCollapsed:t,onSwitchLayout:r,...n})=>we.jsx(V2,{isCollapsed:t,onSwitchLayout:r,children:we.jsx(G2,{className:i,...n,children:e})}),f_=({icon:i,children:e,...t})=>{const{isCollapsed:r,isHovered:n}=Pe.useContext(Ic);return we.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 p_(i){return we.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:we.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 g_(i){return we.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:we.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 m_=()=>{const{isCollapsed:i,isHovered:e,toggleCollapsed:t}=Pe.useContext(Ic);return i&&!e?null:we.jsx(Mt.IconButton,{variant:"text",color:"gray",onClick:()=>t(),children:i?we.jsx(p_,{className:"size-4"}):we.jsx(g_,{className:"size-4"})})},b_=({children:i,className:e,icon:t,isActive:r,trailing:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(Ic);return we.jsxs("div",{className:zl(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:[we.jsxs("div",{className:"flex items-center gap-2",children:[t,(!a||o)&&i]}),(!a||o)&&n]})},v_=({children:i,className:e,isActive:t,trailing:r,icon:n,...s})=>{const{isCollapsed:a,isHovered:o}=Pe.useContext(Ic);return we.jsxs("div",{className:zl(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:[we.jsxs("div",{className:"flex items-center gap-2 overflow-auto",children:[(!a||o)&&n," ",(!a||o)&&i]}),(!a||o)&&r]})},y_=Object.freeze(Object.defineProperty({__proto__:null,Button:f_,Container:G2,Item:b_,Layout:d_,Provider:V2,SecondaryItem:v_,ToggleCollapseButton:m_},Symbol.toStringTag,{value:"Module"})),w_=i=>we.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:we.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"})}),x_=({onClose:i,right:e,children:t})=>we.jsxs("div",{className:"bg-gray-50 flex gap-2 items-center px-2 py-3 rounded-t-xl",children:[we.jsx("div",{className:"grow text-subheader-em",children:t}),we.jsxs("div",{className:"flex items-center gap-4",children:[e,we.jsx(Mt.IconButton,{variant:"text",size:"sm",color:"gray",className:"rounded-full",onClick:i,children:we.jsx(w_,{className:"size-4 text-gray-600"})})]})]}),q2={Header:x_},W2=i=>we.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,children:we.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"})}),X2=(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)))}}]},Y2=()=>{const[i,e]=Pe.useState(0);return[i,{rotateClockwise:()=>e(r=>(r+90)%360),rotateCounterClockwise:()=>e(r=>(r-90+360)%360)}]},Z2=()=>{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})}]},K2=(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]},A_=({className:i,onClose:e,totalPages:t,getImageSrc:r,documentUrl:n,title:s="PDF Viewer"})=>{const[a,o]=X2(),[l,c]=Y2(),[{pan:h,isDragging:d},p]=Z2(),[{currentPage:g},y]=K2(t),b=we.jsx(Mt.IconButton,{variant:"text",color:"gray",children:we.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:we.jsx(W2,{className:"size-4"})})});return we.jsxs("div",{className:zl("shadow rounded-t-lg flex flex-col h-full",i),children:[we.jsx(q2.Header,{onClose:e,right:b,children:s}),we.jsx("div",{className:"flex-1 grid",children:we.jsxs("div",{className:"grid relative",children:[we.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:we.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:we.jsx("div",{style:{transform:`scale(${a/100}) rotate(${l}deg)`,transformOrigin:"center",transition:d?"none":"transform 0.3s ease"},children:we.jsx("img",{src:r(g),style:{userSelect:"none",pointerEvents:"none"}})})})}),we.jsxs("div",{className:"col-start-1 row-start-1 self-end p-4 flex gap-2 justify-between w-full z-10",children:[we.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomOut,children:we.jsx(vi.Icon,{icon:"lucide:minus"})}),we.jsx(Mt.Tooltip,{content:"Click to reset zoom and pan",children:we.jsxs("button",{className:"!bg-white text-center cursor-pointer w-[60px]",onClick:()=>{o.reset(),p.reset()},children:[a,"%"]})}),we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:o.zoomIn,children:we.jsx(vi.Icon,{icon:"lucide:plus"})})]}),we.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateClockwise,children:we.jsx(vi.Icon,{icon:"lucide:iteration-cw"})}),we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:c.rotateCounterClockwise,children:we.jsx(vi.Icon,{icon:"lucide:iteration-ccw"})})]}),we.jsxs(Mt.ButtonGroup,{className:"divide-x-0 ",children:[we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.prevPage,disabled:g===1,children:we.jsx(vi.Icon,{icon:"lucide:chevron-left"})}),we.jsx("input",{className:"bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]",value:g,onChange:w=>{const v=parseInt(w.target.value);isNaN(v)||y.goToPage(v)},type:"number",min:"1",max:t}),we.jsxs("div",{className:"flex items-center bg-white px-2",children:["of ",t]}),we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:y.nextPage,disabled:g===t,children:we.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},Q2="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},J2={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},iu={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},e1={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Cg=Cf.WARNINGS;function E_(i){Number.isInteger(i)&&(Cg=i)}function __(){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 C_(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=P_(i)}catch{}}const r=e?URL.parse(i,e):URL.parse(i);return C_(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 ql=function(){function e(t,r){this.message=t,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class Xv extends ql{constructor(e,t){super(e,"PasswordException"),this.code=t}}class dm extends ql{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class Wp extends ql{constructor(e){super(e,"InvalidPDFException")}}class Rh extends ql{constructor(e,t,r){super(e,"ResponseException"),this.status=t,this.missing=r}}class S_ extends ql{constructor(e){super(e,"FormatError")}}class ha extends ql{constructor(e){super(e,"AbortException")}}function t1(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 T_(i){return String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255)}function k_(){const i=new Uint8Array(4);return i[0]=1,new Uint32Array(i.buffer,0,1)[0]===1}function D_(){try{return new Function(""),!0}catch{return!1}}class qr{static get isLittleEndian(){return Ct(this,"isLittleEndian",k_())}static get isEvalSupported(){return Ct(this,"isEvalSupported",D_())}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 P_(i){return decodeURIComponent(escape(i))}let pm=null,Yv=null;function r1(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),t1(i)}const Nb="pdfjs_internal_id_";function R_(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 n1(i){return Uint8Array.prototype.toBase64?i.toBase64():btoa(t1(i))}function I_(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",To=class To{};Ie(To,"CSS",96),Ie(To,"PDF",72),Ie(To,"PDF_TO_CSS_UNITS",To.CSS/To.PDF);let da=To;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 ql{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 i1(i){return[i]=i.split(/[#?]/,1),i.substring(i.lastIndexOf("/")+1)}function s1(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 N_(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 a1(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 M_(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 so(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,Po,hi,Aa,Kh,wu,Qh,sg,o1,Sn,l1,u1,oh,gp;const Ps=class Ps{constructor(e){N(this,Sn);N(this,xa,null);N(this,Po,null);N(this,hi);N(this,Aa,null);N(this,Kh,null);N(this,wu,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,o1),{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,Po))==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,Po,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,wu,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,wu)&&(u(this,wu).title=e)}remove(){var e;u(this,xa).remove(),(e=u(this,Po))==null||e.destroy(),T(this,Po,null)}};xa=new WeakMap,Po=new WeakMap,hi=new WeakMap,Aa=new WeakMap,Kh=new WeakMap,wu=new WeakMap,Qh=new WeakMap,sg=new WeakSet,o1=function(e){e.stopPropagation()},Sn=new WeakSet,l1=function(e){u(this,hi)._focusEventsAllowed=!1,_r(e)},u1=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,l1).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",L(this,Sn,u1).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,Ro,Io,ho,c1,h1,d1;class L_{constructor(e){N(this,ho);N(this,Jh,null);N(this,Ro,null);N(this,Io);T(this,Io,e)}show(e,t,r){const[n,s]=L(this,ho,h1).call(this,t,r),{style:a}=u(this,Ro)||T(this,Ro,L(this,ho,c1).call(this));e.append(u(this,Ro)),a.insetInlineEnd=`${100*n}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){u(this,Ro).remove()}}Jh=new WeakMap,Ro=new WeakMap,Io=new WeakMap,ho=new WeakSet,c1=function(){const e=T(this,Ro,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Ei,{signal:u(this,Io)._signal});const t=T(this,Jh,document.createElement("div"));return t.className="buttons",e.append(t),L(this,ho,d1).call(this),e},h1=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]},d1=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,Io)._signal;e.addEventListener("contextmenu",Ei,{signal:r}),e.addEventListener("click",()=>{u(this,Io).highlightSelection("floating_button")},{signal:r}),u(this,Jh).append(e)};function f1(i,e,t){for(const r of t)e.addEventListener(r,i[r].bind(i))}var ag;class O_{constructor(){N(this,ag,0)}get id(){return`${Q2}${bn(this,ag)._++}`}}ag=new WeakMap;var xu,ed,un,Au,mp;const mv=class mv{constructor(){N(this,Au);N(this,xu,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,Au,mp).call(this,`${t}_${r}_${n}_${s}`,e)}async getFromUrl(e){return L(this,Au,mp).call(this,e,e)}async getFromBlob(e,t){const r=await t;return L(this,Au,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,xu)}_${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,xu)}_`)}};xu=new WeakMap,ed=new WeakMap,un=new WeakMap,Au=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,xu)}_${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 F_{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,p1;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,p1).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,p1=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 M_(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 Eu,Vn,Ir,Yr,_u,Is,Cu,di,_a,Ca,Su,No,ts,Ni,Mo,rd,nd,Tu,id,rs,Sa,ku,Ta,ns,ug,ka,sd,Da,Lo,Oo,Pa,ad,zr,Ht,Ns,Ra,Fo,od,ld,Ia,is,Ms,ud,cd,fi,ze,bp,l0,g1,m1,vp,b1,v1,y1,u0,w1,c0,h0,x1,yn,ks,A1,E1,d0,_1,lh,f0;const pu=class pu{constructor(e,t,r,n,s,a,o,l,c,h,d,p,g,y,b){N(this,ze);N(this,Eu,new AbortController);N(this,Vn,null);N(this,Ir,new Map);N(this,Yr,new Map);N(this,_u,null);N(this,Is,null);N(this,Cu,null);N(this,di,new F_);N(this,_a,null);N(this,Ca,null);N(this,Su,0);N(this,No,new Set);N(this,ts,null);N(this,Ni,null);N(this,Mo,new Set);Ie(this,"_editorUndoBar",null);N(this,rd,!1);N(this,nd,!1);N(this,Tu,!1);N(this,id,null);N(this,rs,null);N(this,Sa,null);N(this,ku,null);N(this,Ta,!1);N(this,ns,null);N(this,ug,new O_);N(this,ka,!1);N(this,sd,!1);N(this,Da,null);N(this,Lo,null);N(this,Oo,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,Fo,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,Eu).signal;T(this,Ms,e),T(this,ud,t),T(this,cd,r),T(this,_u,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,b1).call(this),L(this,ze,x1).call(this),L(this,ze,u0).call(this),T(this,Is,o.annotationStorage),T(this,id,o.filterFactory),T(this,Fo,l),T(this,ku,c||null),T(this,rd,h),T(this,nd,d),T(this,Tu,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=pu.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,Eu))==null||t.abort(),T(this,Eu,null),this._signal=null;for(const c of u(this,Yr).values())c.destroy();u(this,Yr).clear(),u(this,Ir).clear(),u(this,Mo).clear(),(r=u(this,Pa))==null||r.clear(),T(this,Vn,null),u(this,Ht).clear(),u(this,di).destroy(),(n=u(this,_u))==null||n.destroy(),(s=u(this,Ra))==null||s.destroy(),(a=u(this,ns))==null||a.hide(),T(this,ns,null),(o=u(this,Oo))==null||o.destroy(),T(this,Oo,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,Tu)}get hcmFilter(){return Ct(this,"hcmFilter",u(this,Fo)?u(this,id).addHCMFilter(u(this,Fo).foreground,u(this,Fo).background):"none")}get direction(){return Ct(this,"direction",getComputedStyle(u(this,Ms)).direction)}get highlightColors(){return Ct(this,"highlightColors",u(this,ku)?new Map(u(this,ku).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,Oo,e)}editAltText(e,t=!1){var r;(r=u(this,_u))==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,Tu,t);break}}onPageChanging({pageNumber:e}){T(this,Su,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,Mo).add(e)}removeShouldRescale(e){u(this,Mo).delete(e)}onScaleChanging({scale:e}){var t;this.commitOrRemove(),this.viewParameters.realScale=e*da.PDF_TO_CSS_UNITS;for(const r of u(this,Mo))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,Lo,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!u(this,Lo))return;const[e,t]=u(this,Lo);T(this,Lo,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,w1).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&&pu._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,v1).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,y1).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,Su))}getLayer(e){return u(this,Yr).get(e)}get currentPageIndex(){return u(this,Su)}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,E1).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,A1).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,Oo))==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,No).has(e.annotationElementId))&&((r=u(this,Is))==null||r.remove(e.id))}addDeletedAnnotationElement(e){u(this,No).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return u(this,No).has(e)}removeDeletedAnnotationElement(e){u(this,No).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,_1)===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,Cu)||T(this,Cu,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){var t;(t=u(this,Cu))==null||t.delete(e)}renderAnnotationElement(e){var n;const t=(n=u(this,Cu))==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)}};Eu=new WeakMap,Vn=new WeakMap,Ir=new WeakMap,Yr=new WeakMap,_u=new WeakMap,Is=new WeakMap,Cu=new WeakMap,di=new WeakMap,_a=new WeakMap,Ca=new WeakMap,Su=new WeakMap,No=new WeakMap,ts=new WeakMap,Ni=new WeakMap,Mo=new WeakMap,rd=new WeakMap,nd=new WeakMap,Tu=new WeakMap,id=new WeakMap,rs=new WeakMap,Sa=new WeakMap,ku=new WeakMap,Ta=new WeakMap,ns=new WeakMap,ug=new WeakMap,ka=new WeakMap,sd=new WeakMap,Da=new WeakMap,Lo=new WeakMap,Oo=new WeakMap,Pa=new WeakMap,ad=new WeakMap,zr=new WeakMap,Ht=new WeakMap,Ns=new WeakMap,Ra=new WeakMap,Fo=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},g1=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 L_(this)),u(this,ns).show(r,n,this.direction==="ltr"))},m1=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,g1).call(this)},b1=function(){document.addEventListener("selectionchange",L(this,ze,m1).bind(this),{signal:this._signal})},v1=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})},y1=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})},w1=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)},x1=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})},A1=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()}},E1=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))},_1=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(pu,"TRANSLATE_SMALL",1),Ie(pu,"TRANSLATE_BIG",10);let ao=pu;var jr,ss,Mi,Du,as,Gn,Pu,os,Rn,Ls,Bo,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,Du,null);N(this,as,null);N(this,Gn,null);N(this,Pu,!1);N(this,os,null);N(this,Rn,null);N(this,Ls,null);N(this,Bo,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,Du,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,Pu,!0),n(s))},{signal:r}),await L(this,qi,yp).call(this),e}finish(){u(this,Mi)&&(u(this,Mi).focus({focusVisible:u(this,Pu)}),T(this,Pu,!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,Bo,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,Bo)),{altText:t,decorative:u(this,ss),guessedText:u(this,Ls),textWithDisclaimer:u(this,Bo)}}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,Bo,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,Du,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,Du=new WeakMap,as=new WeakMap,Gn=new WeakMap,Pu=new WeakMap,os=new WeakMap,Rn=new WeakMap,Ls=new WeakMap,Bo=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,Du))==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 Ru,zo,hd,dd,fd,pd,gd,Os,jo,Fs,Uo,Bs,fo,C1,S1,T1;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,fo);N(this,Ru);N(this,zo,!1);N(this,hd,null);N(this,dd);N(this,fd);N(this,pd);N(this,gd);N(this,Os,null);N(this,jo);N(this,Fs,null);N(this,Uo);N(this,Bs,null);T(this,Ru,e),T(this,hd,r),T(this,dd,t),T(this,fd,n),T(this,pd,s),T(this,gd,a),T(this,Uo,new AbortController),T(this,jo,AbortSignal.any([o,u(this,Uo).signal])),e.addEventListener("touchstart",L(this,fo,C1).bind(this),{passive:!1,signal:u(this,jo)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Wi.pixelRatio}destroy(){var e,t;(e=u(this,Uo))==null||e.abort(),T(this,Uo,null),(t=u(this,Os))==null||t.abort(),T(this,Os,null)}};Ru=new WeakMap,zo=new WeakMap,hd=new WeakMap,dd=new WeakMap,fd=new WeakMap,pd=new WeakMap,gd=new WeakMap,Os=new WeakMap,jo=new WeakMap,Fs=new WeakMap,Uo=new WeakMap,Bs=new WeakMap,fo=new WeakSet,C1=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,jo),o.signal]),c=u(this,Ru),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,jo),u(this,Bs).signal]),l=u(this,Ru),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",L(this,fo,S1).bind(this),c);const h=L(this,fo,T1).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})},S1=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,zo)&&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,zo)){T(this,zo,!0);return}const E=[(n+a)/2,(s+o)/2];(_=u(this,pd))==null||_.call(this,E,A,v)},T1=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,zo,!1)))};let Ih=bv;var Ho,Li,or,Iu,Ma,md,$o,Zr,Vo,zs,La,bd,Go,qn,vd,qo,js,us,Nu,Mu,pi,Wo,yd,cg,tt,p0,wd,g0,wp,k1,D1,m0,xp,b0,P1,R1,I1,v0,N1,y0,M1,L1,O1,w0,ch;const vt=class vt{constructor(e){N(this,tt);N(this,Ho,null);N(this,Li,null);N(this,or,null);N(this,Iu,!1);N(this,Ma,null);N(this,md,"");N(this,$o,!1);N(this,Zr,null);N(this,Vo,null);N(this,zs,null);N(this,La,null);N(this,bd,"");N(this,Go,!1);N(this,qn,null);N(this,vd,!1);N(this,qo,!1);N(this,js,!1);N(this,us,null);N(this,Nu,0);N(this,Mu,0);N(this,pi,null);N(this,Wo,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=ao.TRANSLATE_SMALL,r=ao.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 B_({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,Go)?T(this,Go,!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,$o)||(s.height=`${(100*t/n).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:r}=e,n=r.endsWith("%"),s=!u(this,$o)&&t.endsWith("%");if(n&&s)return;const[a,o]=this.parentDimensions;n||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),!u(this,$o)&&!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,qo))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,Ho)&&(u(this,or).data=u(this,Ho),T(this,Ho,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,Iu)?-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),f1(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(u(this,Wo)||T(this,Wo,new Ih({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:L(this,tt,P1).bind(this),onPinching:L(this,tt,R1).bind(this),onPinchEnd:L(this,tt,I1).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,Go,!0),this._isDraggable){L(this,tt,N1).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,qo,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),T(this,qo,!1),!0):!1}isInEditMode(){return u(this,qo)}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,Ho,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,Wo))==null||t.destroy(),T(this,Wo,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(L(this,tt,k1).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,M1).bind(this),o=L(this,tt,L1).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,O1).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,$o,!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,Iu,!1)}disable(){this.div&&(this.div.tabIndex=-1),T(this,Iu,!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()}};Ho=new WeakMap,Li=new WeakMap,or=new WeakMap,Iu=new WeakMap,Ma=new WeakMap,md=new WeakMap,$o=new WeakMap,Zr=new WeakMap,Vo=new WeakMap,zs=new WeakMap,La=new WeakMap,bd=new WeakMap,Go=new WeakMap,qn=new WeakMap,vd=new WeakMap,qo=new WeakMap,js=new WeakMap,us=new WeakMap,Nu=new WeakMap,Mu=new WeakMap,pi=new WeakMap,Wo=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]}},k1=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,D1).bind(this,r),{signal:t}),n.addEventListener("contextmenu",Ei,{signal:t}),n.tabIndex=-1}this.div.prepend(u(this,Zr))},D1=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,Vo,[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,Vo);[z,G]=this.screenToPageTranslation(Y-fe,W-K),u(this,Vo)[0]=Y,u(this,Vo)[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()},P1=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)},R1=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()},I1=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)},N1=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,Go,!1),this._uiManager.endDragSession()||L(this,tt,v0).call(this,c),r&&this._onStopDragging()};t&&(T(this,Nu,e.clientX),T(this,Mu,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,Nu),d-u(this,Mu));T(this,Nu,h),T(this,Mu,d),this._uiManager.dragSelectedEditors(g,y)},a),window.addEventListener("touchmove",_r,a),window.addEventListener("pointerdown",c=>{c.pointerType===u(this,md)&&(u(this,Wo)||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})},M1=function(e){vt._resizerKeyboardManager.exec(this,e)},L1=function(e){var t;u(this,js)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==u(this,Zr)&&L(this,tt,ch).call(this)},O1=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 B_ 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 F1{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 Xo,Yo,Kr,hg,B1;class Lb{constructor(){N(this,hg);N(this,Xo,!1);N(this,Yo,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,B1).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,Xo)&&(T(this,Xo,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new z1(this)}get serializable(){if(u(this,Kr).size===0)return x0;const e=new Map,t=new F1,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,Yo,null)}get modifiedIds(){if(u(this,Yo))return u(this,Yo);const e=[];for(const t of u(this,Kr).values())!(t instanceof tr)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return T(this,Yo,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return u(this,Kr).entries()}}Xo=new WeakMap,Yo=new WeakMap,Kr=new WeakMap,hg=new WeakSet,B1=function(){u(this,Xo)||(T(this,Xo,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var xd;class z1 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 Lu;class z_{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){N(this,Lu,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,Lu).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:r}){if(!(!e||u(this,Lu).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,Lu).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,T_(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()})}}Lu=new WeakMap;class j_{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,${n1(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 U_(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 H_(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,$_=i=>typeof i=="object"&&typeof(i==null?void 0:i.name)=="string",j1=R_.bind(null,A0,$_);var Us,dg;class V_{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 Ou,Ai,U1,H1,$1,Ap;class hh{constructor(e,t,r){N(this,Ai);N(this,Ou,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,U1).bind(this),{signal:u(this,Ou).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,Ou))==null||e.abort(),T(this,Ou,null)}}Ou=new WeakMap,Ai=new WeakSet,U1=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){L(this,Ai,$1).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,H1).call(this,e);return}t(e.data)},H1=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)})})},$1=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 V1{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 G_ extends V1{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 G1{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 G1{async _fetch(e){const t=await Nc(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):Sf(t)}}class q1{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 Zo,Fu,Hs,$s,cn,Ko,Qo,Ge,ln,dh,su,Ep,au,W1,E0,ou,fh,ph,_0,gh;class q_ extends q1{constructor({docId:t,ownerDocument:r=globalThis.document}){super();N(this,Ge);N(this,Zo);N(this,Fu);N(this,Hs);N(this,$s);N(this,cn);N(this,Ko);N(this,Qo,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,Qo)._++}`,c=L(this,Ge,au).call(this,l);u(this,Ge,ln).set(t,c),u(this,Ge,ln).set(o,c);const h=L(this,Ge,ou).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,su).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,ou).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,au).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,Qo)._++}`,o=L(this,Ge,au).call(this,a);u(this,Ge,ln).set(t,o),u(this,Ge,ln).set(s,o);const l=L(this,Ge,ou).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,Qo)._++}`,o=L(this,Ge,au).call(this,a);u(this,Ge,ln).set(t,o),u(this,Ge,ln).set(s,o);const l=L(this,Ge,ou).call(this,a);return L(this,Ge,W1).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,su).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,ou).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,au).call(this,w),l.url}destroy(t=!1){var r,n,s,a;t&&((r=u(this,Ko))!=null&&r.size)||((n=u(this,Hs))==null||n.parentNode.parentNode.remove(),T(this,Hs,null),(s=u(this,Fu))==null||s.clear(),T(this,Fu,null),(a=u(this,Ko))==null||a.clear(),T(this,Ko,null),T(this,Qo,0))}}Zo=new WeakMap,Fu=new WeakMap,Hs=new WeakMap,$s=new WeakMap,cn=new WeakMap,Ko=new WeakMap,Qo=new WeakMap,Ge=new WeakSet,ln=function(){return u(this,Fu)||T(this,Fu,new Map)},dh=function(){return u(this,Ko)||T(this,Ko,new Map)},su=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(",")]},au=function(t){if(u(this,Zo)===void 0){T(this,Zo,"");const r=u(this,cn).URL;r!==u(this,cn).baseURI&&(kf(r)?ut('#createUrl: ignore "data:"-URL for performance reasons.'):T(this,Zo,Rb(r,"")))}return`url(${u(this,Zo)}#${t})`},W1=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)},ou=function(t){const r=u(this,cn).createElementNS(Ts,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),u(this,Ge,su).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,su).style.color=t,Mb(getComputedStyle(u(this,Ge,su)).getPropertyValue("color"))};class X1{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 X1{async _fetch(e){const t=await Nc(e,"arraybuffer");return new Uint8Array(t)}}class Y1{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 Y1{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 W_ extends q1{}class X_ extends V1{_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 Y_ extends G1{async _fetch(e){return Ob(e)}}class Z_ extends X1{async _fetch(e){return Ob(e)}}class K_ extends Y1{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 Q_ 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 J_(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 eC 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)J_(_,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 tC extends Fb{getPattern(){return"hotpink"}}function rC(i){switch(i[0]){case"RadialAxial":return new Q_(i);case"Mesh":return new eC(i);case"Dummy":return new tC}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 S_(`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 nC({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,iC=15,sy=10,Mn=16,mm=new DOMMatrix,si=new Float32Array(2),du=new Float32Array([1/0,1/0,-1/0,-1/0]);function sC(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 aC{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=du.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(du,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}=nC({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 oC=["butt","round","square"],lC=["miter","round","bevel"],uC={},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 aC(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()+iC: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=du.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=oC[e]}setLineJoin(e){this.ctx.lineJoin=lC[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),sC(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=uC}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=rC(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=du.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=du.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=du.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 mu=vv;for(const i in Ph)mu.prototype[i]!==void 0&&(mu.prototype[Ph[i]]=mu.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 Bu,Cd;class cC{constructor({parsedData:e,rawData:t}){N(this,Bu);N(this,Cd);T(this,Bu,e),T(this,Cd,t)}getRaw(){return u(this,Cd)}get(e){return u(this,Bu).get(e)??null}[Symbol.iterator](){return u(this,Bu).entries()}}Bu=new WeakMap,Cd=new WeakMap;const lu=Symbol("INTERNAL");var Sd,Td,kd,zu;class hC{constructor(e,{name:t,intent:r,usage:n,rbGroups:s}){N(this,Sd,!1);N(this,Td,!1);N(this,kd,!1);N(this,zu,!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,zu);if(!u(this,zu))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!==lu&&Wt("Internal method `_setVisible` called."),T(this,kd,r),T(this,zu,t)}}Sd=new WeakMap,Td=new WeakMap,kd=new WeakMap,zu=new WeakMap;var Oa,Gt,ju,Uu,Dd,P0;class dC{constructor(e,t=ii.DISPLAY){N(this,Dd);N(this,Oa,null);N(this,Gt,new Map);N(this,ju,null);N(this,Uu,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,T(this,Uu,e.order);for(const r of e.groups)u(this,Gt).set(r.id,new hC(t,r));if(e.baseState==="OFF")for(const r of u(this,Gt).values())r._setVisible(lu,!1);for(const r of e.on)u(this,Gt).get(r)._setVisible(lu,!0);for(const r of e.off)u(this,Gt).get(r)._setVisible(lu,!1);T(this,ju,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(lu,!1,!0));n._setVisible(lu,!!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,ju)===null||this.getHash()===u(this,ju)}getOrder(){return u(this,Gt).size?u(this,Uu)?u(this,Uu).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 F1;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,ju=new WeakMap,Uu=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 fC{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 pC(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new gC(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 pC{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 gC{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 mC(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 Z1(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 K1({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 Q1(i){const e=i.get("Content-Disposition");if(e){let t=mC(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 J1(i){return i===200||i===206}function ew(i,e,t){return{method:"GET",headers:i,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function tw(i){return i instanceof Uint8Array?i.buffer:i instanceof ArrayBuffer?i:(ut(`getArrayBuffer - unexpected data format: ${i}`),new Uint8Array(i).buffer)}class bC{constructor(e){Ie(this,"_responseOrigin",null);this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Z1(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 vC(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new yC(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 vC{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,ew(r,this._withCredentials,this._abortController)).then(s=>{if(e._responseOrigin=Pg(s.url),!J1(s.status))throw Pf(s.status,n);this._reader=s.body.getReader(),this._headersCapability.resolve();const a=s.headers,{allowRangeRequests:o,suggestedLength:l}=K1({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=Q1(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:tw(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}class yC{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,ew(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(!J1(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:tw(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}const bm=200,vm=206;function wC(i){const e=i.response;return typeof e!="string"?e:Sf(e).buffer}class xC{constructor({url:e,httpHeaders:t,withCredentials:r}){Ie(this,"_responseOrigin",null);this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Z1(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=wC(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 AC{constructor(e){this._source=e,this._manager=new xC(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 EC(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new _C(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 EC{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}=K1({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=Q1(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 _C{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 CC=/^[a-z][a-z0-9\-+.]+:/i;function SC(i){if(CC.test(i))return new URL(i);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(i))}class TC{constructor(e){this.source=e,this.url=SC(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 kC(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new DC(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 kC{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 DC{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 rw{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 PC=1e5,hy=30;var L2,Fa,In,Rd,Id,Jo,Vs,Nd,Md,el,Hu,$u,Ba,Vu,Ld,Gu,tl,Od,Fd,mr,qu,rl,Bd,za,Wu,fa,nw,iw,I0,oi,_p,N0,sw,aw;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,Jo,null);N(this,Vs,null);N(this,Nd,0);N(this,Md,0);N(this,el,null);N(this,Hu,null);N(this,$u,0);N(this,Ba,0);N(this,Vu,Object.create(null));N(this,Ld,[]);N(this,Gu,null);N(this,tl,[]);N(this,Od,new WeakMap);N(this,Fd,null);var l;if(e instanceof ReadableStream)T(this,Gu,e);else if(typeof e=="object")T(this,Gu,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');T(this,In,T(this,Hu,t)),T(this,Ba,r.scale*Wi.pixelRatio),T(this,$u,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,sw).call(l),so(t,r),u(this,Fa).promise.finally(()=>{u(mr,Wu).delete(this),T(this,Vs,null),T(this,Vu,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,el).read().then(({value:t,done:r})=>{if(r){u(this,Fa).resolve();return}u(this,Jo)??T(this,Jo,t.lang),Object.assign(u(this,Vu),t.styles),L(this,fa,nw).call(this,t.items),e()},u(this,Fa).reject)};return T(this,el,u(this,Gu).getReader()),u(mr,Wu).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,$u)&&(t==null||t(),T(this,$u,n),so(u(this,Hu),{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,Jo))};for(const o of u(this,tl))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,el))==null||t.cancel(e).catch(()=>{}),T(this,el,null),u(this,Fa).reject(e)}get textDivs(){return u(this,tl)}get textContentItemsStr(){return u(this,Ld)}static cleanup(){if(!(u(this,Wu).size>0)){u(this,qu).clear();for(const{canvas:e}of u(this,rl).values())e.remove();u(this,rl).clear()}}},Fa=new WeakMap,In=new WeakMap,Rd=new WeakMap,Id=new WeakMap,Jo=new WeakMap,Vs=new WeakMap,Nd=new WeakMap,Md=new WeakMap,el=new WeakMap,Hu=new WeakMap,$u=new WeakMap,Ba=new WeakMap,Vu=new WeakMap,Ld=new WeakMap,Gu=new WeakMap,tl=new WeakMap,Od=new WeakMap,Fd=new WeakMap,qu=new WeakMap,rl=new WeakMap,Bd=new WeakMap,za=new WeakMap,Wu=new WeakMap,fa=new WeakSet,nw=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,Jo)));const t=u(this,tl),r=u(this,Ld);for(const a of e){if(t.length>PC){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,iw).call(this,a)}},iw=function(e){var b;const t=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};u(this,tl).push(t);const n=Qe.transform(u(this,Fd),e.transform);let s=Math.atan2(n[1],n[0]);const a=u(this,Vu)[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,aw).call(b,o,a,u(this,Jo));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,Hu)?(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,rl).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,rl).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)},sw=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()},aw=function(e,t,r){const n=u(this,qu).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,qu).set(e,c),c},N(mr,oi),N(mr,qu,new Map),N(mr,rl,new Map),N(mr,Bd,new WeakMap),N(mr,za,null),N(mr,Wu,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 RC=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?U_(i.url):null,n=i.data?H_(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 Sc?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?Y_:Jv),w=tp(i.iccUrl),v=tp(i.standardFontDataUrl),A=i.StandardFontDataFactory||(_n?Z_:ey),E=tp(i.wasmUrl),_=i.WasmFactory||(_n?K_: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?X_:G_),be=i.FilterFactory||(_n?W_:q_),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;E_(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=Sc.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 fC(l,{disableRange:J,disableStream:Y});else if(!n){if(!r)throw new Error("getDocument - no `url` parameter provided.");const Ne=ah(r)?bC:_n?TC:AC;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 MC(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 nl,zd,jd,Ud,Hd,O2;let zb=(O2=class{constructor(e,t,r=!1,n=null){N(this,nl,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,nl).promise.then(()=>{for(const r of u(this,Ud))r(e,t)})}onDataProgressiveRead(e){u(this,nl).promise.then(()=>{for(const t of u(this,jd))t(e)})}onDataProgressiveDone(){u(this,nl).promise.then(()=>{for(const e of u(this,zd))e()})}transportReady(){u(this,nl).resolve()}requestDataRange(e,t){Wt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},nl=new WeakMap,zd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,Hd=new WeakMap,O2);class IC{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,il,mh;class NC{constructor(e,t,r,n=!1){N(this,il);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 rw,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,il,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,il,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,il,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,il,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=RC;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,il=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,sl,mg,al,ol,Tn,Cp,ow,lw,bh,Xu,Sp;const ar=class ar{constructor({name:e=null,port:t=null,verbosity:r=__()}={}){N(this,Tn);N(this,ja,Promise.withResolvers());N(this,Oi,null);N(this,qs,null);N(this,sl,null);if(this.name=e,this.destroyed=!1,this.verbosity=r,t){if(u(ar,ol).has(t))throw new Error("Cannot use more than one PDFWorker per port.");u(ar,ol).set(t,this),L(this,Tn,ow).call(this,t)}else L(this,Tn,lw).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,sl))==null||e.terminate(),T(this,sl,null),u(ar,ol).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,ol).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,Xu,Sp)?u(this,Xu,Sp):(await import(this.workerSrc)).WorkerMessageHandler)())}};ja=new WeakMap,Oi=new WeakMap,qs=new WeakMap,sl=new WeakMap,mg=new WeakMap,al=new WeakMap,ol=new WeakMap,Tn=new WeakSet,Cp=function(){u(this,ja).resolve(),u(this,Oi).send("configure",{verbosity:this.verbosity})},ow=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)},lw=function(){if(u(ar,al)||u(ar,Xu,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,sl)||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,sl,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,al)||(ut("Setting up fake worker."),T(ar,al,!0)),ar._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){u(this,ja).reject(new Error("Worker was destroyed"));return}const t=new V_;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}".`))})},Xu=new WeakSet,Sp=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},N(ar,Xu),N(ar,mg,0),N(ar,al,!1),N(ar,ol,new WeakMap),_n&&(T(ar,al,!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(N_("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return ar.create(e)};let Sc=ar;var Ws,cs,Yu,Zu,Xs,ll,vh;class MC{constructor(e,t,r,n,s){N(this,ll);N(this,Ws,new Map);N(this,cs,new Map);N(this,Yu,new Map);N(this,Zu,new Map);N(this,Xs,null);this.messageHandler=e,this.loadingTask=t,this.commonObjs=new rw,this.fontLoader=new z_({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 z1?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,Yu).clear(),u(this,Zu).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 IC(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 j_(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,Yu).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,Zu).set(s.refStr,e);const a=new NC(t,s,this,this._params.pdfBug);return u(this,cs).set(t,a),a});return u(this,Yu).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,ll,vh).call(this,"GetFieldObjects")}hasJSActions(){return L(this,ll,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,ll,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,ll,vh).call(this,"GetOptionalContentConfig").then(t=>new dC(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 cC(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,Zu).get(t)??null}}Ws=new WeakMap,cs=new WeakMap,Yu=new WeakMap,Zu=new WeakMap,Xs=new WeakMap,ll=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 LC{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,ul;const ko=class ko{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 LC(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(ko,ul).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(ko,ul).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 mu(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(ko,ul).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(ko,ul).delete(this._canvas),this.callback())))}};Ha=new WeakMap,ul=new WeakMap,N(ko,ul,new WeakSet);let L0=ko;const jb="5.3.93",uw="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 OC{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 OC{_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 FC=9,jl=new WeakSet;class py{static create(e){switch(e.data.annotationType){case wr.LINK:return new cw(e);case wr.TEXT:return new BC(e);case wr.WIDGET:switch(e.data.fieldType){case"Tx":return new zC(e);case"Btn":return e.data.radioButton?new fw(e):e.data.checkBox?new UC(e):new HC(e);case"Ch":return new $C(e);case"Sig":return new jC(e)}return new Wl(e);case wr.POPUP:return new F0(e);case wr.FREETEXT:return new vw(e);case wr.LINE:return new GC(e);case wr.SQUARE:return new qC(e);case wr.CIRCLE:return new WC(e);case wr.POLYLINE:return new yw(e);case wr.CARET:return new YC(e);case wr.INK:return new Hb(e);case wr.POLYGON:return new XC(e);case wr.HIGHLIGHT:return new ww(e);case wr.UNDERLINE:return new ZC(e);case wr.SQUIGGLY:return new KC(e);case wr.STRIKEOUT:return new QC(e);case wr.STAMP:return new xw(e);case wr.FILEATTACHMENT:return new JC(e);default:return new Cr(e)}}}var cl,Ku,Qu,$d,O0;const yv=class yv{constructor(e,{isRenderable:t=!1,ignoreBorder:r=!1,createQuadrilaterals:n=!1}={}){N(this,$d);N(this,cl,null);N(this,Ku,!1);N(this,Qu,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,cl)||T(this,cl,{rect:this.data.rect.slice(0)});const{rect:t}=e;t&&L(this,$d,O0).call(this,t),(r=u(this,Qu))==null||r.popup.updateEdited(e)}resetEdited(){var e;u(this,cl)&&(L(this,$d,O0).call(this,u(this,cl).rect),(e=u(this,Qu))==null||e.popup.resetEdited(),T(this,cl,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 Wl||(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 fw){const A=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=A}switch(t.borderStyle.style){case iu.SOLID:a.borderStyle="solid";break;case iu.DASHED:a.borderStyle="dashed";break;case iu.BEVELED:ut("Unimplemented border style: beveled");break;case iu.INSET:ut("Unimplemented border style: inset");break;case iu.UNDERLINE:a.borderBottomStyle="solid";break}const v=t.borderColor||null;v?(T(this,Ku,!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,Ku)){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,Ku)&&(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,Qu,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]}};cl=new WeakMap,Ku=new WeakMap,Qu=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,_o,hw,dw;class cw 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,hw).call(this,n,t.attachment,t.attachmentDest),s=!0):t.setOCGState?(L(this,ai,dw).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,_o).call(this)}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),L(this,ai,_o).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,_o).call(this)}_bindResetFormAction(t,r){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),L(this,ai,_o).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,_o=function(){this.container.setAttribute("data-internal-link","")},hw=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,_o).call(this)},dw=function(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),L(this,ai,_o).call(this)};class BC 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 Wl 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||FC,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 zC extends Wl{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 jC extends Wl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class UC extends Wl{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 fw extends Wl{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 HC extends cw{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 $C extends Wl{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 VC({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 Ju,bg,vg,ec,tc,pr,Ys,hl,Vd,Gd,rc,Zs,Fi,Ks,qd,Qs,Wd,dl,fl,Xt,Tp,B0,pw,gw,mw,bw,kp,Dp,z0;class VC{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,Ju,L(this,Xt,mw).bind(this));N(this,bg,L(this,Xt,z0).bind(this));N(this,vg,L(this,Xt,Dp).bind(this));N(this,ec,L(this,Xt,kp).bind(this));N(this,tc,null);N(this,pr,null);N(this,Ys,null);N(this,hl,null);N(this,Vd,null);N(this,Gd,null);N(this,rc,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,dl,null);N(this,fl,!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,tc,t),T(this,qd,c),T(this,rc,h),T(this,Vd,r),T(this,hl,Dg.toDateObject(s)),this.trigger=r.flatMap(g=>g.getElementsToTriggerPopup());for(const g of this.trigger)g.addEventListener("click",u(this,ec)),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,Ju));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,tc)){const s=e.style.outlineColor=Qe.makeHexColor(...u(this,tc));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,hl)){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,hl).valueOf()})),s.dateTime=u(this,hl).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,dl)||T(this,dl,{contentsObj:u(this,Ys),richText:u(this,Qs)}),e&&T(this,Ks,null),t&&(T(this,Qs,L(this,Xt,gw).call(this,t)),T(this,Ys,null)),(r=u(this,Fi))==null||r.remove(),T(this,Fi,null)}resetEdited(){var e;u(this,dl)&&({contentsObj:bn(this,Ys)._,richText:bn(this,Qs)._}=u(this,dl),T(this,dl,null),(e=u(this,Fi))==null||e.remove(),T(this,Fi,null),T(this,Ks,null))}forceHide(){T(this,fl,this.isVisible),u(this,fl)&&(u(this,pr).hidden=!0)}maybeShow(){u(this,fl)&&(u(this,Fi)||L(this,Xt,Dp).call(this),T(this,fl,!1),u(this,pr).hidden=!1)}get isVisible(){return u(this,pr).hidden===!1}}Ju=new WeakMap,bg=new WeakMap,vg=new WeakMap,ec=new WeakMap,tc=new WeakMap,pr=new WeakMap,Ys=new WeakMap,hl=new WeakMap,Vd=new WeakMap,Gd=new WeakMap,rc=new WeakMap,Zs=new WeakMap,Fi=new WeakMap,Ks=new WeakMap,qd=new WeakMap,Qs=new WeakMap,Wd=new WeakMap,dl=new WeakMap,fl=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},pw=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},gw=function(e){const t=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},n={style:{color:u(this,Xt,pw),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},mw=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)},bw=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,rc),o=a?u(this,rc):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,ec)),u(this,pr).addEventListener("keydown",u(this,Ju))):(L(this,Xt,z0).call(this),u(this,pr).removeEventListener("click",u(this,ec)),u(this,pr).removeEventListener("keydown",u(this,Ju)))},Dp=function(){u(this,Fi)||this.render(),this.isVisible?u(this,Zs)&&u(this,pr).classList.add("focused"):(L(this,Xt,bw).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 vw 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 GC 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 qC 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 WC 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 yw 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 XC extends yw{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class YC 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,pl,Jd,j0;class Hb extends Cr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});N(this,Jd);N(this,Qd,null);N(this,pl,[]);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,pl).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,pl).length;o<l;o++)u(this,pl)[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,pl)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qd=new WeakMap,pl=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 ww 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 ZC 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 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("squigglyAnnotation"),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("strikeoutAnnotation"),e){const r=document.createElement("s");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class xw 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 JC 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,gl,$a,nf,po,H0,$0,nc;let $b=(nc=class{constructor({div:e,accessibilityManager:t,annotationCanvasMap:r,annotationEditorUIManager:n,page:s,viewport:a,structTreeLayer:o}){N(this,po);N(this,rf,null);N(this,gl,null);N(this,$a,new Map);N(this,nf,null);this.div=e,T(this,rf,t),T(this,gl,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;so(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,po,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,po,$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=nc._defaultBorderStyle),r.data=n;const s=py.create(r);if(!s.isRenderable)continue;const a=s.render();await L(this,po,H0).call(this,a,n.id,null)}}update({viewport:e}){const t=this.div;this.viewport=e,so(t,{rotation:e.rotation}),L(this,po,$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:iu.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},rf=new WeakMap,gl=new WeakMap,$a=new WeakMap,nf=new WeakMap,po=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,gl))return;const e=this.div;for(const[r,n]of u(this,gl)){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,gl).clear()},nc);const sp=/\r\n?|\n/g;var Bi,Xn,sf,ml,Yn,Pr,Aw,Ew,_w,Pp,ca,Rp,Ip,Cw,G0,Sw;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,ml,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=ao.TRANSLATE_SMALL,s=ao.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,Aw).call(this,r);break;case kt.FREETEXT_COLOR:L(this,Pr,Ew).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,ml,new AbortController);const t=this._uiManager.combinedSignal(u(this,ml));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,ml))==null||t.abort(),T(this,ml,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,_w).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,`
@@ -38,7 +38,7 @@ React keys must be passed directly to JSX without using spread:
38
38
  `),position:b,pageIndex:w-1,rect:h.slice(0),rotation:d,annotationElementId:p,id:p,deleted:!1,popupRef:g}}const a=await super.deserialize(t,r,n);return T(a,Yn,t.fontSize),T(a,Bi,Qe.makeHexColor(...t.color)),T(a,Xn,L(o=Jt,ca,G0).call(o,t.value)),a._initialData=s,a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=Jt._internalPadding*this.parentScale,n=this.getRect(r,r),s=tr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:u(this,Bi)),a={annotationType:ot.FREETEXT,color:s,fontSize:u(this,Yn),value:L(this,Pr,Cw).call(this),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(a.isCopy=!0,a):this.annotationElementId&&!L(this,Pr,Sw).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(t){const r=super.renderAnnotationElement(t);if(this.deleted)return r;const{style:n}=r;n.fontSize=`calc(${u(this,Yn)}px * var(--total-scale-factor))`,n.color=u(this,Bi),r.replaceChildren();for(const a of u(this,Xn).split(`
39
39
  `)){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),r.append(o)}const s=Jt._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(s,s),popupContent:u(this,Xn)}),r}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};Bi=new WeakMap,Xn=new WeakMap,sf=new WeakMap,ml=new WeakMap,Yn=new WeakMap,Pr=new WeakSet,Aw=function(t){const r=s=>{this.editorDiv.style.fontSize=`calc(${s}px * var(--total-scale-factor))`,this.translate(0,-(s-u(this,Yn))*this.parentScale),T(this,Yn,s),L(this,Pr,Pp).call(this)},n=u(this,Yn);this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Ew=function(t){const r=s=>{T(this,Bi,this.editorDiv.style.color=s)},n=u(this,Bi);this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},_w=function(){var n;const t=[];this.editorDiv.normalize();let r=null;for(const s of this.editorDiv.childNodes)(r==null?void 0:r.nodeType)===Node.TEXT_NODE&&s.nodeName==="BR"||(t.push(L(n=Jt,ca,Rp).call(n,s)),r=s);return t.join(`
40
40
  `)},Pp=function(){const[t,r]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:s,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",s.div.append(this.div),n=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=n.width/t,this.height=n.height/r):(this.width=n.height/t,this.height=n.width/r),this.fixAndSetPosition()},ca=new WeakSet,Rp=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(sp,"")},Ip=function(){if(this.editorDiv.replaceChildren(),!!u(this,Xn))for(const t of u(this,Xn).split(`
41
- `)){const r=document.createElement("div");r.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(r)}},Cw=function(){return u(this,Xn).replaceAll(" "," ")},G0=function(t){return t.replaceAll(" "," ")},Sw=function(t){const{value:r,fontSize:n,color:s,pageIndex:a}=this._initialData;return this._hasBeenMoved||t.value!==r||t.fontSize!==n||t.color.some((o,l)=>o!==s[l])||t.pageIndex!==a},N(Jt,ca),Ie(Jt,"_freeTextDefaultContent",""),Ie(Jt,"_internalPadding",0),Ie(Jt,"_defaultColor",null),Ie(Jt,"_defaultFontSize",10),Ie(Jt,"_type","freetext"),Ie(Jt,"_editorType",ot.FREETEXT);let V0=Jt;class qe{toSVGPath(){Wt("Abstract method `toSVGPath` must be implemented.")}get box(){Wt("Abstract getter `box` must be implemented.")}serialize(e,t){Wt("Abstract method `serialize` must be implemented.")}static _rescale(e,t,r,n,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o]*n,a[o+1]=r+e[o+1]*s;return a}static _rescaleAndSwap(e,t,r,n,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o+1]*n,a[o+1]=r+e[o]*s;return a}static _translate(e,t,r,n){n||(n=new Float32Array(e.length));for(let s=0,a=e.length;s<a;s+=2)n[s]=t+e[s],n[s+1]=r+e[s+1];return n}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,r,n,s){switch(s){case 90:return[1-t/r,e/n];case 180:return[1-e/r,1-t/n];case 270:return[t/r,1-e/n];default:return[e/r,t/n]}}static _normalizePagePoint(e,t,r){switch(r){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,r,n,s,a){return[(e+5*r)/6,(t+5*n)/6,(5*r+s)/6,(5*n+a)/6,(r+s)/2,(n+a)/2]}}Ie(qe,"PRECISION",1e-4);var Zn,zi,ic,sc,hs,xt,bl,vl,af,of,ac,oc,Va,lf,yg,wg,Lr,yh,Tw,kw,Dw,Pw,Rw,Iw;const Rs=class Rs{constructor({x:e,y:t},r,n,s,a,o=0){N(this,Lr);N(this,Zn);N(this,zi,[]);N(this,ic);N(this,sc);N(this,hs,[]);N(this,xt,new Float32Array(18));N(this,bl);N(this,vl);N(this,af);N(this,of);N(this,ac);N(this,oc);N(this,Va,[]);T(this,Zn,r),T(this,oc,s*n),T(this,sc,a),u(this,xt).set([NaN,NaN,NaN,NaN,e,t],6),T(this,ic,o),T(this,of,u(Rs,lf)*n),T(this,af,u(Rs,wg)*n),T(this,ac,n),u(this,Va).push(e,t)}isEmpty(){return isNaN(u(this,xt)[8])}add({x:e,y:t}){var R;T(this,bl,e),T(this,vl,t);const[r,n,s,a]=u(this,Zn);let[o,l,c,h]=u(this,xt).subarray(8,12);const d=e-c,p=t-h,g=Math.hypot(d,p);if(g<u(this,af))return!1;const y=g-u(this,of),b=y/g,w=b*d,v=b*p;let A=o,E=l;o=c,l=h,c+=w,h+=v,(R=u(this,Va))==null||R.push(e,t);const _=-v/y,C=w/y,I=_*u(this,oc),k=C*u(this,oc);return u(this,xt).set(u(this,xt).subarray(2,8),0),u(this,xt).set([c+I,h+k],4),u(this,xt).set(u(this,xt).subarray(14,18),12),u(this,xt).set([c-I,h-k],16),isNaN(u(this,xt)[6])?(u(this,hs).length===0&&(u(this,xt).set([o+I,l+k],2),u(this,hs).push(NaN,NaN,NaN,NaN,(o+I-r)/s,(l+k-n)/a),u(this,xt).set([o-I,l-k],14),u(this,zi).push(NaN,NaN,NaN,NaN,(o-I-r)/s,(l-k-n)/a)),u(this,xt).set([A,E,o,l,c,h],6),!this.isEmpty()):(u(this,xt).set([A,E,o,l,c,h],6),Math.abs(Math.atan2(E-l,A-o)-Math.atan2(v,w))<Math.PI/2?([o,l,c,h]=u(this,xt).subarray(2,6),u(this,hs).push(NaN,NaN,NaN,NaN,((o+c)/2-r)/s,((l+h)/2-n)/a),[o,l,A,E]=u(this,xt).subarray(14,18),u(this,zi).push(NaN,NaN,NaN,NaN,((A+o)/2-r)/s,((E+l)/2-n)/a),!0):([A,E,o,l,c,h]=u(this,xt).subarray(0,6),u(this,hs).push(((A+5*o)/6-r)/s,((E+5*l)/6-n)/a,((5*o+c)/6-r)/s,((5*l+h)/6-n)/a,((o+c)/2-r)/s,((l+h)/2-n)/a),[c,h,o,l,A,E]=u(this,xt).subarray(12,18),u(this,zi).push(((A+5*o)/6-r)/s,((E+5*l)/6-n)/a,((5*o+c)/6-r)/s,((5*l+h)/6-n)/a,((o+c)/2-r)/s,((l+h)/2-n)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=u(this,hs),t=u(this,zi);if(isNaN(u(this,xt)[6])&&!this.isEmpty())return L(this,Lr,Tw).call(this);const r=[];r.push(`M${e[4]} ${e[5]}`);for(let n=6;n<e.length;n+=6)isNaN(e[n])?r.push(`L${e[n+4]} ${e[n+5]}`):r.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);L(this,Lr,Dw).call(this,r);for(let n=t.length-6;n>=6;n-=6)isNaN(t[n])?r.push(`L${t[n+4]} ${t[n+5]}`):r.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);return L(this,Lr,kw).call(this,r),r.join(" ")}newFreeDrawOutline(e,t,r,n,s,a){return new Nw(e,t,r,n,s,a)}getOutlines(){var d;const e=u(this,hs),t=u(this,zi),r=u(this,xt),[n,s,a,o]=u(this,Zn),l=new Float32Array((((d=u(this,Va))==null?void 0:d.length)??0)+2);for(let p=0,g=l.length-2;p<g;p+=2)l[p]=(u(this,Va)[p]-n)/a,l[p+1]=(u(this,Va)[p+1]-s)/o;if(l[l.length-2]=(u(this,bl)-n)/a,l[l.length-1]=(u(this,vl)-s)/o,isNaN(r[6])&&!this.isEmpty())return L(this,Lr,Pw).call(this,l);const c=new Float32Array(u(this,hs).length+24+u(this,zi).length);let h=e.length;for(let p=0;p<h;p+=2){if(isNaN(e[p])){c[p]=c[p+1]=NaN;continue}c[p]=e[p],c[p+1]=e[p+1]}h=L(this,Lr,Iw).call(this,c,h);for(let p=t.length-6;p>=6;p-=6)for(let g=0;g<6;g+=2){if(isNaN(t[p+g])){c[h]=c[h+1]=NaN,h+=2;continue}c[h]=t[p+g],c[h+1]=t[p+g+1],h+=2}return L(this,Lr,Rw).call(this,c,h),this.newFreeDrawOutline(c,l,u(this,Zn),u(this,ac),u(this,ic),u(this,sc))}};Zn=new WeakMap,zi=new WeakMap,ic=new WeakMap,sc=new WeakMap,hs=new WeakMap,xt=new WeakMap,bl=new WeakMap,vl=new WeakMap,af=new WeakMap,of=new WeakMap,ac=new WeakMap,oc=new WeakMap,Va=new WeakMap,lf=new WeakMap,yg=new WeakMap,wg=new WeakMap,Lr=new WeakSet,yh=function(){const e=u(this,xt).subarray(4,6),t=u(this,xt).subarray(16,18),[r,n,s,a]=u(this,Zn);return[(u(this,bl)+(e[0]-t[0])/2-r)/s,(u(this,vl)+(e[1]-t[1])/2-n)/a,(u(this,bl)+(t[0]-e[0])/2-r)/s,(u(this,vl)+(t[1]-e[1])/2-n)/a]},Tw=function(){const[e,t,r,n]=u(this,Zn),[s,a,o,l]=L(this,Lr,yh).call(this);return`M${(u(this,xt)[2]-e)/r} ${(u(this,xt)[3]-t)/n} L${(u(this,xt)[4]-e)/r} ${(u(this,xt)[5]-t)/n} L${s} ${a} L${o} ${l} L${(u(this,xt)[16]-e)/r} ${(u(this,xt)[17]-t)/n} L${(u(this,xt)[14]-e)/r} ${(u(this,xt)[15]-t)/n} Z`},kw=function(e){const t=u(this,zi);e.push(`L${t[4]} ${t[5]} Z`)},Dw=function(e){const[t,r,n,s]=u(this,Zn),a=u(this,xt).subarray(4,6),o=u(this,xt).subarray(16,18),[l,c,h,d]=L(this,Lr,yh).call(this);e.push(`L${(a[0]-t)/n} ${(a[1]-r)/s} L${l} ${c} L${h} ${d} L${(o[0]-t)/n} ${(o[1]-r)/s}`)},Pw=function(e){const t=u(this,xt),[r,n,s,a]=u(this,Zn),[o,l,c,h]=L(this,Lr,yh).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-r)/s,(t[3]-n)/a,NaN,NaN,NaN,NaN,(t[4]-r)/s,(t[5]-n)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(t[16]-r)/s,(t[17]-n)/a,NaN,NaN,NaN,NaN,(t[14]-r)/s,(t[15]-n)/a],0),this.newFreeDrawOutline(d,e,u(this,Zn),u(this,ac),u(this,ic),u(this,sc))},Rw=function(e,t){const r=u(this,zi);return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],t),t+=6},Iw=function(e,t){const r=u(this,xt).subarray(4,6),n=u(this,xt).subarray(16,18),[s,a,o,l]=u(this,Zn),[c,h,d,p]=L(this,Lr,yh).call(this);return e.set([NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,d,p,NaN,NaN,NaN,NaN,(n[0]-s)/o,(n[1]-a)/l],t),t+=24},N(Rs,lf,8),N(Rs,yg,2),N(Rs,wg,u(Rs,lf)+u(Rs,yg));let Zp=Rs;var lc,yl,Js,uf,Kn,cf,Ar,xg,Mw;class Nw extends qe{constructor(t,r,n,s,a,o){super();N(this,xg);N(this,lc);N(this,yl,new Float32Array(4));N(this,Js);N(this,uf);N(this,Kn);N(this,cf);N(this,Ar);T(this,Ar,t),T(this,Kn,r),T(this,lc,n),T(this,cf,s),T(this,Js,a),T(this,uf,o),this.lastPoint=[NaN,NaN],L(this,xg,Mw).call(this,o);const[l,c,h,d]=u(this,yl);for(let p=0,g=t.length;p<g;p+=2)t[p]=(t[p]-l)/h,t[p+1]=(t[p+1]-c)/d;for(let p=0,g=r.length;p<g;p+=2)r[p]=(r[p]-l)/h,r[p+1]=(r[p+1]-c)/d}toSVGPath(){const t=[`M${u(this,Ar)[4]} ${u(this,Ar)[5]}`];for(let r=6,n=u(this,Ar).length;r<n;r+=6){if(isNaN(u(this,Ar)[r])){t.push(`L${u(this,Ar)[r+4]} ${u(this,Ar)[r+5]}`);continue}t.push(`C${u(this,Ar)[r]} ${u(this,Ar)[r+1]} ${u(this,Ar)[r+2]} ${u(this,Ar)[r+3]} ${u(this,Ar)[r+4]} ${u(this,Ar)[r+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,r,n,s],a){const o=n-t,l=s-r;let c,h;switch(a){case 0:c=qe._rescale(u(this,Ar),t,s,o,-l),h=qe._rescale(u(this,Kn),t,s,o,-l);break;case 90:c=qe._rescaleAndSwap(u(this,Ar),t,r,o,l),h=qe._rescaleAndSwap(u(this,Kn),t,r,o,l);break;case 180:c=qe._rescale(u(this,Ar),n,r,-o,l),h=qe._rescale(u(this,Kn),n,r,-o,l);break;case 270:c=qe._rescaleAndSwap(u(this,Ar),n,s,-o,-l),h=qe._rescaleAndSwap(u(this,Kn),n,s,-o,-l);break}return{outline:Array.from(c),points:[Array.from(h)]}}get box(){return u(this,yl)}newOutliner(t,r,n,s,a,o=0){return new Zp(t,r,n,s,a,o)}getNewOutline(t,r){const[n,s,a,o]=u(this,yl),[l,c,h,d]=u(this,lc),p=a*h,g=o*d,y=n*h+l,b=s*d+c,w=this.newOutliner({x:u(this,Kn)[0]*p+y,y:u(this,Kn)[1]*g+b},u(this,lc),u(this,cf),t,u(this,uf),r??u(this,Js));for(let v=2;v<u(this,Kn).length;v+=2)w.add({x:u(this,Kn)[v]*p+y,y:u(this,Kn)[v+1]*g+b});return w.getOutlines()}}lc=new WeakMap,yl=new WeakMap,Js=new WeakMap,uf=new WeakMap,Kn=new WeakMap,cf=new WeakMap,Ar=new WeakMap,xg=new WeakSet,Mw=function(t){const r=u(this,Ar);let n=r[4],s=r[5];const a=[n,s,n,s];let o=n,l=s;const c=t?Math.max:Math.min;for(let d=6,p=r.length;d<p;d+=6){const g=r[d+4],y=r[d+5];if(isNaN(r[d]))Qe.pointBoundingBox(g,y,a),l<y?(o=g,l=y):l===y&&(o=c(o,g));else{const b=[1/0,1/0,-1/0,-1/0];Qe.bezierBoundingBox(n,s,...r.slice(d,d+6),b),Qe.rectBoundingBox(...b,a),l<b[3]?(o=b[2],l=b[3]):l===b[3]&&(o=c(o,b[2]))}n=g,s=y}const h=u(this,yl);h[0]=a[0]-u(this,Js),h[1]=a[1]-u(this,Js),h[2]=a[2]-a[0]+2*u(this,Js),h[3]=a[3]-a[1]+2*u(this,Js),this.lastPoint=[o,l]};var hf,df,Ga,ji,kn,Lw,Np,Ow,Fw,W0;class q0{constructor(e,t=0,r=0,n=!0){N(this,kn);N(this,hf);N(this,df);N(this,Ga,[]);N(this,ji,[]);const s=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:g,y,width:b,height:w}of e){const v=Math.floor((g-t)/a)*a,A=Math.ceil((g+b+t)/a)*a,E=Math.floor((y-t)/a)*a,_=Math.ceil((y+w+t)/a)*a,C=[v,E,_,!0],I=[A,E,_,!1];u(this,Ga).push(C,I),Qe.rectBoundingBox(v,E,A,_,s)}const o=s[2]-s[0]+2*r,l=s[3]-s[1]+2*r,c=s[0]-r,h=s[1]-r,d=u(this,Ga).at(n?-1:-2),p=[d[0],d[2]];for(const g of u(this,Ga)){const[y,b,w]=g;g[0]=(y-c)/o,g[1]=(b-h)/l,g[2]=(w-h)/l}T(this,hf,new Float32Array([c,h,o,l])),T(this,df,p)}getOutlines(){u(this,Ga).sort((t,r)=>t[0]-r[0]||t[1]-r[1]||t[2]-r[2]);const e=[];for(const t of u(this,Ga))t[3]?(e.push(...L(this,kn,W0).call(this,t)),L(this,kn,Ow).call(this,t)):(L(this,kn,Fw).call(this,t),e.push(...L(this,kn,W0).call(this,t)));return L(this,kn,Lw).call(this,e)}}hf=new WeakMap,df=new WeakMap,Ga=new WeakMap,ji=new WeakMap,kn=new WeakSet,Lw=function(e){const t=[],r=new Set;for(const a of e){const[o,l,c]=a;t.push([o,l,a],[o,c,a])}t.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=t.length;a<o;a+=2){const l=t[a][2],c=t[a+1][2];l.push(c),c.push(l),r.add(l),r.add(c)}const n=[];let s;for(;r.size>0;){const a=r.values().next().value;let[o,l,c,h,d]=a;r.delete(a);let p=o,g=l;for(s=[o,c],n.push(s);;){let y;if(r.has(h))y=h;else if(r.has(d))y=d;else break;r.delete(y),[o,l,c,h,d]=y,p!==o&&(s.push(p,g,o,g===l?l:c),p=o),g=g===l?c:l}s.push(p,g)}return new eS(n,u(this,hf),u(this,df))},Np=function(e){const t=u(this,ji);let r=0,n=t.length-1;for(;r<=n;){const s=r+n>>1,a=t[s][0];if(a===e)return s;a<e?r=s+1:n=s-1}return n+1},Ow=function([,e,t]){const r=L(this,kn,Np).call(this,e);u(this,ji).splice(r,0,[e,t])},Fw=function([,e,t]){const r=L(this,kn,Np).call(this,e);for(let n=r;n<u(this,ji).length;n++){const[s,a]=u(this,ji)[n];if(s!==e)break;if(s===e&&a===t){u(this,ji).splice(n,1);return}}for(let n=r-1;n>=0;n--){const[s,a]=u(this,ji)[n];if(s!==e)break;if(s===e&&a===t){u(this,ji).splice(n,1);return}}},W0=function(e){const[t,r,n]=e,s=[[t,r,n]],a=L(this,kn,Np).call(this,n);for(let o=0;o<a;o++){const[l,c]=u(this,ji)[o];for(let h=0,d=s.length;h<d;h++){const[,p,g]=s[h];if(!(c<=p||g<=l)){if(p>=l){if(g>c)s[h][1]=c;else{if(d===1)return[];s.splice(h,1),h--,d--}continue}s[h][2]=l,g>c&&s.push([t,c,g])}}}return s};var ff,uc;class eS extends qe{constructor(t,r,n){super();N(this,ff);N(this,uc);T(this,uc,t),T(this,ff,r),this.lastPoint=n}toSVGPath(){const t=[];for(const r of u(this,uc)){let[n,s]=r;t.push(`M${n} ${s}`);for(let a=2;a<r.length;a+=2){const o=r[a],l=r[a+1];o===n?(t.push(`V${l}`),s=l):l===s&&(t.push(`H${o}`),n=o)}t.push("Z")}return t.join(" ")}serialize([t,r,n,s],a){const o=[],l=n-t,c=s-r;for(const h of u(this,uc)){const d=new Array(h.length);for(let p=0;p<h.length;p+=2)d[p]=t+h[p]*l,d[p+1]=s-h[p+1]*c;o.push(d)}return o}get box(){return u(this,ff)}get classNamesForOutlining(){return["highlightOutline"]}}ff=new WeakMap,uc=new WeakMap;class X0 extends Zp{newFreeDrawOutline(e,t,r,n,s,a){return new tS(e,t,r,n,s,a)}}class tS extends Nw{newOutliner(e,t,r,n,s,a=0){return new X0(e,t,r,n,s,a)}}var Qn,wl,cc,Nr,pf,hc,ea,gf,qa,Ui,dc,mf,qt,Y0,Z0,K0,Co,Bw,ya;const Pn=class Pn{constructor({editor:e=null,uiManager:t=null}){N(this,qt);N(this,Qn,null);N(this,wl,null);N(this,cc);N(this,Nr,null);N(this,pf,!1);N(this,hc,!1);N(this,ea,null);N(this,gf);N(this,qa,null);N(this,Ui,null);N(this,dc);var r,n;e?(T(this,hc,!1),T(this,dc,kt.HIGHLIGHT_COLOR),T(this,ea,e)):(T(this,hc,!0),T(this,dc,kt.HIGHLIGHT_DEFAULT_COLOR)),T(this,Ui,(e==null?void 0:e._uiManager)||t),T(this,gf,u(this,Ui)._eventBus),T(this,cc,((r=e==null?void 0:e.color)==null?void 0:r.toUpperCase())||((n=u(this,Ui))==null?void 0:n.highlightColors.values().next().value)||"#FFFF98"),u(Pn,mf)||T(Pn,mf,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return Ct(this,"_keyboardManager",new Df([[["Escape","mac+Escape"],Pn.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Pn.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Pn.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Pn.prototype._moveToPrevious],[["Home","mac+Home"],Pn.prototype._moveToBeginning],[["End","mac+End"],Pn.prototype._moveToEnd]]))}renderButton(){const e=T(this,Qn,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",u(this,ea)&&(e.ariaControls=`${u(this,ea).id}_colorpicker_dropdown`);const t=u(this,Ui)._signal;e.addEventListener("click",L(this,qt,Co).bind(this),{signal:t}),e.addEventListener("keydown",L(this,qt,K0).bind(this),{signal:t});const r=T(this,wl,document.createElement("span"));return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=u(this,cc),e.append(r),e}renderMainDropdown(){const e=T(this,Nr,L(this,qt,Y0).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===u(this,Qn)){L(this,qt,Co).call(this,e);return}const t=e.target.getAttribute("data-color");t&&L(this,qt,Z0).call(this,t,e)}_moveToNext(e){var t,r;if(!u(this,qt,ya)){L(this,qt,Co).call(this,e);return}if(e.target===u(this,Qn)){(t=u(this,Nr).firstChild)==null||t.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var t,r;if(e.target===((t=u(this,Nr))==null?void 0:t.firstChild)||e.target===u(this,Qn)){u(this,qt,ya)&&this._hideDropdownFromKeyboard();return}u(this,qt,ya)||L(this,qt,Co).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var t;if(!u(this,qt,ya)){L(this,qt,Co).call(this,e);return}(t=u(this,Nr).firstChild)==null||t.focus()}_moveToEnd(e){var t;if(!u(this,qt,ya)){L(this,qt,Co).call(this,e);return}(t=u(this,Nr).lastChild)==null||t.focus()}hideDropdown(){var e,t;(e=u(this,Nr))==null||e.classList.add("hidden"),u(this,Qn).ariaExpanded="false",(t=u(this,qa))==null||t.abort(),T(this,qa,null)}_hideDropdownFromKeyboard(){var e;if(!u(this,hc)){if(!u(this,qt,ya)){(e=u(this,ea))==null||e.unselect();return}this.hideDropdown(),u(this,Qn).focus({preventScroll:!0,focusVisible:u(this,pf)})}}updateColor(e){if(u(this,wl)&&(u(this,wl).style.backgroundColor=e),!u(this,Nr))return;const t=u(this,Ui).highlightColors.values();for(const r of u(this,Nr).children)r.ariaSelected=t.next().value===e.toUpperCase()}destroy(){var e,t;(e=u(this,Qn))==null||e.remove(),T(this,Qn,null),T(this,wl,null),(t=u(this,Nr))==null||t.remove(),T(this,Nr,null)}};Qn=new WeakMap,wl=new WeakMap,cc=new WeakMap,Nr=new WeakMap,pf=new WeakMap,hc=new WeakMap,ea=new WeakMap,gf=new WeakMap,qa=new WeakMap,Ui=new WeakMap,dc=new WeakMap,mf=new WeakMap,qt=new WeakSet,Y0=function(){const e=document.createElement("div"),t=u(this,Ui)._signal;e.addEventListener("contextmenu",Ei,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),u(this,ea)&&(e.id=`${u(this,ea).id}_colorpicker_dropdown`);for(const[r,n]of u(this,Ui).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=r,s.setAttribute("data-l10n-id",u(Pn,mf)[r]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=n,s.ariaSelected=n===u(this,cc),s.addEventListener("click",L(this,qt,Z0).bind(this,n),{signal:t}),e.append(s)}return e.addEventListener("keydown",L(this,qt,K0).bind(this),{signal:t}),e},Z0=function(e,t){t.stopPropagation(),u(this,gf).dispatch("switchannotationeditorparams",{source:this,type:u(this,dc),value:e})},K0=function(e){Pn._keyboardManager.exec(this,e)},Co=function(e){if(u(this,qt,ya)){this.hideDropdown();return}if(T(this,pf,e.detail===0),u(this,qa)||(T(this,qa,new AbortController),window.addEventListener("pointerdown",L(this,qt,Bw).bind(this),{signal:u(this,Ui).combinedSignal(u(this,qa))})),u(this,Qn).ariaExpanded="true",u(this,Nr)){u(this,Nr).classList.remove("hidden");return}const t=T(this,Nr,L(this,qt,Y0).call(this));u(this,Qn).append(t)},Bw=function(e){var t;(t=u(this,Nr))!=null&&t.contains(e.target)||this.hideDropdown()},ya=function(){return u(this,Nr)&&!u(this,Nr).classList.contains("hidden")},N(Pn,mf,null);let Oh=Pn;var fc,bf,ta,xl,vf,Nn,yf,wf,Al,gi,Jn,Qr,pc,ra,hn,gc,mi,xf,ft,Q0,Mp,zw,jw,Uw,J0,So,wi,uu,Hw,Lp,wh,$w,Vw,Gw,qw,Ww;const Bt=class Bt extends tr{constructor(t){super({...t,name:"highlightEditor"});N(this,ft);N(this,fc,null);N(this,bf,0);N(this,ta);N(this,xl,null);N(this,vf,null);N(this,Nn,null);N(this,yf,null);N(this,wf,0);N(this,Al,null);N(this,gi,null);N(this,Jn,null);N(this,Qr,!1);N(this,pc,null);N(this,ra);N(this,hn,null);N(this,gc,"");N(this,mi);N(this,xf,"");this.color=t.color||Bt._defaultColor,T(this,mi,t.thickness||Bt._defaultThickness),T(this,ra,t.opacity||Bt._defaultOpacity),T(this,ta,t.boxes||null),T(this,xf,t.methodOfCreation||""),T(this,gc,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(T(this,Qr,!0),L(this,ft,Mp).call(this,t),L(this,ft,So).call(this)):u(this,ta)&&(T(this,fc,t.anchorNode),T(this,bf,t.anchorOffset),T(this,yf,t.focusNode),T(this,wf,t.focusOffset),L(this,ft,Q0).call(this),L(this,ft,So).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const t=Bt.prototype;return Ct(this,"_keyboardManager",new Df([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:u(this,Qr)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:u(this,mi),methodOfCreation:u(this,xf)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,r){var n;tr.initialize(t,r),Bt._defaultColor||(Bt._defaultColor=((n=r.highlightColors)==null?void 0:n.values().next().value)||"#fff066")}static updateDefaultParams(t,r){switch(t){case kt.HIGHLIGHT_DEFAULT_COLOR:Bt._defaultColor=r;break;case kt.HIGHLIGHT_THICKNESS:Bt._defaultThickness=r;break}}translateInPage(t,r){}get toolbarPosition(){return u(this,pc)}updateParams(t,r){switch(t){case kt.HIGHLIGHT_COLOR:L(this,ft,zw).call(this,r);break;case kt.HIGHLIGHT_THICKNESS:L(this,ft,jw).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[kt.HIGHLIGHT_DEFAULT_COLOR,Bt._defaultColor],[kt.HIGHLIGHT_THICKNESS,Bt._defaultThickness]]}get propertiesToUpdate(){return[[kt.HIGHLIGHT_COLOR,this.color||Bt._defaultColor],[kt.HIGHLIGHT_THICKNESS,u(this,mi)||Bt._defaultThickness],[kt.HIGHLIGHT_FREE,u(this,Qr)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",T(this,vf,new Oh({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(L(this,ft,wh).call(this))}getBaseTranslation(){return[0,0]}getRect(t,r){return super.getRect(t,r,L(this,ft,wh).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){L(this,ft,J0).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(L(this,ft,So).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var n;let r=!1;this.parent&&!t?L(this,ft,J0).call(this):t&&(L(this,ft,So).call(this,t),r=!this.parent&&((n=this.div)==null?void 0:n.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),r&&this.select()}rotate(t){var s,a,o;const{drawLayer:r}=this.parent;let n;u(this,Qr)?(t=(t-this.rotation+360)%360,n=L(s=Bt,wi,uu).call(s,u(this,gi).box,t)):n=L(a=Bt,wi,uu).call(a,[this.x,this.y,this.width,this.height],t),r.updateProperties(u(this,Jn),{bbox:n,root:{"data-main-rotation":t}}),r.updateProperties(u(this,hn),{bbox:L(o=Bt,wi,uu).call(o,u(this,Nn).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();u(this,gc)&&(t.setAttribute("aria-label",u(this,gc)),t.setAttribute("role","mark")),u(this,Qr)?t.classList.add("free"):this.div.addEventListener("keydown",L(this,ft,Hw).bind(this),{signal:this._uiManager._signal});const r=T(this,Al,document.createElement("div"));t.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=u(this,xl);const[n,s]=this.parentDimensions;return this.setDims(this.width*n,this.height*s),f1(this,u(this,Al),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{hovered:!0}})}pointerleave(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:L(this,ft,Lp).call(this,!0);break;case 1:case 3:L(this,ft,Lp).call(this,!1);break}}select(){var t;super.select(),u(this,hn)&&((t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),u(this,hn)&&((t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{selected:!1}}),u(this,Qr)||L(this,ft,Lp).call(this,!1))}get _mustFixPosition(){return!u(this,Qr)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(u(this,Jn),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(u(this,hn),{rootClass:{hidden:!t}}))}static startHighlighting(t,r,{target:n,x:s,y:a}){const{x:o,y:l,width:c,height:h}=n.getBoundingClientRect(),d=new AbortController,p=t.combinedSignal(d),g=y=>{d.abort(),L(this,wi,qw).call(this,t,y)};window.addEventListener("blur",g,{signal:p}),window.addEventListener("pointerup",g,{signal:p}),window.addEventListener("pointerdown",_r,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",Ei,{signal:p}),n.addEventListener("pointermove",L(this,wi,Gw).bind(this,t),{signal:p}),this._freeHighlight=new X0({x:s,y:a},[o,l,c,h],t.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(t,r,n){var b,w,v,A;let s=null;if(t instanceof ww){const{data:{quadPoints:E,rect:_,rotation:C,id:I,color:k,opacity:D,popupRef:R},parent:{page:{pageNumber:z}}}=t;s=t={annotationType:ot.HIGHLIGHT,color:Array.from(k),opacity:D,quadPoints:E,boxes:null,pageIndex:z-1,rect:_.slice(0),rotation:C,annotationElementId:I,id:I,deleted:!1,popupRef:R}}else if(t instanceof Hb){const{data:{inkLists:E,rect:_,rotation:C,id:I,color:k,borderStyle:{rawWidth:D},popupRef:R},parent:{page:{pageNumber:z}}}=t;s=t={annotationType:ot.HIGHLIGHT,color:Array.from(k),thickness:D,inkLists:E,boxes:null,pageIndex:z-1,rect:_.slice(0),rotation:C,annotationElementId:I,id:I,deleted:!1,popupRef:R}}const{color:a,quadPoints:o,inkLists:l,opacity:c}=t,h=await super.deserialize(t,r,n);h.color=Qe.makeHexColor(...a),T(h,ra,c||1),l&&T(h,mi,t.thickness),h._initialData=s;const[d,p]=h.pageDimensions,[g,y]=h.pageTranslation;if(o){const E=T(h,ta,[]);for(let _=0;_<o.length;_+=8)E.push({x:(o[_]-g)/d,y:1-(o[_+1]-y)/p,width:(o[_+2]-o[_])/d,height:(o[_+1]-o[_+5])/p});L(b=h,ft,Q0).call(b),L(w=h,ft,So).call(w),h.rotate(h.rotation)}else if(l){T(h,Qr,!0);const E=l[0],_={x:E[0]-g,y:p-(E[1]-y)},C=new X0(_,[0,0,d,p],1,u(h,mi)/2,!0,.001);for(let D=0,R=E.length;D<R;D+=2)_.x=E[D]-g,_.y=p-(E[D+1]-y),C.add(_);const{id:I,clipPathId:k}=r.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:h.color,"fill-opacity":h._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:C.toSVGPath()}},!0,!0);L(v=h,ft,Mp).call(v,{highlightOutlines:C.getOutlines(),highlightId:I,clipPathId:k}),L(A=h,ft,So).call(A),h.rotate(h.parentRotation)}return h}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const r=this.getRect(0,0),n=tr._colorManager.convert(this.color),s={annotationType:ot.HIGHLIGHT,color:n,opacity:u(this,ra),thickness:u(this,mi),quadPoints:L(this,ft,$w).call(this),outlines:L(this,ft,Vw).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:L(this,ft,wh).call(this),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!L(this,ft,Ww).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};fc=new WeakMap,bf=new WeakMap,ta=new WeakMap,xl=new WeakMap,vf=new WeakMap,Nn=new WeakMap,yf=new WeakMap,wf=new WeakMap,Al=new WeakMap,gi=new WeakMap,Jn=new WeakMap,Qr=new WeakMap,pc=new WeakMap,ra=new WeakMap,hn=new WeakMap,gc=new WeakMap,mi=new WeakMap,xf=new WeakMap,ft=new WeakSet,Q0=function(){const t=new q0(u(this,ta),.001);T(this,gi,t.getOutlines()),[this.x,this.y,this.width,this.height]=u(this,gi).box;const r=new q0(u(this,ta),.0025,.001,this._uiManager.direction==="ltr");T(this,Nn,r.getOutlines());const{lastPoint:n}=u(this,Nn);T(this,pc,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])},Mp=function({highlightOutlines:t,highlightId:r,clipPathId:n}){var d,p;if(T(this,gi,t),T(this,Nn,t.getNewOutline(u(this,mi)/2+1.5,.0025)),r>=0)T(this,Jn,r),T(this,xl,n),this.parent.drawLayer.finalizeDraw(r,{bbox:t.box,path:{d:t.toSVGPath()}}),T(this,hn,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:u(this,Nn).box,path:{d:u(this,Nn).toSVGPath()}},!0));else if(this.parent){const g=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(u(this,Jn),{bbox:L(d=Bt,wi,uu).call(d,u(this,gi).box,(g-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(u(this,hn),{bbox:L(p=Bt,wi,uu).call(p,u(this,Nn).box,g),path:{d:u(this,Nn).toSVGPath()}})}const[a,o,l,c]=t.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[g,y]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*y/g,this.height=c*g/y;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[g,y]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*y/g,this.height=c*g/y;break}}const{lastPoint:h}=u(this,Nn);T(this,pc,[(h[0]-a)/l,(h[1]-o)/c])},zw=function(t){const r=(a,o)=>{var l,c;this.color=a,T(this,ra,o),(l=this.parent)==null||l.drawLayer.updateProperties(u(this,Jn),{root:{fill:a,"fill-opacity":o}}),(c=u(this,vf))==null||c.updateColor(a)},n=this.color,s=u(this,ra);this.addCommands({cmd:r.bind(this,t,Bt._defaultOpacity),undo:r.bind(this,n,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},jw=function(t){const r=u(this,mi),n=s=>{T(this,mi,s),L(this,ft,Uw).call(this,s)};this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Uw=function(t){if(!u(this,Qr))return;L(this,ft,Mp).call(this,{highlightOutlines:u(this,gi).getNewOutline(t/2)}),this.fixAndSetPosition();const[r,n]=this.parentDimensions;this.setDims(this.width*r,this.height*n)},J0=function(){u(this,Jn)===null||!this.parent||(this.parent.drawLayer.remove(u(this,Jn)),T(this,Jn,null),this.parent.drawLayer.remove(u(this,hn)),T(this,hn,null))},So=function(t=this.parent){u(this,Jn)===null&&({id:bn(this,Jn)._,clipPathId:bn(this,xl)._}=t.drawLayer.draw({bbox:u(this,gi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":u(this,ra)},rootClass:{highlight:!0,free:u(this,Qr)},path:{d:u(this,gi).toSVGPath()}},!1,!0),T(this,hn,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:u(this,Qr)},bbox:u(this,Nn).box,path:{d:u(this,Nn).toSVGPath()}},u(this,Qr))),u(this,Al)&&(u(this,Al).style.clipPath=u(this,xl)))},wi=new WeakSet,uu=function([t,r,n,s],a){switch(a){case 90:return[1-r-s,t,s,n];case 180:return[1-t-n,1-r-s,n,s];case 270:return[r,1-t-n,s,n]}return[t,r,n,s]},Hw=function(t){Bt._keyboardManager.exec(this,t)},Lp=function(t){if(!u(this,fc))return;const r=window.getSelection();t?r.setPosition(u(this,fc),u(this,bf)):r.setPosition(u(this,yf),u(this,wf))},wh=function(){return u(this,Qr)?this.rotation:0},$w=function(){if(u(this,Qr))return null;const[t,r]=this.pageDimensions,[n,s]=this.pageTranslation,a=u(this,ta),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:h,width:d,height:p}of a){const g=c*t+n,y=(1-h)*r+s;o[l]=o[l+4]=g,o[l+1]=o[l+3]=y,o[l+2]=o[l+6]=g+d*t,o[l+5]=o[l+7]=y-p*r,l+=8}return o},Vw=function(t){return u(this,gi).serialize(t,L(this,ft,wh).call(this))},Gw=function(t,r){this._freeHighlight.add(r)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},qw=function(t,r){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},Ww=function(t){const{color:r}=this._initialData;return t.color.some((n,s)=>n!==r[s])},N(Bt,wi),Ie(Bt,"_defaultColor",null),Ie(Bt,"_defaultOpacity",1),Ie(Bt,"_defaultThickness",12),Ie(Bt,"_type","highlight"),Ie(Bt,"_editorType",ot.HIGHLIGHT),Ie(Bt,"_freeHighlightId",-1),Ie(Bt,"_freeHighlight",null),Ie(Bt,"_freeHighlightClipId","");let Kp=Bt;var El;class Xw{constructor(){N(this,El,Object.create(null))}updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,r]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,r)}updateSVGProperty(e,t){u(this,El)[e]=t}toSVGProperties(){const e=u(this,El);return T(this,El,Object.create(null)),{root:e}}reset(){T(this,El,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Wt("Not implemented")}}El=new WeakMap;var ei,mc,Ur,_l,Cl,Wa,Xa,Ya,Sl,Lt,eb,tb,rb,xh,Yw,Op,Ah,cu;const We=class We extends tr{constructor(t){super(t);N(this,Lt);N(this,ei,null);N(this,mc);Ie(this,"_drawId",null);T(this,mc,t.mustBeCommitted||!1),this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(L(this,Lt,eb).call(this,t),L(this,Lt,xh).call(this))}static _mergeSVGProperties(t,r){const n=new Set(Object.keys(t));for(const[s,a]of Object.entries(r))n.has(s)?Object.assign(t[s],a):t[s]=a;return t}static getDefaultDrawingOptions(t){Wt("Not implemented")}static get typesMap(){Wt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,r){const n=this.typesMap.get(t);n&&this._defaultDrawingOptions.updateProperty(n,r),this._currentParent&&(u(We,Ur).updateProperty(n,r),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,r){const n=this.constructor.typesMap.get(t);n&&this._updateProperty(t,n,r)}static get defaultPropertiesToUpdate(){const t=[],r=this._defaultDrawingOptions;for(const[n,s]of this.typesMap)t.push([n,r[s]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:r}=this;for(const[n,s]of this.constructor.typesMap)t.push([n,r[s]]);return t}_updateProperty(t,r,n){const s=this._drawingOptions,a=s[r],o=l=>{var h;s.updateProperty(r,l);const c=u(this,ei).updateProperty(r,l);c&&L(this,Lt,Ah).call(this,c),(h=this.parent)==null||h.drawLayer.updateProperties(this._drawId,s.toSVGProperties())};this.addCommands({cmd:o.bind(this,n),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties(u(this,ei).getPathResizingSVGProperties(L(this,Lt,Op).call(this)),{bbox:L(this,Lt,cu).call(this)}))}_onResized(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties(u(this,ei).getPathResizedSVGProperties(L(this,Lt,Op).call(this)),{bbox:L(this,Lt,cu).call(this)}))}_onTranslating(t,r){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,{bbox:L(this,Lt,cu).call(this)})}_onTranslated(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties(u(this,ei).getPathTranslatedSVGProperties(L(this,Lt,Op).call(this),this.parentDimensions),{bbox:L(this,Lt,cu).call(this)}))}_onStartDragging(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,u(this,mc)&&(T(this,mc,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){L(this,Lt,rb).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(L(this,Lt,xh).call(this),L(this,Lt,Ah).call(this,u(this,ei).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var n;let r=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),L(this,Lt,rb).call(this)):t&&(this._uiManager.addShouldRescale(this),L(this,Lt,xh).call(this,t),r=!this.parent&&((n=this.div)==null?void 0:n.classList.contains("selectedEditor"))),super.setParent(t),r&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties({bbox:L(this,Lt,cu).call(this)},u(this,ei).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&L(this,Lt,Ah).call(this,u(this,ei).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,r;this._isCopy&&(t=this.x,r=this.y);const n=super.render();n.classList.add("draw");const s=document.createElement("div");n.append(s),s.setAttribute("aria-hidden","true"),s.className="internal";const[a,o]=this.parentDimensions;return this.setDims(this.width*a,this.height*o),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,r),n}static createDrawerInstance(t,r,n,s,a){Wt("Not implemented")}static startDrawing(t,r,n,s){var w;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:h}=s;if(u(We,Xa)&&u(We,Xa)!==h)return;const{viewport:{rotation:d}}=t,{width:p,height:g}=a.getBoundingClientRect(),y=T(We,_l,new AbortController),b=t.combinedSignal(y);if(u(We,Wa)||T(We,Wa,c),u(We,Xa)??T(We,Xa,h),window.addEventListener("pointerup",v=>{var A;u(We,Wa)===v.pointerId?this._endDraw(v):(A=u(We,Ya))==null||A.delete(v.pointerId)},{signal:b}),window.addEventListener("pointercancel",v=>{var A;u(We,Wa)===v.pointerId?this._currentParent.endDrawingSession():(A=u(We,Ya))==null||A.delete(v.pointerId)},{signal:b}),window.addEventListener("pointerdown",v=>{u(We,Xa)===v.pointerType&&((u(We,Ya)||T(We,Ya,new Set)).add(v.pointerId),u(We,Ur).isCancellable()&&(u(We,Ur).removeLastElement(),u(We,Ur).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:b}),window.addEventListener("contextmenu",Ei,{signal:b}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:b}),a.addEventListener("touchmove",v=>{v.timeStamp===u(We,Sl)&&_r(v)},{signal:b}),t.toggleDrawing(),(w=r._editorUndoBar)==null||w.hide(),u(We,Ur)){t.drawLayer.updateProperties(this._currentDrawId,u(We,Ur).startNew(o,l,p,g,d));return}r.updateUIForDefaultProperties(this),T(We,Ur,this.createDrawerInstance(o,l,p,g,d)),T(We,Cl,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(u(We,Cl).toSVGProperties(),u(We,Ur).defaultSVGProperties),!0,!1)}static _drawMove(t){var a;if(T(We,Sl,-1),!u(We,Ur))return;const{offsetX:r,offsetY:n,pointerId:s}=t;if(u(We,Wa)===s){if(((a=u(We,Ya))==null?void 0:a.size)>=1){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,u(We,Ur).add(r,n)),T(We,Sl,t.timeStamp),_r(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,T(We,Ur,null),T(We,Cl,null),T(We,Xa,null),T(We,Sl,NaN)),u(We,_l)&&(u(We,_l).abort(),T(We,_l,null),T(We,Wa,NaN),T(We,Ya,null))}static _endDraw(t){const r=this._currentParent;if(r){if(r.toggleDrawing(!0),this._cleanup(!1),(t==null?void 0:t.target)===r.div&&r.drawLayer.updateProperties(this._currentDrawId,u(We,Ur).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const n=u(We,Ur),s=this._currentDrawId,a=n.getLastElement();r.addCommands({cmd:()=>{r.drawLayer.updateProperties(s,n.setLastElement(a))},undo:()=>{r.drawLayer.updateProperties(s,n.removeLastElement())},mustExec:!1,type:kt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const r=this._currentParent;if(!r)return null;if(r.toggleDrawing(!0),r.cleanUndoStack(kt.DRAW_STEP),!u(We,Ur).isEmpty()){const{pageDimensions:[n,s],scale:a}=r,o=r.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:u(We,Ur).getOutlines(n*a,s*a,a,this._INNER_MARGIN),drawingOptions:u(We,Cl),mustBeCommitted:!t});return this._cleanup(!0),o}return r.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,r,n,s,a,o){Wt("Not implemented")}static async deserialize(t,r,n){var d,p;const{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}=r.viewport,c=this.deserializeDraw(o,l,s,a,this._INNER_MARGIN,t),h=await super.deserialize(t,r,n);return h.createDrawingOptions(t),L(d=h,Lt,eb).call(d,{drawOutlines:c}),L(p=h,Lt,xh).call(p),h.onScaleChanging(),h.rotate(),h}serializeDraw(t){const[r,n]=this.pageTranslation,[s,a]=this.pageDimensions;return u(this,ei).serialize([r,n,s,a],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};ei=new WeakMap,mc=new WeakMap,Ur=new WeakMap,_l=new WeakMap,Cl=new WeakMap,Wa=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,Sl=new WeakMap,Lt=new WeakSet,eb=function({drawOutlines:t,drawId:r,drawingOptions:n}){T(this,ei,t),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),r>=0?(this._drawId=r,this.parent.drawLayer.finalizeDraw(r,t.defaultProperties)):this._drawId=L(this,Lt,tb).call(this,t,this.parent),L(this,Lt,Ah).call(this,t.box)},tb=function(t,r){const{id:n}=r.drawLayer.draw(We._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return n},rb=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},xh=function(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=L(this,Lt,tb).call(this,u(this,ei),t)}},Yw=function([t,r,n,s]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[r,1-t,n*(o/a),s*(a/o)];case 180:return[1-t,1-r,n,s];case 270:return[1-r,t,n*(o/a),s*(a/o)];default:return[t,r,n,s]}},Op=function(){const{x:t,y:r,width:n,height:s,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-r,t,n*(a/o),s*(o/a)];case 180:return[1-t,1-r,n,s];case 270:return[r,1-t,n*(a/o),s*(o/a)];default:return[t,r,n,s]}},Ah=function(t){if([this.x,this.y,this.width,this.height]=L(this,Lt,Yw).call(this,t),this.div){this.fixAndSetPosition();const[r,n]=this.parentDimensions;this.setDims(this.width*r,this.height*n)}this._onResized()},cu=function(){const{x:t,y:r,width:n,height:s,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*4+o)/90){case 1:return[1-r-s,t,s,n];case 2:return[1-t-n,1-r-s,n,s];case 3:return[r,1-t-n,s,n];case 4:return[t,r-n*(l/c),s*(c/l),n*(l/c)];case 5:return[1-r,t,n*(l/c),s*(c/l)];case 6:return[1-t-s*(c/l),1-r,s*(c/l),n*(l/c)];case 7:return[r-n*(l/c),1-t-s*(c/l),n*(l/c),s*(c/l)];case 8:return[t-n,r-s,n,s];case 9:return[1-r,t-n,s,n];case 10:return[1-t,1-r,n,s];case 11:return[r-s,1-t,s,n];case 12:return[t-s*(c/l),r,s*(c/l),n*(l/c)];case 13:return[1-r-n*(l/c),t-s*(c/l),n*(l/c),s*(c/l)];case 14:return[1-t,1-r-n*(l/c),s*(c/l),n*(l/c)];case 15:return[r,1-t,n*(l/c),s*(c/l)];default:return[t,r,n,s]}},Ie(We,"_currentDrawId",-1),Ie(We,"_currentParent",null),N(We,Ur,null),N(We,_l,null),N(We,Cl,null),N(We,Wa,NaN),N(We,Xa,null),N(We,Ya,null),N(We,Sl,NaN),Ie(We,"_INNER_MARGIN",3);let Qp=We;var ds,Hr,$r,Tl,bc,xn,Jr,bi,kl,Dl,Pl,vc,Fp;class rS{constructor(e,t,r,n,s,a){N(this,vc);N(this,ds,new Float64Array(6));N(this,Hr);N(this,$r);N(this,Tl);N(this,bc);N(this,xn);N(this,Jr,"");N(this,bi,0);N(this,kl,new Rf);N(this,Dl);N(this,Pl);T(this,Dl,r),T(this,Pl,n),T(this,Tl,s),T(this,bc,a),[e,t]=L(this,vc,Fp).call(this,e,t);const o=T(this,Hr,[NaN,NaN,NaN,NaN,e,t]);T(this,xn,[e,t]),T(this,$r,[{line:o,points:u(this,xn)}]),u(this,ds).set(o,0)}updateProperty(e,t){e==="stroke-width"&&T(this,bc,t)}isEmpty(){return!u(this,$r)||u(this,$r).length===0}isCancellable(){return u(this,xn).length<=10}add(e,t){[e,t]=L(this,vc,Fp).call(this,e,t);const[r,n,s,a]=u(this,ds).subarray(2,6),o=e-s,l=t-a;return Math.hypot(u(this,Dl)*o,u(this,Pl)*l)<=2?null:(u(this,xn).push(e,t),isNaN(r)?(u(this,ds).set([s,a,e,t],2),u(this,Hr).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(u(this,ds)[0])&&u(this,Hr).splice(6,6),u(this,ds).set([r,n,s,a,e,t],0),u(this,Hr).push(...qe.createBezierPoints(r,n,s,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const r=this.add(e,t);return r||(u(this,xn).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,r,n,s){T(this,Dl,r),T(this,Pl,n),T(this,Tl,s),[e,t]=L(this,vc,Fp).call(this,e,t);const a=T(this,Hr,[NaN,NaN,NaN,NaN,e,t]);T(this,xn,[e,t]);const o=u(this,$r).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),u(this,$r).push({line:a,points:u(this,xn)}),u(this,ds).set(a,0),T(this,bi,0),this.toSVGPath(),null}getLastElement(){return u(this,$r).at(-1)}setLastElement(e){return u(this,$r)?(u(this,$r).push(e),T(this,Hr,e.line),T(this,xn,e.points),T(this,bi,0),{path:{d:this.toSVGPath()}}):u(this,kl).setLastElement(e)}removeLastElement(){if(!u(this,$r))return u(this,kl).removeLastElement();u(this,$r).pop(),T(this,Jr,"");for(let e=0,t=u(this,$r).length;e<t;e++){const{line:r,points:n}=u(this,$r)[e];T(this,Hr,r),T(this,xn,n),T(this,bi,0),this.toSVGPath()}return{path:{d:u(this,Jr)}}}toSVGPath(){const e=qe.svgRound(u(this,Hr)[4]),t=qe.svgRound(u(this,Hr)[5]);if(u(this,xn).length===2)return T(this,Jr,`${u(this,Jr)} M ${e} ${t} Z`),u(this,Jr);if(u(this,xn).length<=6){const n=u(this,Jr).lastIndexOf("M");T(this,Jr,`${u(this,Jr).slice(0,n)} M ${e} ${t}`),T(this,bi,6)}if(u(this,xn).length===4){const n=qe.svgRound(u(this,Hr)[10]),s=qe.svgRound(u(this,Hr)[11]);return T(this,Jr,`${u(this,Jr)} L ${n} ${s}`),T(this,bi,12),u(this,Jr)}const r=[];u(this,bi)===0&&(r.push(`M ${e} ${t}`),T(this,bi,6));for(let n=u(this,bi),s=u(this,Hr).length;n<s;n+=6){const[a,o,l,c,h,d]=u(this,Hr).slice(n,n+6).map(qe.svgRound);r.push(`C${a} ${o} ${l} ${c} ${h} ${d}`)}return T(this,Jr,u(this,Jr)+r.join(" ")),T(this,bi,u(this,Hr).length),u(this,Jr)}getOutlines(e,t,r,n){const s=u(this,$r).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),u(this,kl).build(u(this,$r),e,t,r,u(this,Tl),u(this,bc),n),T(this,ds,null),T(this,Hr,null),T(this,$r,null),T(this,Jr,null),u(this,kl)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}ds=new WeakMap,Hr=new WeakMap,$r=new WeakMap,Tl=new WeakMap,bc=new WeakMap,xn=new WeakMap,Jr=new WeakMap,bi=new WeakMap,kl=new WeakMap,Dl=new WeakMap,Pl=new WeakMap,vc=new WeakSet,Fp=function(e,t){return qe._normalizePoint(e,t,u(this,Dl),u(this,Pl),u(this,Tl))};var An,Af,Ef,ti,fs,ps,yc,wc,Rl,rn,Ds,Zw,Kw,Qw;class Rf extends qe{constructor(){super(...arguments);N(this,rn);N(this,An);N(this,Af,0);N(this,Ef);N(this,ti);N(this,fs);N(this,ps);N(this,yc);N(this,wc);N(this,Rl)}build(t,r,n,s,a,o,l){T(this,fs,r),T(this,ps,n),T(this,yc,s),T(this,wc,a),T(this,Rl,o),T(this,Ef,l??0),T(this,ti,t),L(this,rn,Kw).call(this)}get thickness(){return u(this,Rl)}setLastElement(t){return u(this,ti).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return u(this,ti).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:r}of u(this,ti)){if(t.push(`M${qe.svgRound(r[4])} ${qe.svgRound(r[5])}`),r.length===6){t.push("Z");continue}if(r.length===12&&isNaN(r[6])){t.push(`L${qe.svgRound(r[10])} ${qe.svgRound(r[11])}`);continue}for(let n=6,s=r.length;n<s;n+=6){const[a,o,l,c,h,d]=r.subarray(n,n+6).map(qe.svgRound);t.push(`C${a} ${o} ${l} ${c} ${h} ${d}`)}}return t.join("")}serialize([t,r,n,s],a){const o=[],l=[],[c,h,d,p]=L(this,rn,Zw).call(this);let g,y,b,w,v,A,E,_,C;switch(u(this,wc)){case 0:C=qe._rescale,g=t,y=r+s,b=n,w=-s,v=t+c*n,A=r+(1-h-p)*s,E=t+(c+d)*n,_=r+(1-h)*s;break;case 90:C=qe._rescaleAndSwap,g=t,y=r,b=n,w=s,v=t+h*n,A=r+c*s,E=t+(h+p)*n,_=r+(c+d)*s;break;case 180:C=qe._rescale,g=t+n,y=r,b=-n,w=s,v=t+(1-c-d)*n,A=r+h*s,E=t+(1-c)*n,_=r+(h+p)*s;break;case 270:C=qe._rescaleAndSwap,g=t+n,y=r+s,b=-n,w=-s,v=t+(1-h-p)*n,A=r+(1-c-d)*s,E=t+(1-h)*n,_=r+(1-c)*s;break}for(const{line:I,points:k}of u(this,ti))o.push(C(I,g,y,b,w,a?new Array(I.length):null)),l.push(C(k,g,y,b,w,a?new Array(k.length):null));return{lines:o,points:l,rect:[v,A,E,_]}}static deserialize(t,r,n,s,a,{paths:{lines:o,points:l},rotation:c,thickness:h}){const d=[];let p,g,y,b,w;switch(c){case 0:w=qe._rescale,p=-t/n,g=r/s+1,y=1/n,b=-1/s;break;case 90:w=qe._rescaleAndSwap,p=-r/s,g=-t/n,y=1/s,b=1/n;break;case 180:w=qe._rescale,p=t/n+1,g=-r/s,y=-1/n,b=1/s;break;case 270:w=qe._rescaleAndSwap,p=r/s+1,g=t/n+1,y=-1/s,b=-1/n;break}if(!o){o=[];for(const A of l){const E=A.length;if(E===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,A[0],A[1]]));continue}if(E===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,A[0],A[1],NaN,NaN,NaN,NaN,A[2],A[3]]));continue}const _=new Float32Array(3*(E-2));o.push(_);let[C,I,k,D]=A.subarray(0,4);_.set([NaN,NaN,NaN,NaN,C,I],0);for(let R=4;R<E;R+=2){const z=A[R],G=A[R+1];_.set(qe.createBezierPoints(C,I,k,D,z,G),(R-2)*3),[C,I,k,D]=[k,D,z,G]}}}for(let A=0,E=o.length;A<E;A++)d.push({line:w(o[A].map(_=>_??NaN),p,g,y,b),points:w(l[A].map(_=>_??NaN),p,g,y,b)});const v=new this.prototype.constructor;return v.build(d,n,s,1,c,h,a),v}get box(){return u(this,An)}updateProperty(t,r){return t==="stroke-width"?L(this,rn,Qw).call(this,r):null}updateParentDimensions([t,r],n){const[s,a]=L(this,rn,Ds).call(this);T(this,fs,t),T(this,ps,r),T(this,yc,n);const[o,l]=L(this,rn,Ds).call(this),c=o-s,h=l-a,d=u(this,An);return d[0]-=c,d[1]-=h,d[2]+=2*c,d[3]+=2*h,d}updateRotation(t){return T(this,Af,t),{path:{transform:this.rotationTransform}}}get viewBox(){return u(this,An).map(qe.svgRound).join(" ")}get defaultProperties(){const[t,r]=u(this,An);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`}}}get rotationTransform(){const[,,t,r]=u(this,An);let n=0,s=0,a=0,o=0,l=0,c=0;switch(u(this,Af)){case 90:s=r/t,a=-t/r,l=t;break;case 180:n=-1,o=-1,l=t,c=r;break;case 270:s=-r/t,a=t/r,c=r;break;default:return""}return`matrix(${n} ${s} ${a} ${o} ${qe.svgRound(l)} ${qe.svgRound(c)})`}getPathResizingSVGProperties([t,r,n,s]){const[a,o]=L(this,rn,Ds).call(this),[l,c,h,d]=u(this,An);if(Math.abs(h-a)<=qe.PRECISION||Math.abs(d-o)<=qe.PRECISION){const w=t+n/2-(l+h/2),v=r+s/2-(c+d/2);return{path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`,transform:`${this.rotationTransform} translate(${w} ${v})`}}}const p=(n-2*a)/(h-2*a),g=(s-2*o)/(d-2*o),y=h/n,b=d/s;return{path:{"transform-origin":`${qe.svgRound(l)} ${qe.svgRound(c)}`,transform:`${this.rotationTransform} scale(${y} ${b}) translate(${qe.svgRound(a)} ${qe.svgRound(o)}) scale(${p} ${g}) translate(${qe.svgRound(-a)} ${qe.svgRound(-o)})`}}}getPathResizedSVGProperties([t,r,n,s]){const[a,o]=L(this,rn,Ds).call(this),l=u(this,An),[c,h,d,p]=l;if(l[0]=t,l[1]=r,l[2]=n,l[3]=s,Math.abs(d-a)<=qe.PRECISION||Math.abs(p-o)<=qe.PRECISION){const v=t+n/2-(c+d/2),A=r+s/2-(h+p/2);for(const{line:E,points:_}of u(this,ti))qe._translate(E,v,A,E),qe._translate(_,v,A,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const g=(n-2*a)/(d-2*a),y=(s-2*o)/(p-2*o),b=-g*(c+a)+t+a,w=-y*(h+o)+r+o;if(g!==1||y!==1||b!==0||w!==0)for(const{line:v,points:A}of u(this,ti))qe._rescale(v,b,w,g,y,v),qe._rescale(A,b,w,g,y,A);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,r],n){const[s,a]=n,o=u(this,An),l=t-o[0],c=r-o[1];if(u(this,fs)===s&&u(this,ps)===a)for(const{line:h,points:d}of u(this,ti))qe._translate(h,l,c,h),qe._translate(d,l,c,d);else{const h=u(this,fs)/s,d=u(this,ps)/a;T(this,fs,s),T(this,ps,a);for(const{line:p,points:g}of u(this,ti))qe._rescale(p,l,c,h,d,p),qe._rescale(g,l,c,h,d,g);o[2]*=h,o[3]*=d}return o[0]=t,o[1]=r,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`}}}get defaultSVGProperties(){const t=u(this,An);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${qe.svgRound(t[0])} ${qe.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}An=new WeakMap,Af=new WeakMap,Ef=new WeakMap,ti=new WeakMap,fs=new WeakMap,ps=new WeakMap,yc=new WeakMap,wc=new WeakMap,Rl=new WeakMap,rn=new WeakSet,Ds=function(t=u(this,Rl)){const r=u(this,Ef)+t/2*u(this,yc);return u(this,wc)%180===0?[r/u(this,fs),r/u(this,ps)]:[r/u(this,ps),r/u(this,fs)]},Zw=function(){const[t,r,n,s]=u(this,An),[a,o]=L(this,rn,Ds).call(this,0);return[t+a,r+o,n-2*a,s-2*o]},Kw=function(){const t=T(this,An,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:s}of u(this,ti)){if(s.length<=12){for(let l=4,c=s.length;l<c;l+=6)Qe.pointBoundingBox(s[l],s[l+1],t);continue}let a=s[4],o=s[5];for(let l=6,c=s.length;l<c;l+=6){const[h,d,p,g,y,b]=s.subarray(l,l+6);Qe.bezierBoundingBox(a,o,h,d,p,g,y,b,t),a=y,o=b}}const[r,n]=L(this,rn,Ds).call(this);t[0]=dn(t[0]-r,0,1),t[1]=dn(t[1]-n,0,1),t[2]=dn(t[2]+r,0,1),t[3]=dn(t[3]+n,0,1),t[2]-=t[0],t[3]-=t[1]},Qw=function(t){const[r,n]=L(this,rn,Ds).call(this);T(this,Rl,t);const[s,a]=L(this,rn,Ds).call(this),[o,l]=[s-r,a-n],c=u(this,An);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class Rg extends Xw{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:tr._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??(t=this["stroke-width"]),t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){const e=new Rg(this._viewParameters);return e.updateAll(this),e}}var Ag,Jw;const gu=class gu extends Qp{constructor(t){super({...t,name:"inkEditor"});N(this,Ag);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,r){tr.initialize(t,r),this._defaultDrawingOptions=new Rg(r.viewParameters)}static getDefaultDrawingOptions(t){const r=this._defaultDrawingOptions.clone();return r.updateProperties(t),r}static get supportMultipleDrawings(){return!0}static get typesMap(){return Ct(this,"typesMap",new Map([[kt.INK_THICKNESS,"stroke-width"],[kt.INK_COLOR,"stroke"],[kt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,r,n,s,a){return new rS(t,r,n,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,r,n,s,a,o){return Rf.deserialize(t,r,n,s,a,o)}static async deserialize(t,r,n){let s=null;if(t instanceof Hb){const{data:{inkLists:o,rect:l,rotation:c,id:h,color:d,opacity:p,borderStyle:{rawWidth:g},popupRef:y},parent:{page:{pageNumber:b}}}=t;s=t={annotationType:ot.INK,color:Array.from(d),thickness:g,opacity:p,paths:{points:o},boxes:null,pageIndex:b-1,rect:l.slice(0),rotation:c,annotationElementId:h,id:h,deleted:!1,popupRef:y}}const a=await super.deserialize(t,r,n);return a._initialData=s,a}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:r,parent:n}=this;r.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(t,r.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:r,opacity:n}){this._drawingOptions=gu.getDefaultDrawingOptions({stroke:Qe.makeHexColor(...t),"stroke-width":r,"stroke-opacity":n})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:r,points:n,rect:s}=this.serializeDraw(t),{_drawingOptions:{stroke:a,"stroke-opacity":o,"stroke-width":l}}=this,c={annotationType:ot.INK,color:tr._colorManager.convert(a),opacity:o,thickness:l,paths:{lines:r,points:n},pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(c.isCopy=!0,c):this.annotationElementId&&!L(this,Ag,Jw).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(t){const{points:r,rect:n}=this.serializeDraw(!1);return t.updateEdited({rect:n,thickness:this._drawingOptions["stroke-width"],points:r}),null}};Ag=new WeakSet,Jw=function(t){const{color:r,thickness:n,opacity:s,pageIndex:a}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||t.color.some((o,l)=>o!==r[l])||t.thickness!==n||t.opacity!==s||t.pageIndex!==a},Ie(gu,"_type","ink"),Ie(gu,"_editorType",ot.INK),Ie(gu,"_defaultDrawingOptions",null);let nb=gu;class ib extends Rf{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const ap=8,Jc=3;var Il,zt,sb,Hi,ex,tx,ab,Bp,rx,nx,ix,ob,lb,sx;class ys{static extractContoursFromText(e,{fontFamily:t,fontStyle:r,fontWeight:n},s,a,o,l){let c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const d=200,p=h.font=`${r} ${n} ${d}px ${t}`,{actualBoundingBoxLeft:g,actualBoundingBoxRight:y,actualBoundingBoxAscent:b,actualBoundingBoxDescent:w,fontBoundingBoxAscent:v,fontBoundingBoxDescent:A,width:E}=h.measureText(e),_=1.5,C=Math.ceil(Math.max(Math.abs(g)+Math.abs(y)||0,E)*_),I=Math.ceil(Math.max(Math.abs(b)+Math.abs(w)||d,Math.abs(v)+Math.abs(A)||d)*_);c=new OffscreenCanvas(C,I),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=p,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,C,I),h.fillStyle="black",h.fillText(e,C*(_-1)/2,I*(3-_)/2);const k=L(this,zt,ob).call(this,h.getImageData(0,0,C,I).data),D=L(this,zt,ix).call(this,k),R=L(this,zt,lb).call(this,D),z=L(this,zt,ab).call(this,k,C,I,R);return this.processDrawnLines({lines:{curves:z,width:C,height:I},pageWidth:s,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,t,r,n,s){const[a,o,l]=L(this,zt,sx).call(this,e),[c,h]=L(this,zt,nx).call(this,a,o,l,Math.hypot(o,l)*u(this,Il).sigmaSFactor,u(this,Il).sigmaR,u(this,Il).kernelSize),d=L(this,zt,lb).call(this,h),p=L(this,zt,ab).call(this,c,o,l,d);return this.processDrawnLines({lines:{curves:p,width:o,height:l},pageWidth:t,pageHeight:r,rotation:n,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:r,rotation:n,innerMargin:s,mustSmooth:a,areContours:o}){n%180!==0&&([t,r]=[r,t]);const{curves:l,width:c,height:h}=e,d=e.thickness??0,p=[],g=Math.min(t/c,r/h),y=g/t,b=g/r,w=[];for(const{points:A}of l){const E=a?L(this,zt,rx).call(this,A):A;if(!E)continue;w.push(E);const _=E.length,C=new Float32Array(_),I=new Float32Array(3*(_===2?2:_-2));if(p.push({line:I,points:C}),_===2){C[0]=E[0]*y,C[1]=E[1]*b,I.set([NaN,NaN,NaN,NaN,C[0],C[1]],0);continue}let[k,D,R,z]=E;k*=y,D*=b,R*=y,z*=b,C.set([k,D,R,z],0),I.set([NaN,NaN,NaN,NaN,k,D],0);for(let G=4;G<_;G+=2){const O=C[G]=E[G]*y,X=C[G+1]=E[G+1]*b;I.set(qe.createBezierPoints(k,D,R,z,O,X),(G-2)*3),[k,D,R,z]=[R,z,O,X]}}if(p.length===0)return null;const v=o?new ib:new Rf;return v.build(p,t,r,1,n,o?0:d,s),{outline:v,newCurves:w,areContours:o,thickness:d,width:c,height:h}}static async compressSignature({outlines:e,areContours:t,thickness:r,width:n,height:s}){let a=1/0,o=-1/0,l=0;for(const E of e){l+=E.length;for(let _=2,C=E.length;_<C;_++){const I=E[_]-E[_-2];a=Math.min(a,I),o=Math.max(o,I)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const h=e.length,d=ap+Jc*h,p=new Uint32Array(d);let g=0;p[g++]=d*Uint32Array.BYTES_PER_ELEMENT+(l-2*h)*c.BYTES_PER_ELEMENT,p[g++]=0,p[g++]=n,p[g++]=s,p[g++]=t?0:1,p[g++]=Math.max(0,Math.floor(r??0)),p[g++]=h,p[g++]=c.BYTES_PER_ELEMENT;for(const E of e)p[g++]=E.length-2,p[g++]=E[0],p[g++]=E[1];const y=new CompressionStream("deflate-raw"),b=y.writable.getWriter();await b.ready,b.write(p);const w=c.prototype.constructor;for(const E of e){const _=new w(E.length-2);for(let C=2,I=E.length;C<I;C++)_[C-2]=E[C]-E[C-2];b.write(_)}b.close();const v=await new Response(y.readable).arrayBuffer(),A=new Uint8Array(v);return n1(A)}static async decompressSignature(e){try{const t=I_(e),{readable:r,writable:n}=new DecompressionStream("deflate-raw"),s=n.getWriter();await s.ready,s.write(t).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(const E of r)a||(a=new Uint8Array(new Uint32Array(E.buffer,0,4)[0])),a.set(E,o),o+=E.length;const l=new Uint32Array(a.buffer,0,a.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const h=l[2],d=l[3],p=l[4]===0,g=l[5],y=l[6],b=l[7],w=[],v=(ap+Jc*y)*Uint32Array.BYTES_PER_ELEMENT;let A;switch(b){case Int8Array.BYTES_PER_ELEMENT:A=new Int8Array(a.buffer,v);break;case Int16Array.BYTES_PER_ELEMENT:A=new Int16Array(a.buffer,v);break;case Int32Array.BYTES_PER_ELEMENT:A=new Int32Array(a.buffer,v);break}o=0;for(let E=0;E<y;E++){const _=l[Jc*E+ap],C=new Float32Array(_+2);w.push(C);for(let I=0;I<Jc-1;I++)C[I]=l[Jc*E+ap+I+1];for(let I=0;I<_;I++)C[I+2]=C[I]+A[o++]}return{areContours:p,thickness:g,outlines:w,width:h,height:d}}catch(t){return ut(`decompressSignature: ${t}`),null}}}Il=new WeakMap,zt=new WeakSet,sb=function(e,t,r,n){return r-=e,n-=t,r===0?n>0?0:4:r===1?n+6:2-n},Hi=new WeakMap,ex=function(e,t,r,n,s,a,o){const l=L(this,zt,sb).call(this,r,n,s,a);for(let c=0;c<8;c++){const h=(-c+l-o+16)%8,d=u(this,Hi)[2*h],p=u(this,Hi)[2*h+1];if(e[(r+d)*t+(n+p)]!==0)return h}return-1},tx=function(e,t,r,n,s,a,o){const l=L(this,zt,sb).call(this,r,n,s,a);for(let c=0;c<8;c++){const h=(c+l+o+16)%8,d=u(this,Hi)[2*h],p=u(this,Hi)[2*h+1];if(e[(r+d)*t+(n+p)]!==0)return h}return-1},ab=function(e,t,r,n){const s=e.length,a=new Int32Array(s);for(let h=0;h<s;h++)a[h]=e[h]<=n?1:0;for(let h=1;h<r-1;h++)a[h*t]=a[h*t+t-1]=0;for(let h=0;h<t;h++)a[h]=a[t*r-1-h]=0;let o=1,l;const c=[];for(let h=1;h<r-1;h++){l=1;for(let d=1;d<t-1;d++){const p=h*t+d,g=a[p];if(g===0)continue;let y=h,b=d;if(g===1&&a[p-1]===0)o+=1,b-=1;else if(g>=1&&a[p+1]===0)o+=1,b+=1,g>1&&(l=g);else{g!==1&&(l=Math.abs(g));continue}const w=[d,h],v=b===d+1,A={isHole:v,points:w,id:o,parent:0};c.push(A);let E;for(const G of c)if(G.id===l){E=G;break}E?E.isHole?A.parent=v?E.parent:l:A.parent=v?l:E.parent:A.parent=v?l:0;const _=L(this,zt,ex).call(this,a,t,h,d,y,b,0);if(_===-1){a[p]=-o,a[p]!==1&&(l=Math.abs(a[p]));continue}let C=u(this,Hi)[2*_],I=u(this,Hi)[2*_+1];const k=h+C,D=d+I;y=k,b=D;let R=h,z=d;for(;;){const G=L(this,zt,tx).call(this,a,t,R,z,y,b,1);C=u(this,Hi)[2*G],I=u(this,Hi)[2*G+1];const O=R+C,X=z+I;w.push(X,O);const S=R*t+z;if(a[S+1]===0?a[S]=-o:a[S]===1&&(a[S]=o),O===h&&X===d&&R===k&&z===D){a[p]!==1&&(l=Math.abs(a[p]));break}else y=R,b=z,R=O,z=X}}}return c},Bp=function(e,t,r,n){if(r-t<=4){for(let k=t;k<r-2;k+=2)n.push(e[k],e[k+1]);return}const s=e[t],a=e[t+1],o=e[r-4]-s,l=e[r-3]-a,c=Math.hypot(o,l),h=o/c,d=l/c,p=h*a-d*s,g=l/o,y=1/c,b=Math.atan(g),w=Math.cos(b),v=Math.sin(b),A=y*(Math.abs(w)+Math.abs(v)),E=y*(1-A+A**2),_=Math.max(Math.atan(Math.abs(v+w)*E),Math.atan(Math.abs(v-w)*E));let C=0,I=t;for(let k=t+2;k<r-2;k+=2){const D=Math.abs(p-h*e[k+1]+d*e[k]);D>C&&(I=k,C=D)}C>(c*_)**2?(L(this,zt,Bp).call(this,e,t,I+2,n),L(this,zt,Bp).call(this,e,I,r,n)):n.push(s,a)},rx=function(e){const t=[],r=e.length;return L(this,zt,Bp).call(this,e,0,r,t),t.push(e[r-2],e[r-1]),t.length<=4?null:t},nx=function(e,t,r,n,s,a){const o=new Float32Array(a**2),l=-2*n**2,c=a>>1;for(let b=0;b<a;b++){const w=(b-c)**2;for(let v=0;v<a;v++)o[b*a+v]=Math.exp((w+(v-c)**2)/l)}const h=new Float32Array(256),d=-2*s**2;for(let b=0;b<256;b++)h[b]=Math.exp(b**2/d);const p=e.length,g=new Uint8Array(p),y=new Uint32Array(256);for(let b=0;b<r;b++)for(let w=0;w<t;w++){const v=b*t+w,A=e[v];let E=0,_=0;for(let I=0;I<a;I++){const k=b+I-c;if(!(k<0||k>=r))for(let D=0;D<a;D++){const R=w+D-c;if(R<0||R>=t)continue;const z=e[k*t+R],G=o[I*a+D]*h[Math.abs(z-A)];E+=z*G,_+=G}}const C=g[v]=Math.round(E/_);y[C]++}return[g,y]},ix=function(e){const t=new Uint32Array(256);for(const r of e)t[r]++;return t},ob=function(e){const t=e.length,r=new Uint8ClampedArray(t>>2);let n=-1/0,s=1/0;for(let o=0,l=r.length;o<l;o++){if(e[(o<<2)+3]===0){n=r[o]=255;continue}const h=r[o]=e[o<<2];h>n&&(n=h),h<s&&(s=h)}const a=255/(n-s);for(let o=0;o<t;o++)r[o]=(r[o]-s)*a;return r},lb=function(e){let t,r=-1/0,n=-1/0;const s=e.findIndex(l=>l!==0);let a=s,o=s;for(t=s;t<256;t++){const l=e[t];l>r&&(t-a>n&&(n=t-a,o=t-1),r=l,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t},sx=function(e){const t=e,{width:r,height:n}=e,{maxDim:s}=u(this,Il);let a=r,o=n;if(r>s||n>s){let p=r,g=n,y=Math.log2(Math.max(r,n)/s);const b=Math.floor(y);y=y===b?b-1:b;for(let v=0;v<y;v++){a=Math.ceil(p/2),o=Math.ceil(g/2);const A=new OffscreenCanvas(a,o);A.getContext("2d").drawImage(e,0,0,p,g,0,0,a,o),p=a,g=o,e!==t&&e.close(),e=A.transferToImageBitmap()}const w=Math.min(s/a,s/o);a=Math.round(a*w),o=Math.round(o*w)}const c=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,a,o);const h=c.getImageData(0,0,a,o).data;return[L(this,zt,ob).call(this,h),a,o]},N(ys,zt),N(ys,Il,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),N(ys,Hi,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class Vb extends Xw{constructor(){super(),super.updateProperties({fill:tr._defaultLineColor,"stroke-width":0})}clone(){const e=new Vb;return e.updateAll(this),e}}class Gb extends Rg{constructor(e){super(e),super.updateProperties({stroke:tr._defaultLineColor,"stroke-width":1})}clone(){const e=new Gb(this._viewParameters);return e.updateAll(this),e}}var Za,gs,Ka,Nl;const $n=class $n extends Qp{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});N(this,Za,!1);N(this,gs,null);N(this,Ka,null);N(this,Nl,null);this._willKeepAspectRatio=!0,T(this,Ka,t.signatureData||null),T(this,gs,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,r){tr.initialize(t,r),this._defaultDrawingOptions=new Vb,this._defaultDrawnSignatureOptions=new Gb(r.viewParameters)}static getDefaultDrawingOptions(t){const r=this._defaultDrawingOptions.clone();return r.updateProperties(t),r}static get supportMultipleDrawings(){return!1}static get typesMap(){return Ct(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!u(this,gs)}}static computeTelemetryFinalData(t){const r=t.get("hasDescription");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,r;const{_isCopy:n}=this;if(n&&(this._isCopy=!1,t=this.x,r=this.y),super.render(),this._drawId===null)if(u(this,Ka)){const{lines:s,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:h}=u(this,Ka),{rawDims:{pageWidth:d,pageHeight:p},rotation:g}=this.parent.viewport,y=ys.processDrawnLines({lines:s,pageWidth:d,pageHeight:p,rotation:g,innerMargin:$n._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(y,h,l,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);return n&&(this._isCopy=!0,this._moveAfterPaste(t,r)),this.div}setUuid(t){T(this,Nl,t),this.addEditToolbar()}getUuid(){return u(this,Nl)}get description(){return u(this,gs)}set description(t){T(this,gs,t),super.addEditToolbar().then(r=>{r==null||r.updateEditSignatureButton(t)})}getSignaturePreview(){const{newCurves:t,areContours:r,thickness:n,width:s,height:a}=u(this,Ka),o=Math.max(s,a),l=ys.processDrawnLines({lines:{curves:t.map(c=>({points:c})),thickness:n,width:s,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:r});return{areContours:r,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,r,n,s){const{x:a,y:o}=this,{outline:l}=T(this,Ka,t);T(this,Za,l instanceof ib),this.description=n,this.div.setAttribute("data-l10n-args",JSON.stringify({description:n}));let c;u(this,Za)?c=$n.getDefaultDrawingOptions():(c=$n._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[h,d]=this.parentDimensions,[,p]=this.pageDimensions;let g=r/p;g=g>=1?.5:g,this.width*=g/this.height,this.width>=1&&(g*=.9/this.width,this.width=.9),this.height=g,this.setDims(h*this.width,d*this.height),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!n}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:r,pageHeight:n},rotation:s}=this.parent.viewport;return ys.process(t,r,n,s,$n._INNER_MARGIN)}getFromText(t,r){const{rawDims:{pageWidth:n,pageHeight:s},rotation:a}=this.parent.viewport;return ys.extractContoursFromText(t,r,n,s,a,$n._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:r,pageHeight:n},rotation:s}=this.parent.viewport;return ys.processDrawnLines({lines:t,pageWidth:r,pageHeight:n,rotation:s,innerMargin:$n._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:r}){t?this._drawingOptions=$n.getDefaultDrawingOptions():(this._drawingOptions=$n._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":r}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:r,points:n,rect:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":a}}=this,o={annotationType:ot.SIGNATURE,isSignature:!0,areContours:u(this,Za),color:[0,0,0],thickness:u(this,Za)?0:a,pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(o.paths={lines:r,points:n},o.uuid=u(this,Nl),o.isCopy=!0):o.lines=r,u(this,gs)&&(o.accessibilityData={type:"Figure",alt:u(this,gs)}),o}static deserializeDraw(t,r,n,s,a,o){return o.areContours?ib.deserialize(t,r,n,s,a,o):Rf.deserialize(t,r,n,s,a,o)}static async deserialize(t,r,n){var a;const s=await super.deserialize(t,r,n);return T(s,Za,t.areContours),T(s,gs,((a=t.accessibilityData)==null?void 0:a.alt)||""),T(s,Nl,t.uuid),s}};Za=new WeakMap,gs=new WeakMap,Ka=new WeakMap,Nl=new WeakMap,Ie($n,"_type","signature"),Ie($n,"_editorType",ot.SIGNATURE),Ie($n,"_defaultDrawingOptions",null);let ub=$n;var lr,Vr,Qa,na,Ja,xc,ia,Ml,ms,ri,Ac,Ot,Eh,_h,zp,jp,Up,hb,Hp,ax;class cb extends tr{constructor(t){super({...t,name:"stampEditor"});N(this,Ot);N(this,lr,null);N(this,Vr,null);N(this,Qa,null);N(this,na,null);N(this,Ja,null);N(this,xc,"");N(this,ia,null);N(this,Ml,!1);N(this,ms,null);N(this,ri,!1);N(this,Ac,!1);T(this,na,t.bitmapUrl),T(this,Ja,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,r){tr.initialize(t,r)}static isHandlingMimeForPasting(t){return Xp.includes(t)}static paste(t,r){r.pasteEditor({mode:ot.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!((t=this.altTextData)!=null&&t.altText)}}static computeTelemetryFinalData(t){const r=t.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(t=null,r=!0){if(this.hasAltTextData())return null;const{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:a,height:o}=t||this.copyCanvas(null,null,!0).imageData,l=await n.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),r&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var t;u(this,Vr)&&(T(this,lr,null),this._uiManager.imageManager.deleteId(u(this,Vr)),(t=u(this,ia))==null||t.remove(),T(this,ia,null),u(this,ms)&&(clearTimeout(u(this,ms)),T(this,ms,null))),super.remove()}rebuild(){if(!this.parent){u(this,Vr)&&L(this,Ot,zp).call(this);return}super.rebuild(),this.div!==null&&(u(this,Vr)&&u(this,ia)===null&&L(this,Ot,zp).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(u(this,Qa)||u(this,lr)||u(this,na)||u(this,Ja)||u(this,Vr)||u(this,Ml))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,r;return this._isCopy&&(t=this.x,r=this.y),super.render(),this.div.hidden=!0,this.createAltText(),u(this,Ml)||(u(this,lr)?L(this,Ot,jp).call(this):L(this,Ot,zp).call(this)),this._isCopy&&this._moveAfterPaste(t,r),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,r){const{id:n,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,r);r.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(T(this,Vr,n),s&&T(this,lr,s),T(this,Ml,!1),L(this,Ot,jp).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;u(this,ms)!==null&&clearTimeout(u(this,ms)),T(this,ms,setTimeout(()=>{T(this,ms,null),L(this,Ot,hb).call(this)},200))}copyCanvas(t,r,n=!1){var g;t||(t=224);const{width:s,height:a}=u(this,lr),o=new Wi;let l=u(this,lr),c=s,h=a,d=null;if(r){if(s>r||a>r){const D=Math.min(r/s,r/a);c=Math.floor(s*D),h=Math.floor(a*D)}d=document.createElement("canvas");const y=d.width=Math.ceil(c*o.sx),b=d.height=Math.ceil(h*o.sy);u(this,ri)||(l=L(this,Ot,Up).call(this,y,b));const w=d.getContext("2d");w.filter=this._uiManager.hcmFilter;let v="white",A="#cfcfd8";this._uiManager.hcmFilter!=="none"?A="black":(g=window.matchMedia)!=null&&g.call(window,"(prefers-color-scheme: dark)").matches&&(v="#8f8f9d",A="#42414d");const E=15,_=E*o.sx,C=E*o.sy,I=new OffscreenCanvas(_*2,C*2),k=I.getContext("2d");k.fillStyle=v,k.fillRect(0,0,_*2,C*2),k.fillStyle=A,k.fillRect(0,0,_,C),k.fillRect(_,C,_,C),w.fillStyle=w.createPattern(I,"repeat"),w.fillRect(0,0,y,b),w.drawImage(l,0,0,l.width,l.height,0,0,y,b)}let p=null;if(n){let y,b;if(o.symmetric&&l.width<t&&l.height<t)y=l.width,b=l.height;else if(l=u(this,lr),s>t||a>t){const A=Math.min(t/s,t/a);y=Math.floor(s*A),b=Math.floor(a*A),u(this,ri)||(l=L(this,Ot,Up).call(this,y,b))}const v=new OffscreenCanvas(y,b).getContext("2d",{willReadFrequently:!0});v.drawImage(l,0,0,l.width,l.height,0,0,y,b),p={width:y,height:b,data:v.getImageData(0,0,y,b).data}}return{canvas:d,width:c,height:h,imageData:p}}static async deserialize(t,r,n){var w;let s=null,a=!1;if(t instanceof xw){const{data:{rect:v,rotation:A,id:E,structParent:_,popupRef:C},container:I,parent:{page:{pageNumber:k}},canvas:D}=t;let R,z;D?(delete t.canvas,{id:R,bitmap:z}=n.imageManager.getFromCanvas(I.id,D),D.remove()):(a=!0,t._hasNoCanvas=!0);const G=((w=await r._structTree.getAriaAttributes(`${Nb}${E}`))==null?void 0:w.get("aria-label"))||"";s=t={annotationType:ot.STAMP,bitmapId:R,bitmap:z,pageIndex:k-1,rect:v.slice(0),rotation:A,annotationElementId:E,id:E,deleted:!1,accessibilityData:{decorative:!1,altText:G},isSvg:!1,structParent:_,popupRef:C}}const o=await super.deserialize(t,r,n),{rect:l,bitmap:c,bitmapUrl:h,bitmapId:d,isSvg:p,accessibilityData:g}=t;a?(n.addMissingCanvas(t.id,o),T(o,Ml,!0)):d&&n.imageManager.isValidId(d)?(T(o,Vr,d),c&&T(o,lr,c)):T(o,na,h),T(o,ri,p);const[y,b]=o.pageDimensions;return o.width=(l[2]-l[0])/y,o.height=(l[3]-l[1])/b,g&&(o.altTextData=g),o._initialData=s,T(o,Ac,!!s),o}serialize(t=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n={annotationType:ot.STAMP,bitmapId:u(this,Vr),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:u(this,ri),structTreeParentId:this._structTreeParentId};if(t)return n.bitmapUrl=L(this,Ot,Hp).call(this,!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;const{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(n.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=L(this,Ot,ax).call(this,n);if(l.isSame)return null;l.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1}if(n.id=this.annotationElementId,r===null)return n;r.stamps||(r.stamps=new Map);const o=u(this,ri)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!r.stamps.has(u(this,Vr)))r.stamps.set(u(this,Vr),{area:o,serialized:n}),n.bitmap=L(this,Ot,Hp).call(this,!1);else if(u(this,ri)){const l=r.stamps.get(u(this,Vr));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=L(this,Ot,Hp).call(this,!1))}return n}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}lr=new WeakMap,Vr=new WeakMap,Qa=new WeakMap,na=new WeakMap,Ja=new WeakMap,xc=new WeakMap,ia=new WeakMap,Ml=new WeakMap,ms=new WeakMap,ri=new WeakMap,Ac=new WeakMap,Ot=new WeakSet,Eh=function(t,r=!1){if(!t){this.remove();return}T(this,lr,t.bitmap),r||(T(this,Vr,t.id),T(this,ri,t.isSvg)),t.file&&T(this,xc,t.file.name),L(this,Ot,jp).call(this)},_h=function(){if(T(this,Qa,null),this._uiManager.enableWaiting(!1),!!u(this,ia)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&u(this,lr)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&u(this,lr)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},zp=function(){if(u(this,Vr)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(u(this,Vr)).then(n=>L(this,Ot,Eh).call(this,n,!0)).finally(()=>L(this,Ot,_h).call(this));return}if(u(this,na)){const n=u(this,na);T(this,na,null),this._uiManager.enableWaiting(!0),T(this,Qa,this._uiManager.imageManager.getFromUrl(n).then(s=>L(this,Ot,Eh).call(this,s)).finally(()=>L(this,Ot,_h).call(this)));return}if(u(this,Ja)){const n=u(this,Ja);T(this,Ja,null),this._uiManager.enableWaiting(!0),T(this,Qa,this._uiManager.imageManager.getFromFile(n).then(s=>L(this,Ot,Eh).call(this,s)).finally(()=>L(this,Ot,_h).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=Xp.join(",");const r=this._uiManager._signal;T(this,Qa,new Promise(n=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const s=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),L(this,Ot,Eh).call(this,s)}n()},{signal:r}),t.addEventListener("cancel",()=>{this.remove(),n()},{signal:r})}).finally(()=>L(this,Ot,_h).call(this))),t.click()},jp=function(){var d;const{div:t}=this;let{width:r,height:n}=u(this,lr);const[s,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*s,n=this.height*a;else if(r>o*s||n>o*a){const p=Math.min(o*s/r,o*a/n);r*=p,n*=p}const[l,c]=this.parentDimensions;this.setDims(r*l/s,n*c/a),this._uiManager.enableWaiting(!1);const h=T(this,ia,document.createElement("canvas"));h.setAttribute("role","img"),this.addContainer(h),this.width=r/s,this.height=n/a,(d=this._initialOptions)!=null&&d.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),L(this,Ot,hb).call(this),u(this,Ac)||(this.parent.addUndoableEditor(this),T(this,Ac,!0)),this._reportTelemetry({action:"inserted_image"}),u(this,xc)&&this.div.setAttribute("aria-description",u(this,xc)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},Up=function(t,r){const{width:n,height:s}=u(this,lr);let a=n,o=s,l=u(this,lr);for(;a>2*t||o>2*r;){const c=a,h=o;a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const d=new OffscreenCanvas(a,o);d.getContext("2d").drawImage(l,0,0,c,h,0,0,a,o),l=d.transferToImageBitmap()}return l},hb=function(){const[t,r]=this.parentDimensions,{width:n,height:s}=this,a=new Wi,o=Math.ceil(n*t*a.sx),l=Math.ceil(s*r*a.sy),c=u(this,ia);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const h=u(this,ri)?u(this,lr):L(this,Ot,Up).call(this,o,l),d=c.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(h,0,0,h.width,h.height,0,0,o,l)},Hp=function(t){if(t){if(u(this,ri)){const s=this._uiManager.imageManager.getSvgUrl(u(this,Vr));if(s)return s}const r=document.createElement("canvas");return{width:r.width,height:r.height}=u(this,lr),r.getContext("2d").drawImage(u(this,lr),0,0),r.toDataURL()}if(u(this,ri)){const[r,n]=this.pageDimensions,s=Math.round(this.width*r*da.PDF_TO_CSS_UNITS),a=Math.round(this.height*n*da.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(u(this,lr),0,0,u(this,lr).width,u(this,lr).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(u(this,lr))},ax=function(t){var o;const{pageIndex:r,accessibilityData:{altText:n}}=this._initialData,s=t.pageIndex===r,a=(((o=t.accessibilityData)==null?void 0:o.alt)||"")===n;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}},Ie(cb,"_type","stamp"),Ie(cb,"_editorType",ot.STAMP);var Ll,Ec,bs,eo,sa,ni,to,_c,Ol,$i,aa,Gr,oa,ro,Cc,Ze,no,ur,ox,Ji,db,fb,$p;const Ii=class Ii{constructor({uiManager:e,pageIndex:t,div:r,structTreeLayer:n,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:h}){N(this,ur);N(this,Ll);N(this,Ec,!1);N(this,bs,null);N(this,eo,null);N(this,sa,null);N(this,ni,new Map);N(this,to,!1);N(this,_c,!1);N(this,Ol,!1);N(this,$i,null);N(this,aa,null);N(this,Gr,null);N(this,oa,null);N(this,ro,null);N(this,Cc,-1);N(this,Ze);const d=[...u(Ii,no).values()];if(!Ii._initialized){Ii._initialized=!0;for(const p of d)p.initialize(h,e)}e.registerEditorTypes(d),T(this,Ze,e),this.pageIndex=t,this.div=r,T(this,Ll,s),T(this,bs,a),this.viewport=c,T(this,Gr,l),this.drawLayer=o,this._structTree=n,u(this,Ze).addLayer(this)}get isEmpty(){return u(this,ni).size===0}get isInvisible(){return this.isEmpty&&u(this,Ze).getMode()===ot.NONE}updateToolbar(e){u(this,Ze).updateToolbar(e)}updateMode(e=u(this,Ze).getMode()){switch(L(this,ur,$p).call(this),e){case ot.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case ot.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case ot.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of u(Ii,no).values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=u(this,Gr))==null?void 0:t.div)}setEditingState(e){u(this,Ze).setEditingState(e)}addCommands(e){u(this,Ze).addCommands(e)}cleanUndoStack(e){u(this,Ze).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var t;(t=u(this,bs))==null||t.div.classList.toggle("disabled",!e)}async enable(){var r;T(this,Ol,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(r=u(this,ro))==null||r.abort(),T(this,ro,null);const e=new Set;for(const n of u(this,ni).values())n.enableEditing(),n.show(!0),n.annotationElementId&&(u(this,Ze).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));if(!u(this,bs)){T(this,Ol,!1);return}const t=u(this,bs).getEditableAnnotations();for(const n of t){if(n.hide(),u(this,Ze).isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;const s=await this.deserialize(n);s&&(this.addOrRebuild(s),s.enableEditing())}T(this,Ol,!1)}disable(){var n;if(T(this,_c,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),u(this,Gr)&&!u(this,ro)){T(this,ro,new AbortController);const s=u(this,Ze).combinedSignal(u(this,ro));u(this,Gr).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:h}=a,d=u(this,Cc);if(h-d>500){T(this,Cc,h);return}T(this,Cc,-1);const{classList:p}=this.div;p.toggle("getElements",!0);const g=document.elementsFromPoint(l,c);if(p.toggle("getElements",!1),!this.div.contains(g[0]))return;let y;const b=new RegExp(`^${Q2}[0-9]+$`);for(const v of g)if(b.test(v.id)){y=v.id;break}if(!y)return;const w=u(this,ni).get(y);(w==null?void 0:w.annotationElementId)===null&&(a.stopPropagation(),a.preventDefault(),w.dblclick())},{signal:s,capture:!0})}const e=new Map,t=new Map;for(const s of u(this,ni).values())if(s.disableEditing(),!!s.annotationElementId){if(s.serialize()!==null){e.set(s.annotationElementId,s);continue}else t.set(s.annotationElementId,s);(n=this.getEditableAnnotation(s.annotationElementId))==null||n.show(),s.remove()}if(u(this,bs)){const s=u(this,bs).getEditableAnnotations();for(const a of s){const{id:o}=a.data;if(u(this,Ze).isDeletedAnnotationElement(o))continue;let l=t.get(o);if(l){l.resetAnnotationElement(a),l.show(!1),a.show();continue}l=e.get(o),l&&(u(this,Ze).addChangedExistingAnnotation(l),l.renderAnnotationElement(a)&&l.show(!1)),a.show()}}L(this,ur,$p).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const s of u(Ii,no).values())r.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),T(this,_c,!1)}getEditableAnnotation(e){var t;return((t=u(this,bs))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){u(this,Ze).getActive()!==e&&u(this,Ze).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=u(this,Gr))!=null&&e.div&&!u(this,oa)){T(this,oa,new AbortController);const t=u(this,Ze).combinedSignal(u(this,oa));u(this,Gr).div.addEventListener("pointerdown",L(this,ur,ox).bind(this),{signal:t}),u(this,Gr).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=u(this,Gr))!=null&&e.div&&u(this,oa)&&(u(this,oa).abort(),T(this,oa,null),u(this,Gr).div.classList.remove("highlighting"))}enableClick(){if(u(this,eo))return;T(this,eo,new AbortController);const e=u(this,Ze).combinedSignal(u(this,eo));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){var e;(e=u(this,eo))==null||e.abort(),T(this,eo,null)}attach(e){u(this,ni).set(e.id,e);const{annotationElementId:t}=e;t&&u(this,Ze).isDeletedAnnotationElement(t)&&u(this,Ze).removeDeletedAnnotationElement(e)}detach(e){var t;u(this,ni).delete(e.id),(t=u(this,Ll))==null||t.removePointerInTextLayer(e.contentDiv),!u(this,_c)&&e.annotationElementId&&u(this,Ze).addDeletedAnnotationElement(e)}remove(e){this.detach(e),u(this,Ze).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(u(this,Ze).addDeletedAnnotationElement(e.annotationElementId),tr.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(t=e.parent)==null||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),u(this,Ze).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!u(this,Ol)),u(this,Ze).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!u(this,sa)&&(e._focusEventsAllowed=!1,T(this,sa,setTimeout(()=>{T(this,sa,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:u(this,Ze)._signal}),t.focus())},0))),e._structTreeParentId=(r=u(this,Ll))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const t=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:t,undo:r,mustExec:!1})}getNextId(){return u(this,Ze).getId()}combinedSignal(e){return u(this,Ze).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=u(this,ur,Ji))==null?void 0:e.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await u(this,Ze).updateMode(e.mode);const{offsetX:r,offsetY:n}=L(this,ur,fb).call(this),s=this.getNextId(),a=L(this,ur,db).call(this,{parent:this,id:s,x:r,y:n,uiManager:u(this,Ze),isCentered:!0,...t});a&&this.add(a)}async deserialize(e){var t;return await((t=u(Ii,no).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,u(this,Ze)))||null}createAndAddNewEditor(e,t,r={}){const n=this.getNextId(),s=L(this,ur,db).call(this,{parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:u(this,Ze),isCentered:t,...r});return s&&this.add(s),s}addNewEditor(e={}){this.createAndAddNewEditor(L(this,ur,fb).call(this),!0,e)}setSelected(e){u(this,Ze).setSelected(e)}toggleSelected(e){u(this,Ze).toggleSelected(e)}unselect(e){u(this,Ze).unselect(e)}pointerup(e){var n;const{isMac:t}=qr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!u(this,to)||(T(this,to,!1),(n=u(this,ur,Ji))!=null&&n.isDrawer&&u(this,ur,Ji).supportMultipleDrawings))return;if(!u(this,Ec)){T(this,Ec,!0);return}const r=u(this,Ze).getMode();if(r===ot.STAMP||r===ot.SIGNATURE){u(this,Ze).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){var n;if(u(this,Ze).getMode()===ot.HIGHLIGHT&&this.enableTextSelection(),u(this,to)){T(this,to,!1);return}const{isMac:t}=qr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(T(this,to,!0),(n=u(this,ur,Ji))!=null&&n.isDrawer){this.startDrawingSession(e);return}const r=u(this,Ze).getActive();T(this,Ec,!r||r.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),u(this,$i)){u(this,ur,Ji).startDrawing(this,u(this,Ze),!1,e);return}u(this,Ze).setCurrentDrawingSession(this),T(this,$i,new AbortController);const t=u(this,Ze).combinedSignal(u(this,$i));this.div.addEventListener("blur",({relatedTarget:r})=>{r&&!this.div.contains(r)&&(T(this,aa,null),this.commitOrRemove())},{signal:t}),u(this,ur,Ji).startDrawing(this,u(this,Ze),!1,e)}pause(e){if(e){const{activeElement:t}=document;this.div.contains(t)&&T(this,aa,t);return}u(this,aa)&&setTimeout(()=>{var t;(t=u(this,aa))==null||t.focus(),T(this,aa,null)},0)}endDrawingSession(e=!1){return u(this,$i)?(u(this,Ze).setCurrentDrawingSession(null),u(this,$i).abort(),T(this,$i,null),T(this,aa,null),u(this,ur,Ji).endDrawing(e)):null}findNewParent(e,t,r){const n=u(this,Ze).findParent(t,r);return n===null||n===this?!1:(n.changeParent(e),!0)}commitOrRemove(){return u(this,$i)?(this.endDrawingSession(),!0):!1}onScaleChanging(){u(this,$i)&&u(this,ur,Ji).onScaleChangingWhenDrawing(this)}destroy(){var e,t;this.commitOrRemove(),((e=u(this,Ze).getActive())==null?void 0:e.parent)===this&&(u(this,Ze).commitOrRemove(),u(this,Ze).setActiveEditor(null)),u(this,sa)&&(clearTimeout(u(this,sa)),T(this,sa,null));for(const r of u(this,ni).values())(t=u(this,Ll))==null||t.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,u(this,ni).clear(),u(this,Ze).removeLayer(this)}render({viewport:e}){this.viewport=e,so(this.div,e);for(const t of u(this,Ze).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){u(this,Ze).commitOrRemove(),L(this,ur,$p).call(this);const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,so(this.div,{rotation:r}),t!==r)for(const n of u(this,ni).values())n.rotate(r)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return u(this,Ze).viewParameters.realScale}};Ll=new WeakMap,Ec=new WeakMap,bs=new WeakMap,eo=new WeakMap,sa=new WeakMap,ni=new WeakMap,to=new WeakMap,_c=new WeakMap,Ol=new WeakMap,$i=new WeakMap,aa=new WeakMap,Gr=new WeakMap,oa=new WeakMap,ro=new WeakMap,Cc=new WeakMap,Ze=new WeakMap,no=new WeakMap,ur=new WeakSet,ox=function(e){u(this,Ze).unselectAll();const{target:t}=e;if(t===u(this,Gr).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&u(this,Gr).div.contains(t)){const{isMac:r}=qr.platform;if(e.button!==0||e.ctrlKey&&r)return;u(this,Ze).showAllEditors("highlight",!0,!0),u(this,Gr).div.classList.add("free"),this.toggleDrawing(),Kp.startHighlighting(this,u(this,Ze).direction==="ltr",{target:u(this,Gr).div,x:e.x,y:e.y}),u(this,Gr).div.addEventListener("pointerup",()=>{u(this,Gr).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:u(this,Ze)._signal}),e.preventDefault()}},Ji=function(){return u(Ii,no).get(u(this,Ze).getMode())},db=function(e){const t=u(this,ur,Ji);return t?new t.prototype.constructor(e):null},fb=function(){const{x:e,y:t,width:r,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+r),l=Math.min(window.innerHeight,t+n),c=(s+o)/2-e,h=(a+l)/2-t,[d,p]=this.viewport.rotation%180===0?[c,h]:[h,c];return{offsetX:d,offsetY:p}},$p=function(){for(const e of u(this,ni).values())e.isEmpty()&&e.remove()},Ie(Ii,"_initialized",!1),N(Ii,no,new Map([V0,nb,cb,Kp,ub].map(e=>[e._editorType,e])));let Jp=Ii;var Vi,En,Fl,_f,Eg,lx,As,pb,ux,gb;const Rr=class Rr{constructor({pageIndex:e}){N(this,As);N(this,Vi,null);N(this,En,new Map);N(this,Fl,new Map);this.pageIndex=e}setParent(e){if(!u(this,Vi)){T(this,Vi,e);return}if(u(this,Vi)!==e){if(u(this,En).size>0)for(const t of u(this,En).values())t.remove(),e.append(t);T(this,Vi,e)}}static get _svgFactory(){return Ct(this,"_svgFactory",new Lh)}draw(e,t=!1,r=!1){const n=bn(Rr,_f)._++,s=L(this,As,pb).call(this),a=Rr._svgFactory.createElement("defs");s.append(a);const o=Rr._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${n}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),t&&u(this,Fl).set(n,o);const c=r?L(this,As,ux).call(this,a,l):null,h=Rr._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${l}`),this.updateProperties(s,e),u(this,En).set(n,s),{id:n,clipPathId:`url(#${c})`}}drawOutline(e,t){const r=bn(Rr,_f)._++,n=L(this,As,pb).call(this),s=Rr._svgFactory.createElement("defs");n.append(s);const a=Rr._svgFactory.createElement("path");s.append(a);const o=`path_p${this.pageIndex}_${r}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(t){const d=Rr._svgFactory.createElement("mask");s.append(d),l=`mask_p${this.pageIndex}_${r}`,d.setAttribute("id",l),d.setAttribute("maskUnits","objectBoundingBox");const p=Rr._svgFactory.createElement("rect");d.append(p),p.setAttribute("width","1"),p.setAttribute("height","1"),p.setAttribute("fill","white");const g=Rr._svgFactory.createElement("use");d.append(g),g.setAttribute("href",`#${o}`),g.setAttribute("stroke","none"),g.setAttribute("fill","black"),g.setAttribute("fill-rule","nonzero"),g.classList.add("mask")}const c=Rr._svgFactory.createElement("use");n.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const h=c.cloneNode();return n.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(n,e),u(this,En).set(r,n),r}finalizeDraw(e,t){u(this,Fl).delete(e),this.updateProperties(e,t)}updateProperties(e,t){var l;if(!t)return;const{root:r,bbox:n,rootClass:s,path:a}=t,o=typeof e=="number"?u(this,En).get(e):e;if(o){if(r&&L(this,As,gb).call(this,o,r),n&&L(l=Rr,Eg,lx).call(l,o,n),s){const{classList:c}=o;for(const[h,d]of Object.entries(s))c.toggle(h,d)}if(a){const h=o.firstChild.firstChild;L(this,As,gb).call(this,h,a)}}}updateParent(e,t){if(t===this)return;const r=u(this,En).get(e);r&&(u(t,Vi).append(r),u(this,En).delete(e),u(t,En).set(e,r))}remove(e){u(this,Fl).delete(e),u(this,Vi)!==null&&(u(this,En).get(e).remove(),u(this,En).delete(e))}destroy(){T(this,Vi,null);for(const e of u(this,En).values())e.remove();u(this,En).clear(),u(this,Fl).clear()}};Vi=new WeakMap,En=new WeakMap,Fl=new WeakMap,_f=new WeakMap,Eg=new WeakSet,lx=function(e,[t,r,n,s]){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*t}%`,a.width=`${100*n}%`,a.height=`${100*s}%`},As=new WeakSet,pb=function(){const e=Rr._svgFactory.create(1,1,!0);return u(this,Vi).append(e),e.setAttribute("aria-hidden",!0),e},ux=function(e,t){const r=Rr._svgFactory.createElement("clipPath");e.append(r);const n=`clip_${t}`;r.setAttribute("id",n),r.setAttribute("clipPathUnits","objectBoundingBox");const s=Rr._svgFactory.createElement("use");return r.append(s),s.setAttribute("href",`#${t}`),s.classList.add("clip"),n},gb=function(e,t){for(const[r,n]of Object.entries(t))n===null?e.removeAttribute(r):e.setAttribute(r,n)},N(Rr,Eg),N(Rr,_f,0);let eg=Rr;globalThis._pdfjsTestingUtils={HighlightOutliner:q0};globalThis.pdfjsLib={AbortException:ha,AnnotationEditorLayer:Jp,AnnotationEditorParamsType:kt,AnnotationEditorType:ot,AnnotationEditorUIManager:ao,AnnotationLayer:$b,AnnotationMode:vs,AnnotationType:wr,build:uw,ColorPicker:Oh,createValidAbsoluteUrl:Pb,DOMSVGFactory:Lh,DrawLayer:eg,FeatureTest:qr,fetchData:Nc,getDocument:Bb,getFilenameFromUrl:i1,getPdfFilenameFromUrl:s1,getUuid:Ib,getXfaPageViewport:a1,GlobalWorkerOptions:yi,ImageKind:Th,InvalidPDFException:Wp,isDataScheme:kf,isPdfFile:kg,isValidExplicitDest:j1,MathClamp:dn,noContextMenu:Ei,normalizeUnicode:r1,OPS:Ph,OutputScale:Wi,PasswordResponses:e1,PDFDataRangeTransport:zb,PDFDateString:Dg,PDFWorker:Sc,PermissionFlag:J2,PixelsPerInch:da,RenderingCancelledException:Tg,ResponseException:Rh,setLayerDimensions:so,shadow:Ct,SignatureExtractor:ys,stopEvent:_r,SupportedImageMimeTypes:Xp,TextLayer:Nh,TouchManager:Ih,updateUrlHash:Rb,Util:Qe,VerbosityLevel:Cf,version:jb,XfaLayer:Ub};const nS=Object.freeze(Object.defineProperty({__proto__:null,AbortException:ha,AnnotationEditorLayer:Jp,AnnotationEditorParamsType:kt,AnnotationEditorType:ot,AnnotationEditorUIManager:ao,AnnotationLayer:$b,AnnotationMode:vs,AnnotationType:wr,ColorPicker:Oh,DOMSVGFactory:Lh,DrawLayer:eg,FeatureTest:qr,GlobalWorkerOptions:yi,ImageKind:Th,InvalidPDFException:Wp,MathClamp:dn,OPS:Ph,OutputScale:Wi,PDFDataRangeTransport:zb,PDFDateString:Dg,PDFWorker:Sc,PasswordResponses:e1,PermissionFlag:J2,PixelsPerInch:da,RenderingCancelledException:Tg,ResponseException:Rh,SignatureExtractor:ys,SupportedImageMimeTypes:Xp,TextLayer:Nh,TouchManager:Ih,Util:Qe,VerbosityLevel:Cf,XfaLayer:Ub,build:uw,createValidAbsoluteUrl:Pb,fetchData:Nc,getDocument:Bb,getFilenameFromUrl:i1,getPdfFilenameFromUrl:s1,getUuid:Ib,getXfaPageViewport:a1,isDataScheme:kf,isPdfFile:kg,isValidExplicitDest:j1,noContextMenu:Ei,normalizeUnicode:r1,setLayerDimensions:so,shadow:Ct,stopEvent:_r,updateUrlHash:Rb,version:jb},Symbol.toStringTag,{value:"Module"}));function cx(i){var e,t,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var n=i.length;for(e=0;e<n;e++)i[e]&&(t=cx(i[e]))&&(r&&(r+=" "),r+=t)}else for(t in i)i[t]&&(r&&(r+=" "),r+=t);return r}function Ig(){for(var i,e,t=0,r="",n=arguments.length;t<n;t++)(i=arguments[t])&&(e=cx(i))&&(r&&(r+=" "),r+=e);return r}var gy=Object.prototype.hasOwnProperty;function my(i,e,t){for(t of i.keys())if(bu(t,e))return t}function bu(i,e){var t,r,n;if(i===e)return!0;if(i&&e&&(t=i.constructor)===e.constructor){if(t===Date)return i.getTime()===e.getTime();if(t===RegExp)return i.toString()===e.toString();if(t===Array){if((r=i.length)===e.length)for(;r--&&bu(i[r],e[r]););return r===-1}if(t===Set){if(i.size!==e.size)return!1;for(r of i)if(n=r,n&&typeof n=="object"&&(n=my(e,n),!n)||!e.has(n))return!1;return!0}if(t===Map){if(i.size!==e.size)return!1;for(r of i)if(n=r[0],n&&typeof n=="object"&&(n=my(e,n),!n)||!bu(r[1],e.get(n)))return!1;return!0}if(t===ArrayBuffer)i=new Uint8Array(i),e=new Uint8Array(e);else if(t===DataView){if((r=i.byteLength)===e.byteLength)for(;r--&&i.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(i)){if((r=i.byteLength)===e.byteLength)for(;r--&&i[r]===e[r];);return r===-1}if(!t||typeof i=="object"){r=0;for(t in i)if(gy.call(i,t)&&++r&&!gy.call(e,t)||!(t in e)||!bu(i[t],e[t]))return!1;return Object.keys(e).length===r}}return i!==i&&e!==e}function If(i){let e=!1;return{promise:new Promise((r,n)=>{i.then(s=>!e&&r(s)).catch(s=>!e&&n(s))}),cancel(){e=!0}}}const iS=["onCopy","onCut","onPaste"],sS=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],aS=["onFocus","onBlur"],oS=["onInput","onInvalid","onReset","onSubmit"],lS=["onLoad","onError"],uS=["onKeyDown","onKeyPress","onKeyUp"],cS=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],hS=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dS=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],fS=["onSelect"],pS=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],gS=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],mS=["onScroll"],bS=["onWheel"],vS=["onAnimationStart","onAnimationEnd","onAnimationIteration"],yS=["onTransitionEnd"],wS=["onToggle"],xS=["onChange"],AS=[...iS,...sS,...aS,...oS,...lS,...uS,...cS,...hS,...dS,...fS,...pS,...gS,...mS,...bS,...vS,...yS,...xS,...wS];function hx(i,e){const t={};for(const r of AS){const n=i[r];n&&(e?t[r]=s=>n(s,e(r)):t[r]=n)}return t}var ES=process.env.NODE_ENV==="production",ym="Invariant failed";function Qt(i,e){if(!i){if(ES)throw new Error(ym);var t=typeof e=="function"?e():e,r=t?"".concat(ym,": ").concat(t):ym;throw new Error(r)}}var _S=process.env.NODE_ENV!=="production",dx=function(){};if(_S){var CS=function(e,t){var r=arguments.length;t=new Array(r>1?r-1:0);for(var n=1;n<r;n++)t[n-1]=arguments[n];var s=0,a="Warning: "+e.replace(/%s/g,function(){return t[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}};dx=function(i,e,t){var r=arguments.length;t=new Array(r>2?r-2:0);for(var n=2;n<r;n++)t[n-2]=arguments[n];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");i||CS.apply(null,[e].concat(t))}}var SS=dx;const fn=_g(SS),fx=Pe.createContext(null),TS="noopener noreferrer nofollow";class kS{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Qt(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(e){Qt(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(t=>{Qt(this.pdfDocument,"PDF document not loaded."),Qt(e,"Destination is not specified."),typeof e=="string"?this.pdfDocument.getDestination(e).then(t):Array.isArray(e)?t(e):e.then(t)}).then(t=>{Qt(Array.isArray(t),`"${t}" is not a valid destination array.`);const r=t[0];new Promise(n=>{Qt(this.pdfDocument,"PDF document not loaded."),r instanceof Object?this.pdfDocument.getPageIndex(r).then(s=>{n(s)}).catch(()=>{Qt(!1,`"${r}" is not a valid page reference.`)}):typeof r=="number"?n(r):Qt(!1,`"${r}" is not a valid destination reference.`)}).then(n=>{const s=n+1;Qt(this.pdfViewer,"PDF viewer is not initialized."),Qt(s>=1&&s<=this.pagesCount,`"${s}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:n,pageNumber:s})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const t=e-1;Qt(this.pdfViewer,"PDF viewer is not initialized."),Qt(e>=1&&e<=this.pagesCount,`"${e}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:t,pageNumber:e})}addLinkAttributes(e,t,r){e.href=t,e.rel=this.externalLinkRel||TS,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}function vu({children:i,type:e}){return ye.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:i})}const by={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};function DS(i,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return i}}function Tc(){return Pe.useReducer(DS,{value:void 0,error:void 0})}const Ng=typeof window<"u",px=Ng&&window.location.protocol==="file:";function PS(i){return typeof i<"u"}function xo(i){return PS(i)&&i!==null}function RS(i){return typeof i=="string"}function IS(i){return i instanceof ArrayBuffer}function NS(i){return Qt(Ng,"isBlob can only be used in a browser environment"),i instanceof Blob}function mb(i){return RS(i)&&/^data:/.test(i)}function vy(i){Qt(mb(i),"Invalid data URI.");const[e="",t=""]=i.split(",");return e.split(";").indexOf("base64")!==-1?atob(t):unescape(t)}function MS(){return Ng&&window.devicePixelRatio||1}const gx="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function yy(){fn(!px,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${gx}`)}function LS(){fn(!px,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${gx}`)}function Ul(i){i!=null&&i.cancel&&i.cancel()}function bb(i,e){return Object.defineProperty(i,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(i,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(i,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(i,"originalHeight",{get(){return this.view[3]},configurable:!0}),i}function OS(i){return i.name==="RenderingCancelledException"}function FS(i){return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return t(new Error("Error while reading a file."));e(r.result)},r.onerror=n=>{if(!n.target)return t(new Error("Error while reading a file."));const{error:s}=n.target;if(!s)return t(new Error("Error while reading a file."));switch(s.code){case s.NOT_FOUND_ERR:return t(new Error("Error while reading a file: File not found."));case s.SECURITY_ERR:return t(new Error("Error while reading a file: Security error."));case s.ABORT_ERR:return t(new Error("Error while reading a file: Aborted."));default:return t(new Error("Error while reading a file."))}},r.readAsArrayBuffer(i)})}const{PDFDataRangeTransport:BS}=nS,zS=(i,e)=>{switch(e){case by.NEED_PASSWORD:{const t=prompt("Enter the password to open this PDF file.");i(t);break}case by.INCORRECT_PASSWORD:{const t=prompt("Invalid password. Please try again.");i(t);break}}};function wy(i){return typeof i=="object"&&i!==null&&("data"in i||"range"in i||"url"in i)}const jS=Pe.forwardRef(function({children:e,className:t,error:r="Failed to load PDF file.",externalLinkRel:n,externalLinkTarget:s,file:a,inputRef:o,imageResourcesPath:l,loading:c="Loading PDF…",noData:h="No PDF file specified.",onItemClick:d,onLoadError:p,onLoadProgress:g,onLoadSuccess:y,onPassword:b=zS,onSourceError:w,onSourceSuccess:v,options:A,renderMode:E,rotate:_,scale:C,...I},k){const[D,R]=Tc(),{value:z,error:G}=D,[O,X]=Tc(),{value:S,error:J}=O,Y=Pe.useRef(new kS),W=Pe.useRef([]),fe=Pe.useRef(void 0),K=Pe.useRef(void 0);a&&a!==fe.current&&wy(a)&&(fn(!bu(a,fe.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),fe.current=a),A&&A!==K.current&&(fn(!bu(A,K.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),K.current=A);const be=Pe.useRef({scrollPageIntoView:Te=>{const{dest:x,pageNumber:U,pageIndex:B=U-1}=Te;if(d){d({dest:x,pageIndex:B,pageNumber:U});return}const F=W.current[B];if(F){F.scrollIntoView();return}fn(!1,`An internal link leading to page ${U} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});Pe.useImperativeHandle(k,()=>({linkService:Y,pages:W,viewer:be}),[]);function te(){v&&v()}function j(){G&&(fn(!1,G.toString()),w&&w(G))}function ie(){R({type:"RESET"})}Pe.useEffect(ie,[a,R]);const ae=Pe.useCallback(async()=>{if(!a)return null;if(typeof a=="string")return mb(a)?{data:vy(a)}:(yy(),{url:a});if(a instanceof BS)return{range:a};if(IS(a))return{data:a};if(Ng&&NS(a))return{data:await FS(a)};if(Qt(typeof a=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),Qt(wy(a),"Invalid parameter object: need either .data, .range or .url"),"url"in a&&typeof a.url=="string"){if(mb(a.url)){const{url:Te,...x}=a;return{data:vy(Te),...x}}yy()}return a},[a]);Pe.useEffect(()=>{const Te=If(ae());return Te.promise.then(x=>{R({type:"RESOLVE",value:x})}).catch(x=>{R({type:"REJECT",error:x})}),()=>{Ul(Te)}},[ae,R]),Pe.useEffect(()=>{if(!(typeof z>"u")){if(z===!1){j();return}te()}},[z]);function H(){S&&(y&&y(S),W.current=new Array(S.numPages),Y.current.setDocument(S))}function se(){J&&(fn(!1,J.toString()),p&&p(J))}Pe.useEffect(function(){X({type:"RESET"})},[X,z]),Pe.useEffect(function(){if(!z)return;const x=A?{...z,...A}:z,U=Bb(x);g&&(U.onProgress=g),b&&(U.onPassword=b);const B=U,F=B.promise.then(M=>{X({type:"RESOLVE",value:M})}).catch(M=>{B.destroyed||X({type:"REJECT",error:M})});return()=>{F.finally(()=>B.destroy())}},[A,X,z]),Pe.useEffect(()=>{if(!(typeof S>"u")){if(S===!1){se();return}H()}},[S]),Pe.useEffect(function(){Y.current.setViewer(be.current),Y.current.setExternalLinkRel(n),Y.current.setExternalLinkTarget(s)},[n,s]);const le=Pe.useCallback((Te,x)=>{W.current[Te]=x},[]),oe=Pe.useCallback(Te=>{delete W.current[Te]},[]),ce=Pe.useMemo(()=>({imageResourcesPath:l,linkService:Y.current,onItemClick:d,pdf:S,registerPage:le,renderMode:E,rotate:_,scale:C,unregisterPage:oe}),[l,d,S,le,E,_,C,oe]),Ae=Pe.useMemo(()=>hx(I,()=>S),[I,S]);function Se(){function Te(U){return!!(U!=null&&U.pdf)}if(!Te(ce))throw new Error("pdf is undefined");const x=typeof e=="function"?e(ce):e;return ye.jsx(fx.Provider,{value:ce,children:x})}function Ne(){return a?S==null?ye.jsx(vu,{type:"loading",children:typeof c=="function"?c():c}):S===!1?ye.jsx(vu,{type:"error",children:typeof r=="function"?r():r}):Se():ye.jsx(vu,{type:"no-data",children:typeof h=="function"?h():h})}return ye.jsx("div",{className:Ig("react-pdf__Document",t),ref:o,...Ae,children:Ne()})});function mx(){return Pe.useContext(fx)}function bx(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=i.filter(Boolean);if(t.length<=1){var r=t[0];return r||null}return function(s){for(var a=0,o=t;a<o.length;a++){var l=o[a];typeof l=="function"?l(s):l&&(l.current=s)}}}const vx=Pe.createContext(null);function Mg(){return Pe.useContext(vx)}function US(){const i=mx(),e=Mg();Qt(e,"Unable to find Page context.");const t={...i,...e},{imageResourcesPath:r,linkService:n,onGetAnnotationsError:s,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:l,page:c,pdf:h,renderForms:d,rotate:p,scale:g=1}=t;Qt(h,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),Qt(c,"Attempted to load page annotations, but no page was specified."),Qt(n,"Attempted to load page annotations, but no linkService was specified.");const[y,b]=Tc(),{value:w,error:v}=y,A=Pe.useRef(null);fn(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function E(){w&&a&&a(w)}function _(){v&&(fn(!1,v.toString()),s&&s(v))}Pe.useEffect(function(){b({type:"RESET"})},[b,c]),Pe.useEffect(function(){if(!c)return;const R=If(c.getAnnotations()),z=R;return R.promise.then(G=>{b({type:"RESOLVE",value:G})}).catch(G=>{b({type:"REJECT",error:G})}),()=>{Ul(z)}},[b,c]),Pe.useEffect(()=>{if(w!==void 0){if(w===!1){_();return}E()}},[w]);function C(){l&&l()}function I(D){fn(!1,`${D}`),o&&o(D)}const k=Pe.useMemo(()=>c.getViewport({scale:g,rotation:p}),[c,p,g]);return Pe.useEffect(function(){if(!h||!c||!n||!w)return;const{current:R}=A;if(!R)return;const z=k.clone({dontFlip:!0}),G={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:R,l10n:null,page:c,structTreeLayer:null,viewport:z},O={annotations:w,annotationStorage:h.annotationStorage,div:R,imageResourcesPath:r,linkService:n,page:c,renderForms:d,viewport:z};R.innerHTML="";try{new $b(G).render(O),C()}catch(X){I(X)}return()=>{}},[w,r,n,c,h,d,k]),ye.jsx("div",{className:Ig("react-pdf__Page__annotations","annotationLayer"),ref:A})}const yx={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HS=/^H(\d+)$/;function $S(i){return i in yx}function Lg(i){return"children"in i}function wx(i){return Lg(i)?i.children.length===1&&0 in i.children&&"id"in i.children[0]:!1}function VS(i){const e={};if(Lg(i)){const{role:t}=i,r=t.match(HS);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if($S(t)){const n=yx[t];n&&(e.role=n)}}return e}function xx(i){const e={};if(Lg(i)){if(i.alt!==void 0&&(e["aria-label"]=i.alt),i.lang!==void 0&&(e.lang=i.lang),wx(i)){const[t]=i.children;if(t){const r=xx(t);return{...e,...r}}}}else"id"in i&&(e["aria-owns"]=i.id);return e}function GS(i){return i?{...VS(i),...xx(i)}:null}function Ax({className:i,node:e}){const t=Pe.useMemo(()=>GS(e),[e]),r=Pe.useMemo(()=>!Lg(e)||wx(e)?null:e.children.map((n,s)=>ye.jsx(Ax,{node:n},s)),[e]);return ye.jsx("span",{className:i,...t,children:r})}function qS(){const i=Mg();Qt(i,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:t}=i,[r,n]=Tc(),{value:s,error:a}=r,{customTextRenderer:o,page:l}=i;function c(){s&&t&&t(s)}function h(){a&&(fn(!1,a.toString()),e&&e(a))}return Pe.useEffect(function(){n({type:"RESET"})},[n,l]),Pe.useEffect(function(){if(o||!l)return;const p=If(l.getStructTree()),g=p;return p.promise.then(y=>{n({type:"RESOLVE",value:y})}).catch(y=>{n({type:"REJECT",error:y})}),()=>Ul(g)},[o,l,n]),Pe.useEffect(()=>{if(s!==void 0){if(s===!1){h();return}c()}},[s]),s?ye.jsx(Ax,{className:"react-pdf__Page__structTree structTree",node:s}):null}const xy=vs;function WS(i){const e=Mg();Qt(e,"Unable to find Page context.");const t={...e,...i},{_className:r,canvasBackground:n,devicePixelRatio:s=MS(),onRenderError:a,onRenderSuccess:o,page:l,renderForms:c,renderTextLayer:h,rotate:d,scale:p}=t,{canvasRef:g}=i;Qt(l,"Attempted to render page canvas, but no page was specified.");const y=Pe.useRef(null);function b(){l&&o&&o(bb(l,p))}function w(_){OS(_)||(fn(!1,_.toString()),a&&a(_))}const v=Pe.useMemo(()=>l.getViewport({scale:p*s,rotation:d}),[s,l,d,p]),A=Pe.useMemo(()=>l.getViewport({scale:p,rotation:d}),[l,d,p]);Pe.useEffect(function(){if(!l)return;l.cleanup();const{current:C}=y;if(!C)return;C.width=v.width,C.height=v.height,C.style.width=`${Math.floor(A.width)}px`,C.style.height=`${Math.floor(A.height)}px`,C.style.visibility="hidden";const I={annotationMode:c?xy.ENABLE_FORMS:xy.ENABLE,canvasContext:C.getContext("2d",{alpha:!1}),viewport:v};n&&(I.background=n);const k=l.render(I),D=k;return k.promise.then(()=>{C.style.visibility="",b()}).catch(w),()=>Ul(D)},[n,l,c,v,A]);const E=Pe.useCallback(()=>{const{current:_}=y;_&&(_.width=0,_.height=0)},[]);return Pe.useEffect(()=>E,[E]),ye.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:bx(g,y),style:{display:"block",userSelect:"none"},children:h?ye.jsx(qS,{}):null})}function XS(i){return"str"in i}function YS(){const i=Mg();Qt(i,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:t,onGetTextSuccess:r,onRenderTextLayerError:n,onRenderTextLayerSuccess:s,page:a,pageIndex:o,pageNumber:l,rotate:c,scale:h}=i;Qt(a,"Attempted to load page text content, but no page was specified.");const[d,p]=Tc(),{value:g,error:y}=d,b=Pe.useRef(null);fn(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function w(){g&&r&&r(g)}function v(){y&&(fn(!1,y.toString()),t&&t(y))}Pe.useEffect(function(){p({type:"RESET"})},[a,p]),Pe.useEffect(function(){if(!a)return;const D=If(a.getTextContent()),R=D;return D.promise.then(z=>{p({type:"RESOLVE",value:z})}).catch(z=>{p({type:"REJECT",error:z})}),()=>Ul(R)},[a,p]),Pe.useEffect(()=>{if(g!==void 0){if(g===!1){v();return}w()}},[g]);const A=Pe.useCallback(()=>{s&&s()},[s]),E=Pe.useCallback(k=>{fn(!1,k.toString()),n&&n(k)},[n]);function _(){const k=b.current;k&&k.classList.add("selecting")}function C(){const k=b.current;k&&k.classList.remove("selecting")}const I=Pe.useMemo(()=>a.getViewport({scale:h,rotation:c}),[a,c,h]);return Pe.useLayoutEffect(function(){if(!a||!g)return;const{current:D}=b;if(!D)return;D.innerHTML="";const R=a.streamTextContent({includeMarkedContent:!0}),z={container:D,textContentSource:R,viewport:I},G=new Nh(z),O=G;return G.render().then(()=>{const X=document.createElement("div");X.className="endOfContent",D.append(X);const S=D.querySelectorAll('[role="presentation"]');if(e){let J=0;g.items.forEach((Y,W)=>{if(!XS(Y))return;const fe=S[J];if(!fe)return;const K=e({pageIndex:o,pageNumber:l,itemIndex:W,...Y});fe.innerHTML=K,J+=Y.str&&Y.hasEOL?2:1})}A()}).catch(E),()=>Ul(O)},[e,E,A,a,o,l,g,I]),ye.jsx("div",{className:Ig("react-pdf__Page__textContent","textLayer"),onMouseUp:C,onMouseDown:_,ref:b})}const Ay=1;function ZS(i){const t={...mx(),...i},{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:n=!0,canvasBackground:s,canvasRef:a,children:o,className:l,customRenderer:c,customTextRenderer:h,devicePixelRatio:d,error:p="Failed to load the page.",height:g,inputRef:y,loading:b="Loading page…",noData:w="No page specified.",onGetAnnotationsError:v,onGetAnnotationsSuccess:A,onGetStructTreeError:E,onGetStructTreeSuccess:_,onGetTextError:C,onGetTextSuccess:I,onLoadError:k,onLoadSuccess:D,onRenderAnnotationLayerError:R,onRenderAnnotationLayerSuccess:z,onRenderError:G,onRenderSuccess:O,onRenderTextLayerError:X,onRenderTextLayerSuccess:S,pageIndex:J,pageNumber:Y,pdf:W,registerPage:fe,renderAnnotationLayer:K=!0,renderForms:be=!1,renderMode:te="canvas",renderTextLayer:j=!0,rotate:ie,scale:ae=Ay,unregisterPage:H,width:se,...le}=t,[oe,ce]=Tc(),{value:Ae,error:Se}=oe,Ne=Pe.useRef(null);Qt(W,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const Te=xo(Y)?Y-1:J??null,x=Y??(xo(J)?J+1:null),U=ie??(Ae?Ae.rotate:null),B=Pe.useMemo(()=>{if(!Ae)return null;let $e=1;const Xe=ae??Ay;if(se||g){const Tt=Ae.getViewport({scale:1,rotation:U});se?$e=se/Tt.width:g&&($e=g/Tt.height)}return Xe*$e},[g,Ae,U,ae,se]);Pe.useEffect(function(){return()=>{xo(Te)&&n&&H&&H(Te)}},[n,W,Te,H]);function F(){if(D){if(!Ae||!B)return;D(bb(Ae,B))}if(n&&fe){if(!xo(Te)||!Ne.current)return;fe(Te,Ne.current)}}function M(){Se&&(fn(!1,Se.toString()),k&&k(Se))}Pe.useEffect(function(){ce({type:"RESET"})},[ce,W,Te]),Pe.useEffect(function(){if(!W||!x)return;const Xe=If(W.getPage(x)),Tt=Xe;return Xe.promise.then(nr=>{ce({type:"RESOLVE",value:nr})}).catch(nr=>{ce({type:"REJECT",error:nr})}),()=>Ul(Tt)},[ce,W,x]),Pe.useEffect(()=>{if(Ae!==void 0){if(Ae===!1){M();return}F()}},[Ae,B]);const q=Pe.useMemo(()=>xo(Te)&&x&&xo(U)&&xo(B)?{_className:r,canvasBackground:s,customTextRenderer:h,devicePixelRatio:d,onGetAnnotationsError:v,onGetAnnotationsSuccess:A,onGetStructTreeError:E,onGetStructTreeSuccess:_,onGetTextError:C,onGetTextSuccess:I,onRenderAnnotationLayerError:R,onRenderAnnotationLayerSuccess:z,onRenderError:G,onRenderSuccess:O,onRenderTextLayerError:X,onRenderTextLayerSuccess:S,page:Ae,pageIndex:Te,pageNumber:x,renderForms:be,renderTextLayer:j,rotate:U,scale:B}:null,[r,s,h,d,v,A,E,_,C,I,R,z,G,O,X,S,Ae,Te,x,be,j,U,B]),de=Pe.useMemo(()=>hx(le,()=>Ae&&(B?bb(Ae,B):void 0)),[le,Ae,B]),we=`${Te}@${B}/${U}`;function ee(){switch(te){case"custom":return Qt(c,'renderMode was set to "custom", but no customRenderer was passed.'),ye.jsx(c,{},`${we}_custom`);case"none":return null;case"canvas":default:return ye.jsx(WS,{canvasRef:a},`${we}_canvas`)}}function Ee(){return j?ye.jsx(YS,{},`${we}_text`):null}function De(){return K?ye.jsx(US,{},`${we}_annotations`):null}function Ce(){function $e(Tt){return!!(Tt!=null&&Tt.page)}if(!$e(q))throw new Error("page is undefined");const Xe=typeof o=="function"?o(q):o;return ye.jsxs(vx.Provider,{value:q,children:[ee(),Ee(),De(),Xe]})}function Me(){return x?W===null||Ae===void 0||Ae===null?ye.jsx(vu,{type:"loading",children:typeof b=="function"?b():b}):W===!1||Ae===!1?ye.jsx(vu,{type:"error",children:typeof p=="function"?p():p}):Ce():ye.jsx(vu,{type:"no-data",children:typeof w=="function"?w():w})}return ye.jsx("div",{className:Ig(r,l),"data-page-number":x,ref:bx(y,Ne),style:{"--scale-round-x":"1px","--scale-round-y":"1px","--scale-factor":"1","--user-unit":`${B}`,"--total-scale-factor":"calc(var(--scale-factor) * var(--user-unit))",backgroundColor:s||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"},...de,children:Me()})}LS();yi.workerSrc="pdf.worker.mjs";yi.workerSrc=`//unpkg.com/pdfjs-dist@${jb}/build/pdf.worker.min.mjs`;const KS=({onClose:i,src:e,title:t="PDF Viewer",className:r,onOpen:n})=>{const[s,a]=X2(),[o,l]=Y2(),[{currentPage:c,totalPages:h},d]=K2(),[{pan:p,isDragging:g},y]=Z2(),b=v=>{n==null||n(v),!v.defaultPrevented&&(e||v.preventDefault())},w=ye.jsx(Mt.IconButton,{variant:"text",color:"gray",children:ye.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:b,children:ye.jsx(W2,{className:"size-4"})})});return ye.jsxs("div",{className:zl("shadow rounded-t-lg flex flex-col h-full",r),children:[ye.jsx(q2.Header,{onClose:i,right:w,children:t}),ye.jsxs("div",{className:"grid grow h-full overflow-hidden",children:[ye.jsx("div",{className:zl("col-start-1 row-start-1 bg-gray-200 h-full overflow-hidden select-none p-8",g?"cursor-grabbing":"cursor-grab"),onMouseDown:y.handleMouseDown,onMouseMove:y.handleMouseMove,onMouseUp:y.handleMouseUp,onMouseLeave:y.handleMouseUp,style:{userSelect:"none"},children:ye.jsx("div",{style:{transform:`translate(${p.x}px, ${p.y}px)`,transition:g?"none":"transform 0.1s",pointerEvents:"none"},children:ye.jsx(jS,{file:e,onLoadSuccess:({numPages:v})=>{d.setTotalPages(v)},scale:s/100,rotate:o,children:ye.jsx(ZS,{pageNumber:c,renderTextLayer:!0,renderAnnotationLayer:!0})})})}),ye.jsxs("div",{className:"col-start-1 row-start-1 self-end p-4 flex gap-2 justify-between w-full z-10",children:[ye.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:a.zoomOut,children:ye.jsx(vi.Icon,{icon:"lucide:minus"})}),ye.jsx(Mt.Tooltip,{content:"Click to reset zoom and pan",children:ye.jsxs("button",{className:"!bg-white text-center cursor-pointer w-[60px]",onClick:()=>{a.reset(),y.reset()},children:[s,"%"]})}),ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:a.zoomIn,children:ye.jsx(vi.Icon,{icon:"lucide:plus"})})]}),ye.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:l.rotateClockwise,children:ye.jsx(vi.Icon,{icon:"lucide:iteration-cw"})}),ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:l.rotateCounterClockwise,children:ye.jsx(vi.Icon,{icon:"lucide:iteration-ccw"})})]}),ye.jsxs(Mt.ButtonGroup,{className:"divide-x-0 ",children:[ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:d.prevPage,disabled:c===1,children:ye.jsx(vi.Icon,{icon:"lucide:chevron-left"})}),ye.jsx("input",{className:"bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]",value:c,onChange:v=>{const A=parseInt(v.target.value);isNaN(A)||d.goToPage(A)},type:"number",min:"1",max:h}),ye.jsxs("div",{className:"flex items-center bg-white px-2",children:["of ",h]}),ye.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:d.nextPage,disabled:c===h,children:ye.jsx(vi.Icon,{icon:"lucide:chevron-right"})})]})]})]})]})},QS=({...i})=>ye.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...i,children:[ye.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.16699 7.7334C4.91574 7.73357 6.33301 9.1516 6.33301 10.9004C6.33283 12.3905 5.30337 13.6386 3.91699 13.9756V15.25C3.91685 15.664 3.58098 15.9998 3.16699 16C2.75287 16 2.41713 15.6641 2.41699 15.25V13.9756C1.0303 13.6387 0.000177983 12.3906 0 10.9004C0 9.15149 1.41809 7.7334 3.16699 7.7334ZM3.16699 9.2334C2.24652 9.2334 1.5 9.97992 1.5 10.9004C1.50021 11.8207 2.24665 12.5664 3.16699 12.5664C4.08719 12.5662 4.8328 11.8206 4.83301 10.9004C4.83301 9.98002 4.08732 9.23357 3.16699 9.2334Z",fill:"currentColor"}),ye.jsx("path",{d:"M11.8662 9.66699C12.2804 9.66699 12.6162 10.0028 12.6162 10.417V15.25C12.616 15.6641 12.2803 16 11.8662 16C11.4523 15.9998 11.1164 15.6639 11.1162 15.25V10.417C11.1162 10.0029 11.4522 9.66722 11.8662 9.66699Z",fill:"currentColor"}),ye.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.8662 0C12.2804 0 12.6162 0.335786 12.6162 0.75V2.02344C14.0032 2.36025 15.0332 3.60999 15.0332 5.10059C15.0329 6.84904 13.6157 8.26633 11.8672 8.2666C10.1185 8.2666 8.70052 6.84921 8.7002 5.10059C8.7002 3.6104 9.7297 2.36066 11.1162 2.02344V0.75C11.1162 0.335929 11.4522 0.000230806 11.8662 0ZM11.8672 3.43359C10.9467 3.43359 10.2002 4.18011 10.2002 5.10059C10.2005 6.02078 10.9469 6.7666 11.8672 6.7666C12.7872 6.76633 13.5329 6.02062 13.5332 5.10059C13.5332 4.18028 12.7874 3.43387 11.8672 3.43359Z",fill:"currentColor"}),ye.jsx("path",{d:"M3.16699 0C3.58107 0.000164881 3.91699 0.335888 3.91699 0.75V5.58301C3.91699 5.99712 3.58107 6.33284 3.16699 6.33301C2.75278 6.33301 2.41699 5.99722 2.41699 5.58301V0.75C2.41699 0.335786 2.75278 0 3.16699 0Z",fill:"currentColor"})]}),JS=()=>ye.jsxs(Mt.Tabs,{className:"w-[800px]",children:[ye.jsxs(Mt.TabsHeader,{children:[ye.jsx(Mt.Tab,{value:"chats",children:"Chats"}),ye.jsx(Mt.Tab,{value:"issues",children:"Issues"}),ye.jsx("button",{className:"cursor-pointer mb-2 ml-auto rounded p-1 hover:bg-gray-100",children:ye.jsx(QS,{className:"size-4"})})]}),ye.jsxs(Mt.TabsBody,{children:[ye.jsx(Mt.TabPanel,{value:"chats",children:"ChatsPanel"}),ye.jsx(Mt.TabPanel,{value:"issues",children:"IssuesPanel"})]})]});var Ex={exports:{}},Nt={},br={};function eT(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var r=0;r<i.length;r++)if(Xl(i,r)){var n=i[r];if(e.call(void 0,n,r,i))return n}}function Mc(i,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(i=e.create(null,e.getOwnPropertyDescriptors(i))),e&&typeof e.freeze=="function"?e.freeze(i):i}function Xl(i,e){return Object.prototype.hasOwnProperty.call(i,e)}function tT(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Xl(e,t)&&(i[t]=e[t]);return i}var _x=Mc({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function rT(i){return Xl(_x,i.toLowerCase())}var Cx=Mc({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function nT(i){return Xl(Cx,i.toLowerCase())}var Fh=Mc({script:!1,style:!1,textarea:!0,title:!0});function iT(i){var e=i.toLowerCase();return Xl(Fh,e)&&!Fh[e]}function sT(i){var e=i.toLowerCase();return Xl(Fh,e)&&Fh[e]}function Sx(i){return i===Bh.HTML}function aT(i){return Sx(i)||i===Bh.XML_XHTML_APPLICATION}var Bh=Mc({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),oT=Object.keys(Bh).map(function(i){return Bh[i]});function lT(i){return oT.indexOf(i)>-1}var uT=Mc({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});br.assign=tT;br.find=eT;br.freeze=Mc;br.HTML_BOOLEAN_ATTRIBUTES=_x;br.HTML_RAW_TEXT_ELEMENTS=Fh;br.HTML_VOID_ELEMENTS=Cx;br.hasDefaultHTMLNamespace=aT;br.hasOwn=Xl;br.isHTMLBooleanAttribute=rT;br.isHTMLRawTextElement=iT;br.isHTMLEscapableRawTextElement=sT;br.isHTMLMimeType=Sx;br.isHTMLVoidElement=nT;br.isValidMimeType=lT;br.MIME_TYPE=Bh;br.NAMESPACE=uT;var go={},cT=br;function Tx(i,e){i.prototype=Object.create(Error.prototype,{constructor:{value:i},name:{value:i.name,enumerable:!0,writable:e}})}var zh=cT.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),kx=Object.keys(zh);function Dx(i){return typeof i=="number"&&i>=1&&i<=25}function hT(i){return typeof i=="string"&&i.substring(i.length-zh.Error.length)===zh.Error}function Nf(i,e){Dx(i)?(this.name=kx[i],this.message=e||""):(this.message=i,this.name=hT(e)?e:zh.Error),Error.captureStackTrace&&Error.captureStackTrace(this,Nf)}Tx(Nf,!0);Object.defineProperties(Nf.prototype,{code:{enumerable:!0,get:function(){var i=kx.indexOf(this.name);return Dx(i)?i:0}}});var Px={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},wm=Object.entries(Px);for(var op=0;op<wm.length;op++){var dT=wm[op][0];Nf[dT]=wm[op][1]}function qb(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,qb)}Tx(qb);go.DOMException=Nf;go.DOMExceptionName=zh;go.ExceptionCode=Px;go.ParseError=qb;var vr={},gt={};function Rx(i){try{typeof i!="function"&&(i=RegExp);var e=new i("𝌆","u").exec("𝌆");return!!e&&e[0].length===2}catch{}return!1}var Mf=Rx();function Hl(i){if(i.source[0]!=="[")throw new Error(i+" can not be used with chars");return i.source.slice(1,i.source.lastIndexOf("]"))}function kc(i,e){if(i.source[0]!=="[")throw new Error("/"+i.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(i.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+i.source+"/");if(e==="-"&&i.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+i.source+"/");return new RegExp(i.source.replace(e,""),Mf?"u":"")}function St(i){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var r=typeof t=="string";if(r&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return r?t:t.source}).join(""),Mf?"mu":"m")}function it(i){if(arguments.length===0)throw new Error("no parameters provided");return St.apply(it,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var fT="�",$l=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Mf&&($l=St("[",Hl($l),"\\u{10000}-\\u{10FFFF}","]"));var Wb=/[\x20\x09\x0D\x0A]/,pT=Hl(Wb),$t=St(Wb,"+"),dr=St(Wb,"*"),jh=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Mf&&(jh=St("[",Hl(jh),"\\u{10000}-\\u{10FFFF}","]"));var gT=Hl(jh),Xb=St("[",gT,Hl(/[-.0-9\xB7]/),Hl(/[\u0300-\u036F\u203F-\u2040]/),"]"),_i=St(jh,Xb,"*"),Ey=St(Xb,"+"),mT=St("&",_i,";"),bT=it(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Uh=it(mT,"|",bT),Hh=St("%",_i,";"),Yb=it(St('"',it(/[^%&"]/,"|",Hh,"|",Uh),"*",'"'),"|",St("'",it(/[^%&']/,"|",Hh,"|",Uh),"*","'")),vT=it('"',it(/[^<&"]/,"|",Uh),"*",'"',"|","'",it(/[^<&']/,"|",Uh),"*","'"),yT=kc(jh,":"),wT=kc(Xb,":"),_y=St(yT,wT,"*"),Lf=St(_y,it(":",_y),"?"),xT=St("^",Lf,"$"),AT=St("(",Lf,")"),$h=it(/"[^"]*"|'[^']*'/),ET=St(/^<\?/,"(",_i,")",it($t,"(",$l,"*?)"),"?",/\?>/),Cy=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Og=it('"',Cy,'*"',"|","'",kc(Cy,"'"),"*'"),Ix="<!--",Nx="-->",_T=St(Ix,it(kc($l,"-"),"|",St("-",kc($l,"-"))),"*",Nx),Sy="#PCDATA",CT=it(St(/\(/,dr,Sy,it(dr,/\|/,dr,Lf),"*",dr,/\)\*/),"|",St(/\(/,dr,Sy,dr,/\)/)),ST=/[?*+]?/,TT=St(/\([^>]+\)/,ST),kT=it("EMPTY","|","ANY","|",CT,"|",TT),DT="<!ELEMENT",PT=St(DT,$t,it(Lf,"|",Hh),$t,it(kT,"|",Hh),dr,">"),RT=St("NOTATION",$t,/\(/,dr,_i,it(dr,/\|/,dr,_i),"*",dr,/\)/),IT=St(/\(/,dr,Ey,it(dr,/\|/,dr,Ey),"*",dr,/\)/),NT=it(RT,"|",IT),MT=it(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",NT),LT=it(/#REQUIRED|#IMPLIED/,"|",it(it("#FIXED",$t),"?",vT)),OT=it($t,_i,$t,MT,$t,LT),FT="<!ATTLIST",BT=St(FT,$t,_i,OT,"*",dr,">"),vb="about:legacy-compat",zT=it('"'+vb+'"',"|","'"+vb+"'"),Zb="SYSTEM",Fg="PUBLIC",Bg=it(it(Zb,$t,$h),"|",it(Fg,$t,Og,$t,$h)),jT=St("^",it(it(Zb,$t,"(?<SystemLiteralOnly>",$h,")"),"|",it(Fg,$t,"(?<PubidLiteral>",Og,")",$t,"(?<SystemLiteral>",$h,")"))),UT=it($t,"NDATA",$t,_i),HT=it(Yb,"|",it(Bg,UT,"?")),Mx="<!ENTITY",$T=St(Mx,$t,_i,$t,HT,dr,">"),VT=it(Yb,"|",Bg),GT=St(Mx,$t,"%",$t,_i,$t,VT,dr,">"),qT=it($T,"|",GT),WT=St(Fg,$t,Og),XT=St("<!NOTATION",$t,_i,$t,it(Bg,"|",WT),dr,">"),Kb=St(dr,"=",dr),Ty=/1[.]\d+/,YT=St($t,"version",Kb,it("'",Ty,"'","|",'"',Ty,'"')),ky=/[A-Za-z][-A-Za-z0-9._]*/,ZT=it($t,"encoding",Kb,it('"',ky,'"',"|","'",ky,"'")),KT=it($t,"standalone",Kb,it("'",it("yes","|","no"),"'","|",'"',it("yes","|","no"),'"')),QT=St(/^<\?xml/,YT,ZT,"?",KT,"?",dr,/\?>/),JT="<!DOCTYPE",ek="<![CDATA[",tk="]]>",rk=/<!\[CDATA\[/,nk=/\]\]>/,ik=St($l,"*?",nk),sk=St(rk,ik);gt.chars=Hl;gt.chars_without=kc;gt.detectUnicodeSupport=Rx;gt.reg=St;gt.regg=it;gt.ABOUT_LEGACY_COMPAT=vb;gt.ABOUT_LEGACY_COMPAT_SystemLiteral=zT;gt.AttlistDecl=BT;gt.CDATA_START=ek;gt.CDATA_END=tk;gt.CDSect=sk;gt.Char=$l;gt.Comment=_T;gt.COMMENT_START=Ix;gt.COMMENT_END=Nx;gt.DOCTYPE_DECL_START=JT;gt.elementdecl=PT;gt.EntityDecl=qT;gt.EntityValue=Yb;gt.ExternalID=Bg;gt.ExternalID_match=jT;gt.Name=_i;gt.NotationDecl=XT;gt.Reference=Uh;gt.PEReference=Hh;gt.PI=ET;gt.PUBLIC=Fg;gt.PubidLiteral=Og;gt.QName=Lf;gt.QName_exact=xT;gt.QName_group=AT;gt.S=$t;gt.SChar_s=pT;gt.S_OPT=dr;gt.SYSTEM=Zb;gt.SystemLiteral=$h;gt.UNICODE_REPLACEMENT_CHARACTER=fT;gt.UNICODE_SUPPORT=Mf;gt.XMLDecl=QT;var xi=br,ws=xi.find,ak=xi.hasDefaultHTMLNamespace,Dc=xi.hasOwn,ok=xi.isHTMLMimeType,lk=xi.isHTMLRawTextElement,uk=xi.isHTMLVoidElement,Ch=xi.MIME_TYPE,xs=xi.NAMESPACE,Cn=Symbol(),Lx=go,et=Lx.DOMException,ck=Lx.DOMExceptionName,es=gt;function On(i){if(i!==Cn)throw new TypeError("Illegal constructor")}function hk(i){return i!==""}function dk(i){return i?i.split(/[\t\n\f\r ]+/).filter(hk):[]}function fk(i,e){return Dc(i,e)||(i[e]=!0),i}function Dy(i){if(!i)return[];var e=dk(i);return Object.keys(e.reduce(fk,{}))}function pk(i){return function(e){return i&&i.indexOf(e)!==-1}}function Ox(i){if(!es.QName_exact.test(i))throw new et(et.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+i+'"')}function yb(i,e){Ox(e),i=i||null;var t=null,r=e;if(e.indexOf(":")>=0){var n=e.split(":");t=n[0],r=n[1]}if(t!==null&&i===null)throw new et(et.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&i!==xi.NAMESPACE.XML)throw new et(et.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&i!==xi.NAMESPACE.XMLNS)throw new et(et.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(i===xi.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new et(et.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[i,t,r]}function Lc(i,e){for(var t in i)Dc(i,t)&&(e[t]=i[t])}function Fn(i,e){var t=i.prototype;if(!(t instanceof e)){let r=function(){};r.prototype=e.prototype,r=new r,Lc(t,r),i.prototype=t=r}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var Bn={},Gi=Bn.ELEMENT_NODE=1,Pc=Bn.ATTRIBUTE_NODE=2,tg=Bn.TEXT_NODE=3,Fx=Bn.CDATA_SECTION_NODE=4,Bx=Bn.ENTITY_REFERENCE_NODE=5,gk=Bn.ENTITY_NODE=6,zx=Bn.PROCESSING_INSTRUCTION_NODE=7,jx=Bn.COMMENT_NODE=8,Vh=Bn.DOCUMENT_NODE=9,Ux=Bn.DOCUMENT_TYPE_NODE=10,oo=Bn.DOCUMENT_FRAGMENT_NODE=11,mk=Bn.NOTATION_NODE=12,fr=xi.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Hx(i,e){if(e.length<i.length)return Hx(e,i);var t=null;for(var r in i){if(i[r]!==e[r])return t;t=i[r]}return t}function Py(i){return i.guid||(i.guid=Math.random()),i.guid}function Mr(){}Mr.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i){for(var e=[],t=0;t<this.length;t++)fu(this[t],e,i);return e.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};Mr.prototype[Symbol.iterator]=function(){var i=this,e=0;return{next:function(){return e<i.length?{value:i[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Bl(i,e){this._node=i,this._refresh=e,zg(this)}function zg(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(eA(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var r=t.length;r in i;r++)Dc(i,r)&&delete i[r];Lc(t,i),i._inc=e}}Bl.prototype.item=function(i){return zg(this),this[i]||null};Fn(Bl,Mr);function Rc(){}function $x(i,e){for(var t=0;t<i.length;){if(i[t]===e)return t;t++}}function bk(i,e,t,r){if(r?e[$x(e,r)]=t:(e[e.length]=t,e.length++),i){t.ownerElement=i;var n=i.ownerDocument;n&&(r&&qx(n,i,r),vk(n,i,t))}}function Ry(i,e,t){var r=$x(e,t);if(r>=0){for(var n=e.length-1;r<=n;)e[r]=e[++r];if(e.length=n,i){var s=i.ownerDocument;s&&qx(s,i,t),t.ownerElement=null}}}Rc.prototype={length:0,item:Mr.prototype.item,getNamedItem:function(i){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(i=i.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===i)return t;e++}return null},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!==this._ownerElement)throw new et(et.INUSE_ATTRIBUTE_ERR);var t=this.getNamedItemNS(i.namespaceURI,i.localName);return t===i?i:(bk(this._ownerElement,this,i,t),t)},setNamedItemNS:function(i){return this.setNamedItem(i)},removeNamedItem:function(i){var e=this.getNamedItem(i);if(!e)throw new et(et.NOT_FOUND_ERR,i);return Ry(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);if(!t)throw new et(et.NOT_FOUND_ERR,i?i+" : "+e:e);return Ry(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){i||(i=null);for(var t=0;t<this.length;){var r=this[t];if(r.localName===e&&r.namespaceURI===i)return r;t++}return null}};Rc.prototype[Symbol.iterator]=function(){var i=this,e=0;return{next:function(){return e<i.length?{value:i[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Vx(){}Vx.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var r=Ch.XML_APPLICATION;i===xs.HTML?r=Ch.XML_XHTML_APPLICATION:i===xs.SVG&&(r=Ch.XML_SVG_IMAGE);var n=new lo(Cn,{contentType:r});if(n.implementation=this,n.childNodes=new Mr,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(i,e);n.appendChild(s)}return n},createDocumentType:function(i,e,t,r){Ox(i);var n=new Hg(Cn);return n.name=i,n.nodeName=i,n.publicId=e||"",n.systemId=t||"",n.internalSubset=r||"",n.childNodes=new Mr,n},createHTMLDocument:function(i){var e=new lo(Cn,{contentType:Ch.HTML});if(e.implementation=this,e.childNodes=new Mr,i!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var r=e.createElement("head");if(t.appendChild(r),typeof i=="string"){var n=e.createElement("title");n.appendChild(e.createTextNode(i)),r.appendChild(n)}t.appendChild(e.createElement("body"))}return e}};function It(i){On(i)}It.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var i=this.getRootNode();return i&&i.nodeType===i.DOCUMENT_NODE},contains:function(i){if(!i)return!1;var e=i;do{if(this===e)return!0;e=i.parentNode}while(e);return!1},getRootNode:function(i){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(i){if(!i||this.nodeType!==i.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==i.name||this.publicId!==i.publicId||this.systemId!==i.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==i.namespaceURI||this.prefix!==i.prefix||this.localName!==i.localName||this.attributes.length!==i.attributes.length)return!1;for(var e=0;e<this.attributes.length;e++){var t=this.attributes.item(e);if(!t.isEqualNode(i.getAttributeNodeNS(t.namespaceURI,t.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==i.namespaceURI||this.localName!==i.localName||this.value!==i.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==i.target||this.data!==i.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==i.data)return!1;break}if(this.childNodes.length!==i.childNodes.length)return!1;for(var e=0;e<this.childNodes.length;e++)if(!this.childNodes[e].isEqualNode(i.childNodes[e]))return!1;return!0},isSameNode:function(i){return this===i},insertBefore:function(i,e){return rg(this,i,e)},replaceChild:function(i,e){rg(this,i,e,Zx),e&&this.removeChild(e)},removeChild:function(i){return Xx(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return wb(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==tg&&i.nodeType==tg?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var r in t)if(Dc(t,r)&&t[r]===i)return r}e=e.nodeType==Pc?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Dc(t,i))return t[i];e=e.nodeType==Pc?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null},compareDocumentPosition:function(i){if(this===i)return 0;var e=i,t=this,r=null,n=null;if(e instanceof Vl&&(r=e,e=r.ownerElement),t instanceof Vl&&(n=t,t=n.ownerElement,r&&e&&t===e))for(var s=0,a;a=t.attributes[s];s++){if(a===r)return fr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+fr.DOCUMENT_POSITION_PRECEDING;if(a===n)return fr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+fr.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return fr.DOCUMENT_POSITION_DISCONNECTED+fr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Py(t.ownerDocument)>Py(e.ownerDocument)?fr.DOCUMENT_POSITION_FOLLOWING:fr.DOCUMENT_POSITION_PRECEDING);if(n&&e===t)return fr.DOCUMENT_POSITION_CONTAINS+fr.DOCUMENT_POSITION_PRECEDING;if(r&&e===t)return fr.DOCUMENT_POSITION_CONTAINED_BY+fr.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!n&&l===t)return fr.DOCUMENT_POSITION_CONTAINED_BY+fr.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var c=[],h=t.parentNode;h;){if(!r&&h===e)return fr.DOCUMENT_POSITION_CONTAINS+fr.DOCUMENT_POSITION_PRECEDING;c.push(h),h=h.parentNode}c.reverse();var d=Hx(o,c);for(var p in d.childNodes){var g=d.childNodes[p];if(g===t)return fr.DOCUMENT_POSITION_FOLLOWING;if(g===e)return fr.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(g)>=0)return fr.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(g)>=0)return fr.DOCUMENT_POSITION_PRECEDING}return 0}};function Gx(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}Lc(Bn,It);Lc(Bn,It.prototype);Lc(fr,It);Lc(fr,It.prototype);function kh(i,e){if(e(i))return!0;if(i=i.firstChild)do if(kh(i,e))return!0;while(i=i.nextSibling)}function lo(i,e){On(i);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||Ch.XML_APPLICATION,this.type=ok(this.contentType)?"html":"xml"}function vk(i,e,t){i&&i._inc++;var r=t.namespaceURI;r===xs.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function qx(i,e,t,r){i&&i._inc++;var n=t.namespaceURI;n===xs.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Wx(i,e,t){if(i&&i._inc){i._inc++;var r=e.childNodes;if(t&&!t.nextSibling)r[r.length++]=t;else{for(var n=e.firstChild,s=0;n;)r[s++]=n,n=n.nextSibling;r.length=s,delete r[r.length]}}}function Xx(i,e){if(i!==e.parentNode)throw new et(et.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,r=e.nextSibling;return t?t.nextSibling=r:i.firstChild=r,r?r.previousSibling=t:i.lastChild=t,Wx(i.ownerDocument,i),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function yk(i){return i&&(i.nodeType===It.DOCUMENT_NODE||i.nodeType===It.DOCUMENT_FRAGMENT_NODE||i.nodeType===It.ELEMENT_NODE)}function wk(i){return i&&(i.nodeType===It.CDATA_SECTION_NODE||i.nodeType===It.COMMENT_NODE||i.nodeType===It.DOCUMENT_FRAGMENT_NODE||i.nodeType===It.DOCUMENT_TYPE_NODE||i.nodeType===It.ELEMENT_NODE||i.nodeType===It.PROCESSING_INSTRUCTION_NODE||i.nodeType===It.TEXT_NODE)}function uo(i){return i&&i.nodeType===It.DOCUMENT_TYPE_NODE}function la(i){return i&&i.nodeType===It.ELEMENT_NODE}function Yx(i){return i&&i.nodeType===It.TEXT_NODE}function Iy(i,e){var t=i.childNodes||[];if(ws(t,la)||uo(e))return!1;var r=ws(t,uo);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function Ny(i,e){var t=i.childNodes||[];function r(s){return la(s)&&s!==e}if(ws(t,r))return!1;var n=ws(t,uo);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function xk(i,e,t){if(!yk(i))throw new et(et.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new et(et.NOT_FOUND_ERR,"child not in parent");if(!wk(e)||uo(e)&&i.nodeType!==It.DOCUMENT_NODE)throw new et(et.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function Ak(i,e,t){var r=i.childNodes||[],n=e.childNodes||[];if(e.nodeType===It.DOCUMENT_FRAGMENT_NODE){var s=n.filter(la);if(s.length>1||ws(n,Yx))throw new et(et.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Iy(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(la(e)&&!Iy(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(uo(e)){if(ws(r,uo))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=ws(r,la);if(t&&r.indexOf(a)<r.indexOf(t))throw new et(et.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new et(et.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Zx(i,e,t){var r=i.childNodes||[],n=e.childNodes||[];if(e.nodeType===It.DOCUMENT_FRAGMENT_NODE){var s=n.filter(la);if(s.length>1||ws(n,Yx))throw new et(et.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Ny(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(la(e)&&!Ny(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(uo(e)){if(ws(r,function(l){return uo(l)&&l!==t}))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=ws(r,la);if(t&&r.indexOf(a)<r.indexOf(t))throw new et(et.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function rg(i,e,t,r){xk(i,e,t),i.nodeType===It.DOCUMENT_NODE&&(r||Ak)(i,e,t);var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===oo){var s=e.firstChild;if(s==null)return e;var a=e.lastChild}else s=a=e;var o=t?t.previousSibling:i.lastChild;s.previousSibling=o,a.nextSibling=t,o?o.nextSibling=s:i.firstChild=s,t==null?i.lastChild=a:t.previousSibling=a;do s.parentNode=i;while(s!==a&&(s=s.nextSibling));return Wx(i.ownerDocument||i,i,e),e.nodeType==oo&&(e.firstChild=e.lastChild=null),e}lo.prototype={implementation:null,nodeName:"#document",nodeType:Vh,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType===oo){for(var t=i.firstChild;t;){var r=t.nextSibling;this.insertBefore(t,e),t=r}return i}return rg(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===Gi&&(this.documentElement=i),i},removeChild:function(i){var e=Xx(this,i);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(i,e){rg(this,i,e,Zx),i.ownerDocument=this,e&&this.removeChild(e),la(i)&&(this.documentElement=i)},importNode:function(i,e){return Jx(this,i,e)},getElementById:function(i){var e=null;return kh(this.documentElement,function(t){if(t.nodeType==Gi&&t.getAttribute("id")==i)return e=t,!0}),e},createElement:function(i){var e=new co(Cn);e.ownerDocument=this,this.type==="html"&&(i=i.toLowerCase()),ak(this.contentType)&&(e.namespaceURI=xs.HTML),e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Mr;var t=e.attributes=new Rc;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Ff(Cn);return i.ownerDocument=this,i.childNodes=new Mr,i},createTextNode:function(i){var e=new Of(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.appendData(i),e},createComment:function(i){var e=new jg(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.appendData(i),e},createCDATASection:function(i){var e=new Ug(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Vg(Cn);return t.ownerDocument=this,t.childNodes=new Mr,t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){if(!es.QName_exact.test(i))throw new et(et.INVALID_CHARACTER_ERR,'invalid character in name "'+i+'"');return this.type==="html"&&(i=i.toLowerCase()),this._createAttribute(i)},_createAttribute:function(i){var e=new Vl(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){if(!es.Name.test(i))throw new et(et.INVALID_CHARACTER_ERR,'not a valid xml name "'+i+'"');if(this.type==="html")throw new et("document is an html document",ck.NotSupportedError);var e=new $g(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.nodeName=i,e},createElementNS:function(i,e){var t=yb(i,e),r=new co(Cn),n=r.attributes=new Rc;return r.childNodes=new Mr,r.ownerDocument=this,r.nodeName=e,r.tagName=e,r.namespaceURI=t[0],r.prefix=t[1],r.localName=t[2],n._ownerElement=r,r},createAttributeNS:function(i,e){var t=yb(i,e),r=new Vl(Cn);return r.ownerDocument=this,r.childNodes=new Mr,r.nodeName=e,r.name=e,r.specified=!0,r.namespaceURI=t[0],r.prefix=t[1],r.localName=t[2],r}};Fn(lo,It);function co(i){On(i),this._nsMap=Object.create(null)}co.prototype={nodeType:Gi,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===xs.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(i){return!!this.getAttributeNode(i)},getAttribute:function(i){var e=this.getAttributeNode(i);return e?e.value:null},getAttributeNode:function(i){return this._isInHTMLDocumentAndNamespace()&&(i=i.toLowerCase()),this.attributes.getNamedItem(i)},setAttribute:function(i,e){this._isInHTMLDocumentAndNamespace()&&(i=i.toLowerCase());var t=this.getAttributeNode(i);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(i),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t?t.value:null},setAttributeNS:function(i,e,t){var r=yb(i,e),n=r[2],s=this.getAttributeNodeNS(i,n);s?s.value=s.nodeValue=""+t:(s=this.ownerDocument.createAttributeNS(i,e),s.value=s.nodeValue=""+t,this.setAttributeNode(s))},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByClassName:function(i){var e=Dy(i);return new Bl(this,function(t){var r=[];return e.length>0&&kh(t,function(n){if(n!==t&&n.nodeType===Gi){var s=n.getAttribute("class");if(s){var a=i===s;if(!a){var o=Dy(s);a=e.every(pk(o))}a&&r.push(n)}}}),r})},getElementsByTagName:function(i){var e=(this.nodeType===Vh?this:this.ownerDocument).type==="html",t=i.toLowerCase();return new Bl(this,function(r){var n=[];return kh(r,function(s){if(!(s===r||s.nodeType!==Gi))if(i==="*")n.push(s);else{var a=s.getQualifiedName(),o=e&&s.namespaceURI===xs.HTML?t:i;a===o&&n.push(s)}}),n})},getElementsByTagNameNS:function(i,e){return new Bl(this,function(t){var r=[];return kh(t,function(n){n!==t&&n.nodeType===Gi&&(i==="*"||n.namespaceURI===i)&&(e==="*"||n.localName==e)&&r.push(n)}),r})}};lo.prototype.getElementsByClassName=co.prototype.getElementsByClassName;lo.prototype.getElementsByTagName=co.prototype.getElementsByTagName;lo.prototype.getElementsByTagNameNS=co.prototype.getElementsByTagNameNS;Fn(co,It);function Vl(i){On(i),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Vl.prototype.nodeType=Pc;Fn(Vl,It);function Oc(i){On(i)}Oc.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var r=this.data.substring(0,i),n=this.data.substring(i+e);t=r+t+n,this.nodeValue=this.data=t,this.length=t.length}};Fn(Oc,It);function Of(i){On(i)}Of.prototype={nodeName:"#text",nodeType:tg,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};Fn(Of,Oc);function jg(i){On(i)}jg.prototype={nodeName:"#comment",nodeType:jx};Fn(jg,Oc);function Ug(i){On(i)}Ug.prototype={nodeName:"#cdata-section",nodeType:Fx};Fn(Ug,Of);function Hg(i){On(i)}Hg.prototype.nodeType=Ux;Fn(Hg,It);function Qb(i){On(i)}Qb.prototype.nodeType=mk;Fn(Qb,It);function Jb(i){On(i)}Jb.prototype.nodeType=gk;Fn(Jb,It);function $g(i){On(i)}$g.prototype.nodeType=Bx;Fn($g,It);function Ff(i){On(i)}Ff.prototype.nodeName="#document-fragment";Ff.prototype.nodeType=oo;Fn(Ff,It);function Vg(i){On(i)}Vg.prototype.nodeType=zx;Fn(Vg,Oc);function Kx(){}Kx.prototype.serializeToString=function(i,e){return Qx.call(i,e)};It.prototype.toString=Qx;function Qx(i){var e=[],t=this.nodeType===Vh&&this.documentElement||this,r=t.prefix,n=t.namespaceURI;if(n&&r==null){var r=t.lookupPrefix(n);if(r==null)var s=[{namespace:n,prefix:null}]}return fu(this,e,i,s),e.join("")}function My(i,e,t){var r=i.prefix||"",n=i.namespaceURI;if(!n||r==="xml"&&n===xs.XML||n===xs.XMLNS)return!1;for(var s=t.length;s--;){var a=t[s];if(a.prefix===r)return a.namespace!==n}return!0}function xm(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Gx),'"')}function fu(i,e,t,r){r||(r=[]);var n=i.nodeType===Vh?i:i.ownerDocument,s=n.type==="html";if(t)if(i=t(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case Gi:var a=i.attributes,o=a.length,E=i.firstChild,l=i.tagName,c=l;if(!s&&!i.prefix&&i.namespaceURI){for(var h,d=0;d<a.length;d++)if(a.item(d).name==="xmlns"){h=a.item(d).value;break}if(!h)for(var p=r.length-1;p>=0;p--){var g=r[p];if(g.prefix===""&&g.namespace===i.namespaceURI){h=g.namespace;break}}if(h!==i.namespaceURI)for(var p=r.length-1;p>=0;p--){var g=r[p];if(g.namespace===i.namespaceURI){g.prefix&&(c=g.prefix+":"+l);break}}}e.push("<",c);for(var y=0;y<o;y++){var b=a.item(y);b.prefix=="xmlns"?r.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&r.push({prefix:"",namespace:b.value})}for(var y=0;y<o;y++){var b=a.item(y);if(My(b,s,r)){var w=b.prefix||"",v=b.namespaceURI;xm(e,w?"xmlns:"+w:"xmlns",v),r.push({prefix:w,namespace:v})}fu(b,e,t,r)}if(l===c&&My(i,s,r)){var w=i.prefix||"",v=i.namespaceURI;xm(e,w?"xmlns:"+w:"xmlns",v),r.push({prefix:w,namespace:v})}var A=!E;if(A&&(s||i.namespaceURI===xs.HTML)&&(A=uk(l)),A)e.push("/>");else{if(e.push(">"),s&&lk(l))for(;E;)E.data?e.push(E.data):fu(E,e,t,r.slice()),E=E.nextSibling;else for(;E;)fu(E,e,t,r.slice()),E=E.nextSibling;e.push("</",c,">")}return;case Vh:case oo:for(var E=i.firstChild;E;)fu(E,e,t,r.slice()),E=E.nextSibling;return;case Pc:return xm(e,i.name,i.value);case tg:return e.push(i.data.replace(/[<&>]/g,Gx));case Fx:return e.push(es.CDATA_START,i.data,es.CDATA_END);case jx:return e.push(es.COMMENT_START,i.data,es.COMMENT_END);case Ux:var _=i.publicId,C=i.systemId;e.push(es.DOCTYPE_DECL_START," ",i.name),_?(e.push(" ",es.PUBLIC," ",_),C&&C!=="."&&e.push(" ",C)):C&&C!=="."&&e.push(" ",es.SYSTEM," ",C),i.internalSubset&&e.push(" [",i.internalSubset,"]"),e.push(">");return;case zx:return e.push("<?",i.target," ",i.data,"?>");case Bx:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Jx(i,e,t){var r;switch(e.nodeType){case Gi:r=e.cloneNode(!1),r.ownerDocument=i;case oo:break;case Pc:t=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=i,r.parentNode=null,t)for(var n=e.firstChild;n;)r.appendChild(Jx(i,n,t)),n=n.nextSibling;return r}function wb(i,e,t){var r=new e.constructor(Cn);for(var n in e)if(Dc(e,n)){var s=e[n];typeof s!="object"&&s!=r[n]&&(r[n]=s)}switch(e.childNodes&&(r.childNodes=new Mr),r.ownerDocument=i,r.nodeType){case Gi:var a=e.attributes,o=r.attributes=new Rc,l=a.length;o._ownerElement=r;for(var c=0;c<l;c++)r.setAttributeNode(wb(i,a.item(c),!0));break;case Pc:t=!0}if(t)for(var h=e.firstChild;h;)r.appendChild(wb(i,h,t)),h=h.nextSibling;return r}function eA(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case Gi:case oo:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(Bl.prototype,"length",{get:function(){return zg(this),this.$$length}}),Object.defineProperty(It.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case Gi:case oo:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),eA=function(e,t,r){e["$$"+t]=r}}}catch{}vr._updateLiveList=zg;vr.Attr=Vl;vr.CDATASection=Ug;vr.CharacterData=Oc;vr.Comment=jg;vr.Document=lo;vr.DocumentFragment=Ff;vr.DocumentType=Hg;vr.DOMImplementation=Vx;vr.Element=co;vr.Entity=Jb;vr.EntityReference=$g;vr.LiveNodeList=Bl;vr.NamedNodeMap=Rc;vr.Node=It;vr.NodeList=Mr;vr.Notation=Qb;vr.Text=Of;vr.ProcessingInstruction=Vg;vr.XMLSerializer=Kx;var Fc={},tA={};(function(i){var e=br.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
41
+ `)){const r=document.createElement("div");r.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(r)}},Cw=function(){return u(this,Xn).replaceAll(" "," ")},G0=function(t){return t.replaceAll(" "," ")},Sw=function(t){const{value:r,fontSize:n,color:s,pageIndex:a}=this._initialData;return this._hasBeenMoved||t.value!==r||t.fontSize!==n||t.color.some((o,l)=>o!==s[l])||t.pageIndex!==a},N(Jt,ca),Ie(Jt,"_freeTextDefaultContent",""),Ie(Jt,"_internalPadding",0),Ie(Jt,"_defaultColor",null),Ie(Jt,"_defaultFontSize",10),Ie(Jt,"_type","freetext"),Ie(Jt,"_editorType",ot.FREETEXT);let V0=Jt;class qe{toSVGPath(){Wt("Abstract method `toSVGPath` must be implemented.")}get box(){Wt("Abstract getter `box` must be implemented.")}serialize(e,t){Wt("Abstract method `serialize` must be implemented.")}static _rescale(e,t,r,n,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o]*n,a[o+1]=r+e[o+1]*s;return a}static _rescaleAndSwap(e,t,r,n,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o+1]*n,a[o+1]=r+e[o]*s;return a}static _translate(e,t,r,n){n||(n=new Float32Array(e.length));for(let s=0,a=e.length;s<a;s+=2)n[s]=t+e[s],n[s+1]=r+e[s+1];return n}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,r,n,s){switch(s){case 90:return[1-t/r,e/n];case 180:return[1-e/r,1-t/n];case 270:return[t/r,1-e/n];default:return[e/r,t/n]}}static _normalizePagePoint(e,t,r){switch(r){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,r,n,s,a){return[(e+5*r)/6,(t+5*n)/6,(5*r+s)/6,(5*n+a)/6,(r+s)/2,(n+a)/2]}}Ie(qe,"PRECISION",1e-4);var Zn,zi,ic,sc,hs,xt,bl,vl,af,of,ac,oc,Va,lf,yg,wg,Lr,yh,Tw,kw,Dw,Pw,Rw,Iw;const Rs=class Rs{constructor({x:e,y:t},r,n,s,a,o=0){N(this,Lr);N(this,Zn);N(this,zi,[]);N(this,ic);N(this,sc);N(this,hs,[]);N(this,xt,new Float32Array(18));N(this,bl);N(this,vl);N(this,af);N(this,of);N(this,ac);N(this,oc);N(this,Va,[]);T(this,Zn,r),T(this,oc,s*n),T(this,sc,a),u(this,xt).set([NaN,NaN,NaN,NaN,e,t],6),T(this,ic,o),T(this,of,u(Rs,lf)*n),T(this,af,u(Rs,wg)*n),T(this,ac,n),u(this,Va).push(e,t)}isEmpty(){return isNaN(u(this,xt)[8])}add({x:e,y:t}){var R;T(this,bl,e),T(this,vl,t);const[r,n,s,a]=u(this,Zn);let[o,l,c,h]=u(this,xt).subarray(8,12);const d=e-c,p=t-h,g=Math.hypot(d,p);if(g<u(this,af))return!1;const y=g-u(this,of),b=y/g,w=b*d,v=b*p;let A=o,E=l;o=c,l=h,c+=w,h+=v,(R=u(this,Va))==null||R.push(e,t);const _=-v/y,C=w/y,I=_*u(this,oc),k=C*u(this,oc);return u(this,xt).set(u(this,xt).subarray(2,8),0),u(this,xt).set([c+I,h+k],4),u(this,xt).set(u(this,xt).subarray(14,18),12),u(this,xt).set([c-I,h-k],16),isNaN(u(this,xt)[6])?(u(this,hs).length===0&&(u(this,xt).set([o+I,l+k],2),u(this,hs).push(NaN,NaN,NaN,NaN,(o+I-r)/s,(l+k-n)/a),u(this,xt).set([o-I,l-k],14),u(this,zi).push(NaN,NaN,NaN,NaN,(o-I-r)/s,(l-k-n)/a)),u(this,xt).set([A,E,o,l,c,h],6),!this.isEmpty()):(u(this,xt).set([A,E,o,l,c,h],6),Math.abs(Math.atan2(E-l,A-o)-Math.atan2(v,w))<Math.PI/2?([o,l,c,h]=u(this,xt).subarray(2,6),u(this,hs).push(NaN,NaN,NaN,NaN,((o+c)/2-r)/s,((l+h)/2-n)/a),[o,l,A,E]=u(this,xt).subarray(14,18),u(this,zi).push(NaN,NaN,NaN,NaN,((A+o)/2-r)/s,((E+l)/2-n)/a),!0):([A,E,o,l,c,h]=u(this,xt).subarray(0,6),u(this,hs).push(((A+5*o)/6-r)/s,((E+5*l)/6-n)/a,((5*o+c)/6-r)/s,((5*l+h)/6-n)/a,((o+c)/2-r)/s,((l+h)/2-n)/a),[c,h,o,l,A,E]=u(this,xt).subarray(12,18),u(this,zi).push(((A+5*o)/6-r)/s,((E+5*l)/6-n)/a,((5*o+c)/6-r)/s,((5*l+h)/6-n)/a,((o+c)/2-r)/s,((l+h)/2-n)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=u(this,hs),t=u(this,zi);if(isNaN(u(this,xt)[6])&&!this.isEmpty())return L(this,Lr,Tw).call(this);const r=[];r.push(`M${e[4]} ${e[5]}`);for(let n=6;n<e.length;n+=6)isNaN(e[n])?r.push(`L${e[n+4]} ${e[n+5]}`):r.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);L(this,Lr,Dw).call(this,r);for(let n=t.length-6;n>=6;n-=6)isNaN(t[n])?r.push(`L${t[n+4]} ${t[n+5]}`):r.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);return L(this,Lr,kw).call(this,r),r.join(" ")}newFreeDrawOutline(e,t,r,n,s,a){return new Nw(e,t,r,n,s,a)}getOutlines(){var d;const e=u(this,hs),t=u(this,zi),r=u(this,xt),[n,s,a,o]=u(this,Zn),l=new Float32Array((((d=u(this,Va))==null?void 0:d.length)??0)+2);for(let p=0,g=l.length-2;p<g;p+=2)l[p]=(u(this,Va)[p]-n)/a,l[p+1]=(u(this,Va)[p+1]-s)/o;if(l[l.length-2]=(u(this,bl)-n)/a,l[l.length-1]=(u(this,vl)-s)/o,isNaN(r[6])&&!this.isEmpty())return L(this,Lr,Pw).call(this,l);const c=new Float32Array(u(this,hs).length+24+u(this,zi).length);let h=e.length;for(let p=0;p<h;p+=2){if(isNaN(e[p])){c[p]=c[p+1]=NaN;continue}c[p]=e[p],c[p+1]=e[p+1]}h=L(this,Lr,Iw).call(this,c,h);for(let p=t.length-6;p>=6;p-=6)for(let g=0;g<6;g+=2){if(isNaN(t[p+g])){c[h]=c[h+1]=NaN,h+=2;continue}c[h]=t[p+g],c[h+1]=t[p+g+1],h+=2}return L(this,Lr,Rw).call(this,c,h),this.newFreeDrawOutline(c,l,u(this,Zn),u(this,ac),u(this,ic),u(this,sc))}};Zn=new WeakMap,zi=new WeakMap,ic=new WeakMap,sc=new WeakMap,hs=new WeakMap,xt=new WeakMap,bl=new WeakMap,vl=new WeakMap,af=new WeakMap,of=new WeakMap,ac=new WeakMap,oc=new WeakMap,Va=new WeakMap,lf=new WeakMap,yg=new WeakMap,wg=new WeakMap,Lr=new WeakSet,yh=function(){const e=u(this,xt).subarray(4,6),t=u(this,xt).subarray(16,18),[r,n,s,a]=u(this,Zn);return[(u(this,bl)+(e[0]-t[0])/2-r)/s,(u(this,vl)+(e[1]-t[1])/2-n)/a,(u(this,bl)+(t[0]-e[0])/2-r)/s,(u(this,vl)+(t[1]-e[1])/2-n)/a]},Tw=function(){const[e,t,r,n]=u(this,Zn),[s,a,o,l]=L(this,Lr,yh).call(this);return`M${(u(this,xt)[2]-e)/r} ${(u(this,xt)[3]-t)/n} L${(u(this,xt)[4]-e)/r} ${(u(this,xt)[5]-t)/n} L${s} ${a} L${o} ${l} L${(u(this,xt)[16]-e)/r} ${(u(this,xt)[17]-t)/n} L${(u(this,xt)[14]-e)/r} ${(u(this,xt)[15]-t)/n} Z`},kw=function(e){const t=u(this,zi);e.push(`L${t[4]} ${t[5]} Z`)},Dw=function(e){const[t,r,n,s]=u(this,Zn),a=u(this,xt).subarray(4,6),o=u(this,xt).subarray(16,18),[l,c,h,d]=L(this,Lr,yh).call(this);e.push(`L${(a[0]-t)/n} ${(a[1]-r)/s} L${l} ${c} L${h} ${d} L${(o[0]-t)/n} ${(o[1]-r)/s}`)},Pw=function(e){const t=u(this,xt),[r,n,s,a]=u(this,Zn),[o,l,c,h]=L(this,Lr,yh).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-r)/s,(t[3]-n)/a,NaN,NaN,NaN,NaN,(t[4]-r)/s,(t[5]-n)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(t[16]-r)/s,(t[17]-n)/a,NaN,NaN,NaN,NaN,(t[14]-r)/s,(t[15]-n)/a],0),this.newFreeDrawOutline(d,e,u(this,Zn),u(this,ac),u(this,ic),u(this,sc))},Rw=function(e,t){const r=u(this,zi);return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],t),t+=6},Iw=function(e,t){const r=u(this,xt).subarray(4,6),n=u(this,xt).subarray(16,18),[s,a,o,l]=u(this,Zn),[c,h,d,p]=L(this,Lr,yh).call(this);return e.set([NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,d,p,NaN,NaN,NaN,NaN,(n[0]-s)/o,(n[1]-a)/l],t),t+=24},N(Rs,lf,8),N(Rs,yg,2),N(Rs,wg,u(Rs,lf)+u(Rs,yg));let Zp=Rs;var lc,yl,Js,uf,Kn,cf,Ar,xg,Mw;class Nw extends qe{constructor(t,r,n,s,a,o){super();N(this,xg);N(this,lc);N(this,yl,new Float32Array(4));N(this,Js);N(this,uf);N(this,Kn);N(this,cf);N(this,Ar);T(this,Ar,t),T(this,Kn,r),T(this,lc,n),T(this,cf,s),T(this,Js,a),T(this,uf,o),this.lastPoint=[NaN,NaN],L(this,xg,Mw).call(this,o);const[l,c,h,d]=u(this,yl);for(let p=0,g=t.length;p<g;p+=2)t[p]=(t[p]-l)/h,t[p+1]=(t[p+1]-c)/d;for(let p=0,g=r.length;p<g;p+=2)r[p]=(r[p]-l)/h,r[p+1]=(r[p+1]-c)/d}toSVGPath(){const t=[`M${u(this,Ar)[4]} ${u(this,Ar)[5]}`];for(let r=6,n=u(this,Ar).length;r<n;r+=6){if(isNaN(u(this,Ar)[r])){t.push(`L${u(this,Ar)[r+4]} ${u(this,Ar)[r+5]}`);continue}t.push(`C${u(this,Ar)[r]} ${u(this,Ar)[r+1]} ${u(this,Ar)[r+2]} ${u(this,Ar)[r+3]} ${u(this,Ar)[r+4]} ${u(this,Ar)[r+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,r,n,s],a){const o=n-t,l=s-r;let c,h;switch(a){case 0:c=qe._rescale(u(this,Ar),t,s,o,-l),h=qe._rescale(u(this,Kn),t,s,o,-l);break;case 90:c=qe._rescaleAndSwap(u(this,Ar),t,r,o,l),h=qe._rescaleAndSwap(u(this,Kn),t,r,o,l);break;case 180:c=qe._rescale(u(this,Ar),n,r,-o,l),h=qe._rescale(u(this,Kn),n,r,-o,l);break;case 270:c=qe._rescaleAndSwap(u(this,Ar),n,s,-o,-l),h=qe._rescaleAndSwap(u(this,Kn),n,s,-o,-l);break}return{outline:Array.from(c),points:[Array.from(h)]}}get box(){return u(this,yl)}newOutliner(t,r,n,s,a,o=0){return new Zp(t,r,n,s,a,o)}getNewOutline(t,r){const[n,s,a,o]=u(this,yl),[l,c,h,d]=u(this,lc),p=a*h,g=o*d,y=n*h+l,b=s*d+c,w=this.newOutliner({x:u(this,Kn)[0]*p+y,y:u(this,Kn)[1]*g+b},u(this,lc),u(this,cf),t,u(this,uf),r??u(this,Js));for(let v=2;v<u(this,Kn).length;v+=2)w.add({x:u(this,Kn)[v]*p+y,y:u(this,Kn)[v+1]*g+b});return w.getOutlines()}}lc=new WeakMap,yl=new WeakMap,Js=new WeakMap,uf=new WeakMap,Kn=new WeakMap,cf=new WeakMap,Ar=new WeakMap,xg=new WeakSet,Mw=function(t){const r=u(this,Ar);let n=r[4],s=r[5];const a=[n,s,n,s];let o=n,l=s;const c=t?Math.max:Math.min;for(let d=6,p=r.length;d<p;d+=6){const g=r[d+4],y=r[d+5];if(isNaN(r[d]))Qe.pointBoundingBox(g,y,a),l<y?(o=g,l=y):l===y&&(o=c(o,g));else{const b=[1/0,1/0,-1/0,-1/0];Qe.bezierBoundingBox(n,s,...r.slice(d,d+6),b),Qe.rectBoundingBox(...b,a),l<b[3]?(o=b[2],l=b[3]):l===b[3]&&(o=c(o,b[2]))}n=g,s=y}const h=u(this,yl);h[0]=a[0]-u(this,Js),h[1]=a[1]-u(this,Js),h[2]=a[2]-a[0]+2*u(this,Js),h[3]=a[3]-a[1]+2*u(this,Js),this.lastPoint=[o,l]};var hf,df,Ga,ji,kn,Lw,Np,Ow,Fw,W0;class q0{constructor(e,t=0,r=0,n=!0){N(this,kn);N(this,hf);N(this,df);N(this,Ga,[]);N(this,ji,[]);const s=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:g,y,width:b,height:w}of e){const v=Math.floor((g-t)/a)*a,A=Math.ceil((g+b+t)/a)*a,E=Math.floor((y-t)/a)*a,_=Math.ceil((y+w+t)/a)*a,C=[v,E,_,!0],I=[A,E,_,!1];u(this,Ga).push(C,I),Qe.rectBoundingBox(v,E,A,_,s)}const o=s[2]-s[0]+2*r,l=s[3]-s[1]+2*r,c=s[0]-r,h=s[1]-r,d=u(this,Ga).at(n?-1:-2),p=[d[0],d[2]];for(const g of u(this,Ga)){const[y,b,w]=g;g[0]=(y-c)/o,g[1]=(b-h)/l,g[2]=(w-h)/l}T(this,hf,new Float32Array([c,h,o,l])),T(this,df,p)}getOutlines(){u(this,Ga).sort((t,r)=>t[0]-r[0]||t[1]-r[1]||t[2]-r[2]);const e=[];for(const t of u(this,Ga))t[3]?(e.push(...L(this,kn,W0).call(this,t)),L(this,kn,Ow).call(this,t)):(L(this,kn,Fw).call(this,t),e.push(...L(this,kn,W0).call(this,t)));return L(this,kn,Lw).call(this,e)}}hf=new WeakMap,df=new WeakMap,Ga=new WeakMap,ji=new WeakMap,kn=new WeakSet,Lw=function(e){const t=[],r=new Set;for(const a of e){const[o,l,c]=a;t.push([o,l,a],[o,c,a])}t.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=t.length;a<o;a+=2){const l=t[a][2],c=t[a+1][2];l.push(c),c.push(l),r.add(l),r.add(c)}const n=[];let s;for(;r.size>0;){const a=r.values().next().value;let[o,l,c,h,d]=a;r.delete(a);let p=o,g=l;for(s=[o,c],n.push(s);;){let y;if(r.has(h))y=h;else if(r.has(d))y=d;else break;r.delete(y),[o,l,c,h,d]=y,p!==o&&(s.push(p,g,o,g===l?l:c),p=o),g=g===l?c:l}s.push(p,g)}return new eS(n,u(this,hf),u(this,df))},Np=function(e){const t=u(this,ji);let r=0,n=t.length-1;for(;r<=n;){const s=r+n>>1,a=t[s][0];if(a===e)return s;a<e?r=s+1:n=s-1}return n+1},Ow=function([,e,t]){const r=L(this,kn,Np).call(this,e);u(this,ji).splice(r,0,[e,t])},Fw=function([,e,t]){const r=L(this,kn,Np).call(this,e);for(let n=r;n<u(this,ji).length;n++){const[s,a]=u(this,ji)[n];if(s!==e)break;if(s===e&&a===t){u(this,ji).splice(n,1);return}}for(let n=r-1;n>=0;n--){const[s,a]=u(this,ji)[n];if(s!==e)break;if(s===e&&a===t){u(this,ji).splice(n,1);return}}},W0=function(e){const[t,r,n]=e,s=[[t,r,n]],a=L(this,kn,Np).call(this,n);for(let o=0;o<a;o++){const[l,c]=u(this,ji)[o];for(let h=0,d=s.length;h<d;h++){const[,p,g]=s[h];if(!(c<=p||g<=l)){if(p>=l){if(g>c)s[h][1]=c;else{if(d===1)return[];s.splice(h,1),h--,d--}continue}s[h][2]=l,g>c&&s.push([t,c,g])}}}return s};var ff,uc;class eS extends qe{constructor(t,r,n){super();N(this,ff);N(this,uc);T(this,uc,t),T(this,ff,r),this.lastPoint=n}toSVGPath(){const t=[];for(const r of u(this,uc)){let[n,s]=r;t.push(`M${n} ${s}`);for(let a=2;a<r.length;a+=2){const o=r[a],l=r[a+1];o===n?(t.push(`V${l}`),s=l):l===s&&(t.push(`H${o}`),n=o)}t.push("Z")}return t.join(" ")}serialize([t,r,n,s],a){const o=[],l=n-t,c=s-r;for(const h of u(this,uc)){const d=new Array(h.length);for(let p=0;p<h.length;p+=2)d[p]=t+h[p]*l,d[p+1]=s-h[p+1]*c;o.push(d)}return o}get box(){return u(this,ff)}get classNamesForOutlining(){return["highlightOutline"]}}ff=new WeakMap,uc=new WeakMap;class X0 extends Zp{newFreeDrawOutline(e,t,r,n,s,a){return new tS(e,t,r,n,s,a)}}class tS extends Nw{newOutliner(e,t,r,n,s,a=0){return new X0(e,t,r,n,s,a)}}var Qn,wl,cc,Nr,pf,hc,ea,gf,qa,Ui,dc,mf,qt,Y0,Z0,K0,Co,Bw,ya;const Pn=class Pn{constructor({editor:e=null,uiManager:t=null}){N(this,qt);N(this,Qn,null);N(this,wl,null);N(this,cc);N(this,Nr,null);N(this,pf,!1);N(this,hc,!1);N(this,ea,null);N(this,gf);N(this,qa,null);N(this,Ui,null);N(this,dc);var r,n;e?(T(this,hc,!1),T(this,dc,kt.HIGHLIGHT_COLOR),T(this,ea,e)):(T(this,hc,!0),T(this,dc,kt.HIGHLIGHT_DEFAULT_COLOR)),T(this,Ui,(e==null?void 0:e._uiManager)||t),T(this,gf,u(this,Ui)._eventBus),T(this,cc,((r=e==null?void 0:e.color)==null?void 0:r.toUpperCase())||((n=u(this,Ui))==null?void 0:n.highlightColors.values().next().value)||"#FFFF98"),u(Pn,mf)||T(Pn,mf,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return Ct(this,"_keyboardManager",new Df([[["Escape","mac+Escape"],Pn.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Pn.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Pn.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Pn.prototype._moveToPrevious],[["Home","mac+Home"],Pn.prototype._moveToBeginning],[["End","mac+End"],Pn.prototype._moveToEnd]]))}renderButton(){const e=T(this,Qn,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",u(this,ea)&&(e.ariaControls=`${u(this,ea).id}_colorpicker_dropdown`);const t=u(this,Ui)._signal;e.addEventListener("click",L(this,qt,Co).bind(this),{signal:t}),e.addEventListener("keydown",L(this,qt,K0).bind(this),{signal:t});const r=T(this,wl,document.createElement("span"));return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=u(this,cc),e.append(r),e}renderMainDropdown(){const e=T(this,Nr,L(this,qt,Y0).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===u(this,Qn)){L(this,qt,Co).call(this,e);return}const t=e.target.getAttribute("data-color");t&&L(this,qt,Z0).call(this,t,e)}_moveToNext(e){var t,r;if(!u(this,qt,ya)){L(this,qt,Co).call(this,e);return}if(e.target===u(this,Qn)){(t=u(this,Nr).firstChild)==null||t.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var t,r;if(e.target===((t=u(this,Nr))==null?void 0:t.firstChild)||e.target===u(this,Qn)){u(this,qt,ya)&&this._hideDropdownFromKeyboard();return}u(this,qt,ya)||L(this,qt,Co).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var t;if(!u(this,qt,ya)){L(this,qt,Co).call(this,e);return}(t=u(this,Nr).firstChild)==null||t.focus()}_moveToEnd(e){var t;if(!u(this,qt,ya)){L(this,qt,Co).call(this,e);return}(t=u(this,Nr).lastChild)==null||t.focus()}hideDropdown(){var e,t;(e=u(this,Nr))==null||e.classList.add("hidden"),u(this,Qn).ariaExpanded="false",(t=u(this,qa))==null||t.abort(),T(this,qa,null)}_hideDropdownFromKeyboard(){var e;if(!u(this,hc)){if(!u(this,qt,ya)){(e=u(this,ea))==null||e.unselect();return}this.hideDropdown(),u(this,Qn).focus({preventScroll:!0,focusVisible:u(this,pf)})}}updateColor(e){if(u(this,wl)&&(u(this,wl).style.backgroundColor=e),!u(this,Nr))return;const t=u(this,Ui).highlightColors.values();for(const r of u(this,Nr).children)r.ariaSelected=t.next().value===e.toUpperCase()}destroy(){var e,t;(e=u(this,Qn))==null||e.remove(),T(this,Qn,null),T(this,wl,null),(t=u(this,Nr))==null||t.remove(),T(this,Nr,null)}};Qn=new WeakMap,wl=new WeakMap,cc=new WeakMap,Nr=new WeakMap,pf=new WeakMap,hc=new WeakMap,ea=new WeakMap,gf=new WeakMap,qa=new WeakMap,Ui=new WeakMap,dc=new WeakMap,mf=new WeakMap,qt=new WeakSet,Y0=function(){const e=document.createElement("div"),t=u(this,Ui)._signal;e.addEventListener("contextmenu",Ei,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),u(this,ea)&&(e.id=`${u(this,ea).id}_colorpicker_dropdown`);for(const[r,n]of u(this,Ui).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=r,s.setAttribute("data-l10n-id",u(Pn,mf)[r]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=n,s.ariaSelected=n===u(this,cc),s.addEventListener("click",L(this,qt,Z0).bind(this,n),{signal:t}),e.append(s)}return e.addEventListener("keydown",L(this,qt,K0).bind(this),{signal:t}),e},Z0=function(e,t){t.stopPropagation(),u(this,gf).dispatch("switchannotationeditorparams",{source:this,type:u(this,dc),value:e})},K0=function(e){Pn._keyboardManager.exec(this,e)},Co=function(e){if(u(this,qt,ya)){this.hideDropdown();return}if(T(this,pf,e.detail===0),u(this,qa)||(T(this,qa,new AbortController),window.addEventListener("pointerdown",L(this,qt,Bw).bind(this),{signal:u(this,Ui).combinedSignal(u(this,qa))})),u(this,Qn).ariaExpanded="true",u(this,Nr)){u(this,Nr).classList.remove("hidden");return}const t=T(this,Nr,L(this,qt,Y0).call(this));u(this,Qn).append(t)},Bw=function(e){var t;(t=u(this,Nr))!=null&&t.contains(e.target)||this.hideDropdown()},ya=function(){return u(this,Nr)&&!u(this,Nr).classList.contains("hidden")},N(Pn,mf,null);let Oh=Pn;var fc,bf,ta,xl,vf,Nn,yf,wf,Al,gi,Jn,Qr,pc,ra,hn,gc,mi,xf,ft,Q0,Mp,zw,jw,Uw,J0,So,wi,uu,Hw,Lp,wh,$w,Vw,Gw,qw,Ww;const Bt=class Bt extends tr{constructor(t){super({...t,name:"highlightEditor"});N(this,ft);N(this,fc,null);N(this,bf,0);N(this,ta);N(this,xl,null);N(this,vf,null);N(this,Nn,null);N(this,yf,null);N(this,wf,0);N(this,Al,null);N(this,gi,null);N(this,Jn,null);N(this,Qr,!1);N(this,pc,null);N(this,ra);N(this,hn,null);N(this,gc,"");N(this,mi);N(this,xf,"");this.color=t.color||Bt._defaultColor,T(this,mi,t.thickness||Bt._defaultThickness),T(this,ra,t.opacity||Bt._defaultOpacity),T(this,ta,t.boxes||null),T(this,xf,t.methodOfCreation||""),T(this,gc,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(T(this,Qr,!0),L(this,ft,Mp).call(this,t),L(this,ft,So).call(this)):u(this,ta)&&(T(this,fc,t.anchorNode),T(this,bf,t.anchorOffset),T(this,yf,t.focusNode),T(this,wf,t.focusOffset),L(this,ft,Q0).call(this),L(this,ft,So).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const t=Bt.prototype;return Ct(this,"_keyboardManager",new Df([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:u(this,Qr)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:u(this,mi),methodOfCreation:u(this,xf)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,r){var n;tr.initialize(t,r),Bt._defaultColor||(Bt._defaultColor=((n=r.highlightColors)==null?void 0:n.values().next().value)||"#fff066")}static updateDefaultParams(t,r){switch(t){case kt.HIGHLIGHT_DEFAULT_COLOR:Bt._defaultColor=r;break;case kt.HIGHLIGHT_THICKNESS:Bt._defaultThickness=r;break}}translateInPage(t,r){}get toolbarPosition(){return u(this,pc)}updateParams(t,r){switch(t){case kt.HIGHLIGHT_COLOR:L(this,ft,zw).call(this,r);break;case kt.HIGHLIGHT_THICKNESS:L(this,ft,jw).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[kt.HIGHLIGHT_DEFAULT_COLOR,Bt._defaultColor],[kt.HIGHLIGHT_THICKNESS,Bt._defaultThickness]]}get propertiesToUpdate(){return[[kt.HIGHLIGHT_COLOR,this.color||Bt._defaultColor],[kt.HIGHLIGHT_THICKNESS,u(this,mi)||Bt._defaultThickness],[kt.HIGHLIGHT_FREE,u(this,Qr)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",T(this,vf,new Oh({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(L(this,ft,wh).call(this))}getBaseTranslation(){return[0,0]}getRect(t,r){return super.getRect(t,r,L(this,ft,wh).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){L(this,ft,J0).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(L(this,ft,So).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var n;let r=!1;this.parent&&!t?L(this,ft,J0).call(this):t&&(L(this,ft,So).call(this,t),r=!this.parent&&((n=this.div)==null?void 0:n.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),r&&this.select()}rotate(t){var s,a,o;const{drawLayer:r}=this.parent;let n;u(this,Qr)?(t=(t-this.rotation+360)%360,n=L(s=Bt,wi,uu).call(s,u(this,gi).box,t)):n=L(a=Bt,wi,uu).call(a,[this.x,this.y,this.width,this.height],t),r.updateProperties(u(this,Jn),{bbox:n,root:{"data-main-rotation":t}}),r.updateProperties(u(this,hn),{bbox:L(o=Bt,wi,uu).call(o,u(this,Nn).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();u(this,gc)&&(t.setAttribute("aria-label",u(this,gc)),t.setAttribute("role","mark")),u(this,Qr)?t.classList.add("free"):this.div.addEventListener("keydown",L(this,ft,Hw).bind(this),{signal:this._uiManager._signal});const r=T(this,Al,document.createElement("div"));t.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=u(this,xl);const[n,s]=this.parentDimensions;return this.setDims(this.width*n,this.height*s),f1(this,u(this,Al),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{hovered:!0}})}pointerleave(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:L(this,ft,Lp).call(this,!0);break;case 1:case 3:L(this,ft,Lp).call(this,!1);break}}select(){var t;super.select(),u(this,hn)&&((t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),u(this,hn)&&((t=this.parent)==null||t.drawLayer.updateProperties(u(this,hn),{rootClass:{selected:!1}}),u(this,Qr)||L(this,ft,Lp).call(this,!1))}get _mustFixPosition(){return!u(this,Qr)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(u(this,Jn),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(u(this,hn),{rootClass:{hidden:!t}}))}static startHighlighting(t,r,{target:n,x:s,y:a}){const{x:o,y:l,width:c,height:h}=n.getBoundingClientRect(),d=new AbortController,p=t.combinedSignal(d),g=y=>{d.abort(),L(this,wi,qw).call(this,t,y)};window.addEventListener("blur",g,{signal:p}),window.addEventListener("pointerup",g,{signal:p}),window.addEventListener("pointerdown",_r,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",Ei,{signal:p}),n.addEventListener("pointermove",L(this,wi,Gw).bind(this,t),{signal:p}),this._freeHighlight=new X0({x:s,y:a},[o,l,c,h],t.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(t,r,n){var b,w,v,A;let s=null;if(t instanceof ww){const{data:{quadPoints:E,rect:_,rotation:C,id:I,color:k,opacity:D,popupRef:R},parent:{page:{pageNumber:z}}}=t;s=t={annotationType:ot.HIGHLIGHT,color:Array.from(k),opacity:D,quadPoints:E,boxes:null,pageIndex:z-1,rect:_.slice(0),rotation:C,annotationElementId:I,id:I,deleted:!1,popupRef:R}}else if(t instanceof Hb){const{data:{inkLists:E,rect:_,rotation:C,id:I,color:k,borderStyle:{rawWidth:D},popupRef:R},parent:{page:{pageNumber:z}}}=t;s=t={annotationType:ot.HIGHLIGHT,color:Array.from(k),thickness:D,inkLists:E,boxes:null,pageIndex:z-1,rect:_.slice(0),rotation:C,annotationElementId:I,id:I,deleted:!1,popupRef:R}}const{color:a,quadPoints:o,inkLists:l,opacity:c}=t,h=await super.deserialize(t,r,n);h.color=Qe.makeHexColor(...a),T(h,ra,c||1),l&&T(h,mi,t.thickness),h._initialData=s;const[d,p]=h.pageDimensions,[g,y]=h.pageTranslation;if(o){const E=T(h,ta,[]);for(let _=0;_<o.length;_+=8)E.push({x:(o[_]-g)/d,y:1-(o[_+1]-y)/p,width:(o[_+2]-o[_])/d,height:(o[_+1]-o[_+5])/p});L(b=h,ft,Q0).call(b),L(w=h,ft,So).call(w),h.rotate(h.rotation)}else if(l){T(h,Qr,!0);const E=l[0],_={x:E[0]-g,y:p-(E[1]-y)},C=new X0(_,[0,0,d,p],1,u(h,mi)/2,!0,.001);for(let D=0,R=E.length;D<R;D+=2)_.x=E[D]-g,_.y=p-(E[D+1]-y),C.add(_);const{id:I,clipPathId:k}=r.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:h.color,"fill-opacity":h._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:C.toSVGPath()}},!0,!0);L(v=h,ft,Mp).call(v,{highlightOutlines:C.getOutlines(),highlightId:I,clipPathId:k}),L(A=h,ft,So).call(A),h.rotate(h.parentRotation)}return h}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const r=this.getRect(0,0),n=tr._colorManager.convert(this.color),s={annotationType:ot.HIGHLIGHT,color:n,opacity:u(this,ra),thickness:u(this,mi),quadPoints:L(this,ft,$w).call(this),outlines:L(this,ft,Vw).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:L(this,ft,wh).call(this),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!L(this,ft,Ww).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};fc=new WeakMap,bf=new WeakMap,ta=new WeakMap,xl=new WeakMap,vf=new WeakMap,Nn=new WeakMap,yf=new WeakMap,wf=new WeakMap,Al=new WeakMap,gi=new WeakMap,Jn=new WeakMap,Qr=new WeakMap,pc=new WeakMap,ra=new WeakMap,hn=new WeakMap,gc=new WeakMap,mi=new WeakMap,xf=new WeakMap,ft=new WeakSet,Q0=function(){const t=new q0(u(this,ta),.001);T(this,gi,t.getOutlines()),[this.x,this.y,this.width,this.height]=u(this,gi).box;const r=new q0(u(this,ta),.0025,.001,this._uiManager.direction==="ltr");T(this,Nn,r.getOutlines());const{lastPoint:n}=u(this,Nn);T(this,pc,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])},Mp=function({highlightOutlines:t,highlightId:r,clipPathId:n}){var d,p;if(T(this,gi,t),T(this,Nn,t.getNewOutline(u(this,mi)/2+1.5,.0025)),r>=0)T(this,Jn,r),T(this,xl,n),this.parent.drawLayer.finalizeDraw(r,{bbox:t.box,path:{d:t.toSVGPath()}}),T(this,hn,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:u(this,Nn).box,path:{d:u(this,Nn).toSVGPath()}},!0));else if(this.parent){const g=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(u(this,Jn),{bbox:L(d=Bt,wi,uu).call(d,u(this,gi).box,(g-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(u(this,hn),{bbox:L(p=Bt,wi,uu).call(p,u(this,Nn).box,g),path:{d:u(this,Nn).toSVGPath()}})}const[a,o,l,c]=t.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[g,y]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*y/g,this.height=c*g/y;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[g,y]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*y/g,this.height=c*g/y;break}}const{lastPoint:h}=u(this,Nn);T(this,pc,[(h[0]-a)/l,(h[1]-o)/c])},zw=function(t){const r=(a,o)=>{var l,c;this.color=a,T(this,ra,o),(l=this.parent)==null||l.drawLayer.updateProperties(u(this,Jn),{root:{fill:a,"fill-opacity":o}}),(c=u(this,vf))==null||c.updateColor(a)},n=this.color,s=u(this,ra);this.addCommands({cmd:r.bind(this,t,Bt._defaultOpacity),undo:r.bind(this,n,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},jw=function(t){const r=u(this,mi),n=s=>{T(this,mi,s),L(this,ft,Uw).call(this,s)};this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Uw=function(t){if(!u(this,Qr))return;L(this,ft,Mp).call(this,{highlightOutlines:u(this,gi).getNewOutline(t/2)}),this.fixAndSetPosition();const[r,n]=this.parentDimensions;this.setDims(this.width*r,this.height*n)},J0=function(){u(this,Jn)===null||!this.parent||(this.parent.drawLayer.remove(u(this,Jn)),T(this,Jn,null),this.parent.drawLayer.remove(u(this,hn)),T(this,hn,null))},So=function(t=this.parent){u(this,Jn)===null&&({id:bn(this,Jn)._,clipPathId:bn(this,xl)._}=t.drawLayer.draw({bbox:u(this,gi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":u(this,ra)},rootClass:{highlight:!0,free:u(this,Qr)},path:{d:u(this,gi).toSVGPath()}},!1,!0),T(this,hn,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:u(this,Qr)},bbox:u(this,Nn).box,path:{d:u(this,Nn).toSVGPath()}},u(this,Qr))),u(this,Al)&&(u(this,Al).style.clipPath=u(this,xl)))},wi=new WeakSet,uu=function([t,r,n,s],a){switch(a){case 90:return[1-r-s,t,s,n];case 180:return[1-t-n,1-r-s,n,s];case 270:return[r,1-t-n,s,n]}return[t,r,n,s]},Hw=function(t){Bt._keyboardManager.exec(this,t)},Lp=function(t){if(!u(this,fc))return;const r=window.getSelection();t?r.setPosition(u(this,fc),u(this,bf)):r.setPosition(u(this,yf),u(this,wf))},wh=function(){return u(this,Qr)?this.rotation:0},$w=function(){if(u(this,Qr))return null;const[t,r]=this.pageDimensions,[n,s]=this.pageTranslation,a=u(this,ta),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:h,width:d,height:p}of a){const g=c*t+n,y=(1-h)*r+s;o[l]=o[l+4]=g,o[l+1]=o[l+3]=y,o[l+2]=o[l+6]=g+d*t,o[l+5]=o[l+7]=y-p*r,l+=8}return o},Vw=function(t){return u(this,gi).serialize(t,L(this,ft,wh).call(this))},Gw=function(t,r){this._freeHighlight.add(r)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},qw=function(t,r){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},Ww=function(t){const{color:r}=this._initialData;return t.color.some((n,s)=>n!==r[s])},N(Bt,wi),Ie(Bt,"_defaultColor",null),Ie(Bt,"_defaultOpacity",1),Ie(Bt,"_defaultThickness",12),Ie(Bt,"_type","highlight"),Ie(Bt,"_editorType",ot.HIGHLIGHT),Ie(Bt,"_freeHighlightId",-1),Ie(Bt,"_freeHighlight",null),Ie(Bt,"_freeHighlightClipId","");let Kp=Bt;var El;class Xw{constructor(){N(this,El,Object.create(null))}updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,r]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,r)}updateSVGProperty(e,t){u(this,El)[e]=t}toSVGProperties(){const e=u(this,El);return T(this,El,Object.create(null)),{root:e}}reset(){T(this,El,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Wt("Not implemented")}}El=new WeakMap;var ei,mc,Ur,_l,Cl,Wa,Xa,Ya,Sl,Lt,eb,tb,rb,xh,Yw,Op,Ah,cu;const We=class We extends tr{constructor(t){super(t);N(this,Lt);N(this,ei,null);N(this,mc);Ie(this,"_drawId",null);T(this,mc,t.mustBeCommitted||!1),this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(L(this,Lt,eb).call(this,t),L(this,Lt,xh).call(this))}static _mergeSVGProperties(t,r){const n=new Set(Object.keys(t));for(const[s,a]of Object.entries(r))n.has(s)?Object.assign(t[s],a):t[s]=a;return t}static getDefaultDrawingOptions(t){Wt("Not implemented")}static get typesMap(){Wt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,r){const n=this.typesMap.get(t);n&&this._defaultDrawingOptions.updateProperty(n,r),this._currentParent&&(u(We,Ur).updateProperty(n,r),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,r){const n=this.constructor.typesMap.get(t);n&&this._updateProperty(t,n,r)}static get defaultPropertiesToUpdate(){const t=[],r=this._defaultDrawingOptions;for(const[n,s]of this.typesMap)t.push([n,r[s]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:r}=this;for(const[n,s]of this.constructor.typesMap)t.push([n,r[s]]);return t}_updateProperty(t,r,n){const s=this._drawingOptions,a=s[r],o=l=>{var h;s.updateProperty(r,l);const c=u(this,ei).updateProperty(r,l);c&&L(this,Lt,Ah).call(this,c),(h=this.parent)==null||h.drawLayer.updateProperties(this._drawId,s.toSVGProperties())};this.addCommands({cmd:o.bind(this,n),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties(u(this,ei).getPathResizingSVGProperties(L(this,Lt,Op).call(this)),{bbox:L(this,Lt,cu).call(this)}))}_onResized(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties(u(this,ei).getPathResizedSVGProperties(L(this,Lt,Op).call(this)),{bbox:L(this,Lt,cu).call(this)}))}_onTranslating(t,r){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,{bbox:L(this,Lt,cu).call(this)})}_onTranslated(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties(u(this,ei).getPathTranslatedSVGProperties(L(this,Lt,Op).call(this),this.parentDimensions),{bbox:L(this,Lt,cu).call(this)}))}_onStartDragging(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,u(this,mc)&&(T(this,mc,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){L(this,Lt,rb).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(L(this,Lt,xh).call(this),L(this,Lt,Ah).call(this,u(this,ei).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var n;let r=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),L(this,Lt,rb).call(this)):t&&(this._uiManager.addShouldRescale(this),L(this,Lt,xh).call(this,t),r=!this.parent&&((n=this.div)==null?void 0:n.classList.contains("selectedEditor"))),super.setParent(t),r&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,We._mergeSVGProperties({bbox:L(this,Lt,cu).call(this)},u(this,ei).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&L(this,Lt,Ah).call(this,u(this,ei).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,r;this._isCopy&&(t=this.x,r=this.y);const n=super.render();n.classList.add("draw");const s=document.createElement("div");n.append(s),s.setAttribute("aria-hidden","true"),s.className="internal";const[a,o]=this.parentDimensions;return this.setDims(this.width*a,this.height*o),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,r),n}static createDrawerInstance(t,r,n,s,a){Wt("Not implemented")}static startDrawing(t,r,n,s){var w;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:h}=s;if(u(We,Xa)&&u(We,Xa)!==h)return;const{viewport:{rotation:d}}=t,{width:p,height:g}=a.getBoundingClientRect(),y=T(We,_l,new AbortController),b=t.combinedSignal(y);if(u(We,Wa)||T(We,Wa,c),u(We,Xa)??T(We,Xa,h),window.addEventListener("pointerup",v=>{var A;u(We,Wa)===v.pointerId?this._endDraw(v):(A=u(We,Ya))==null||A.delete(v.pointerId)},{signal:b}),window.addEventListener("pointercancel",v=>{var A;u(We,Wa)===v.pointerId?this._currentParent.endDrawingSession():(A=u(We,Ya))==null||A.delete(v.pointerId)},{signal:b}),window.addEventListener("pointerdown",v=>{u(We,Xa)===v.pointerType&&((u(We,Ya)||T(We,Ya,new Set)).add(v.pointerId),u(We,Ur).isCancellable()&&(u(We,Ur).removeLastElement(),u(We,Ur).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:b}),window.addEventListener("contextmenu",Ei,{signal:b}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:b}),a.addEventListener("touchmove",v=>{v.timeStamp===u(We,Sl)&&_r(v)},{signal:b}),t.toggleDrawing(),(w=r._editorUndoBar)==null||w.hide(),u(We,Ur)){t.drawLayer.updateProperties(this._currentDrawId,u(We,Ur).startNew(o,l,p,g,d));return}r.updateUIForDefaultProperties(this),T(We,Ur,this.createDrawerInstance(o,l,p,g,d)),T(We,Cl,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(u(We,Cl).toSVGProperties(),u(We,Ur).defaultSVGProperties),!0,!1)}static _drawMove(t){var a;if(T(We,Sl,-1),!u(We,Ur))return;const{offsetX:r,offsetY:n,pointerId:s}=t;if(u(We,Wa)===s){if(((a=u(We,Ya))==null?void 0:a.size)>=1){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,u(We,Ur).add(r,n)),T(We,Sl,t.timeStamp),_r(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,T(We,Ur,null),T(We,Cl,null),T(We,Xa,null),T(We,Sl,NaN)),u(We,_l)&&(u(We,_l).abort(),T(We,_l,null),T(We,Wa,NaN),T(We,Ya,null))}static _endDraw(t){const r=this._currentParent;if(r){if(r.toggleDrawing(!0),this._cleanup(!1),(t==null?void 0:t.target)===r.div&&r.drawLayer.updateProperties(this._currentDrawId,u(We,Ur).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const n=u(We,Ur),s=this._currentDrawId,a=n.getLastElement();r.addCommands({cmd:()=>{r.drawLayer.updateProperties(s,n.setLastElement(a))},undo:()=>{r.drawLayer.updateProperties(s,n.removeLastElement())},mustExec:!1,type:kt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const r=this._currentParent;if(!r)return null;if(r.toggleDrawing(!0),r.cleanUndoStack(kt.DRAW_STEP),!u(We,Ur).isEmpty()){const{pageDimensions:[n,s],scale:a}=r,o=r.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:u(We,Ur).getOutlines(n*a,s*a,a,this._INNER_MARGIN),drawingOptions:u(We,Cl),mustBeCommitted:!t});return this._cleanup(!0),o}return r.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,r,n,s,a,o){Wt("Not implemented")}static async deserialize(t,r,n){var d,p;const{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}=r.viewport,c=this.deserializeDraw(o,l,s,a,this._INNER_MARGIN,t),h=await super.deserialize(t,r,n);return h.createDrawingOptions(t),L(d=h,Lt,eb).call(d,{drawOutlines:c}),L(p=h,Lt,xh).call(p),h.onScaleChanging(),h.rotate(),h}serializeDraw(t){const[r,n]=this.pageTranslation,[s,a]=this.pageDimensions;return u(this,ei).serialize([r,n,s,a],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};ei=new WeakMap,mc=new WeakMap,Ur=new WeakMap,_l=new WeakMap,Cl=new WeakMap,Wa=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,Sl=new WeakMap,Lt=new WeakSet,eb=function({drawOutlines:t,drawId:r,drawingOptions:n}){T(this,ei,t),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),r>=0?(this._drawId=r,this.parent.drawLayer.finalizeDraw(r,t.defaultProperties)):this._drawId=L(this,Lt,tb).call(this,t,this.parent),L(this,Lt,Ah).call(this,t.box)},tb=function(t,r){const{id:n}=r.drawLayer.draw(We._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return n},rb=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},xh=function(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=L(this,Lt,tb).call(this,u(this,ei),t)}},Yw=function([t,r,n,s]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[r,1-t,n*(o/a),s*(a/o)];case 180:return[1-t,1-r,n,s];case 270:return[1-r,t,n*(o/a),s*(a/o)];default:return[t,r,n,s]}},Op=function(){const{x:t,y:r,width:n,height:s,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-r,t,n*(a/o),s*(o/a)];case 180:return[1-t,1-r,n,s];case 270:return[r,1-t,n*(a/o),s*(o/a)];default:return[t,r,n,s]}},Ah=function(t){if([this.x,this.y,this.width,this.height]=L(this,Lt,Yw).call(this,t),this.div){this.fixAndSetPosition();const[r,n]=this.parentDimensions;this.setDims(this.width*r,this.height*n)}this._onResized()},cu=function(){const{x:t,y:r,width:n,height:s,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*4+o)/90){case 1:return[1-r-s,t,s,n];case 2:return[1-t-n,1-r-s,n,s];case 3:return[r,1-t-n,s,n];case 4:return[t,r-n*(l/c),s*(c/l),n*(l/c)];case 5:return[1-r,t,n*(l/c),s*(c/l)];case 6:return[1-t-s*(c/l),1-r,s*(c/l),n*(l/c)];case 7:return[r-n*(l/c),1-t-s*(c/l),n*(l/c),s*(c/l)];case 8:return[t-n,r-s,n,s];case 9:return[1-r,t-n,s,n];case 10:return[1-t,1-r,n,s];case 11:return[r-s,1-t,s,n];case 12:return[t-s*(c/l),r,s*(c/l),n*(l/c)];case 13:return[1-r-n*(l/c),t-s*(c/l),n*(l/c),s*(c/l)];case 14:return[1-t,1-r-n*(l/c),s*(c/l),n*(l/c)];case 15:return[r,1-t,n*(l/c),s*(c/l)];default:return[t,r,n,s]}},Ie(We,"_currentDrawId",-1),Ie(We,"_currentParent",null),N(We,Ur,null),N(We,_l,null),N(We,Cl,null),N(We,Wa,NaN),N(We,Xa,null),N(We,Ya,null),N(We,Sl,NaN),Ie(We,"_INNER_MARGIN",3);let Qp=We;var ds,Hr,$r,Tl,bc,xn,Jr,bi,kl,Dl,Pl,vc,Fp;class rS{constructor(e,t,r,n,s,a){N(this,vc);N(this,ds,new Float64Array(6));N(this,Hr);N(this,$r);N(this,Tl);N(this,bc);N(this,xn);N(this,Jr,"");N(this,bi,0);N(this,kl,new Rf);N(this,Dl);N(this,Pl);T(this,Dl,r),T(this,Pl,n),T(this,Tl,s),T(this,bc,a),[e,t]=L(this,vc,Fp).call(this,e,t);const o=T(this,Hr,[NaN,NaN,NaN,NaN,e,t]);T(this,xn,[e,t]),T(this,$r,[{line:o,points:u(this,xn)}]),u(this,ds).set(o,0)}updateProperty(e,t){e==="stroke-width"&&T(this,bc,t)}isEmpty(){return!u(this,$r)||u(this,$r).length===0}isCancellable(){return u(this,xn).length<=10}add(e,t){[e,t]=L(this,vc,Fp).call(this,e,t);const[r,n,s,a]=u(this,ds).subarray(2,6),o=e-s,l=t-a;return Math.hypot(u(this,Dl)*o,u(this,Pl)*l)<=2?null:(u(this,xn).push(e,t),isNaN(r)?(u(this,ds).set([s,a,e,t],2),u(this,Hr).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(u(this,ds)[0])&&u(this,Hr).splice(6,6),u(this,ds).set([r,n,s,a,e,t],0),u(this,Hr).push(...qe.createBezierPoints(r,n,s,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const r=this.add(e,t);return r||(u(this,xn).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,r,n,s){T(this,Dl,r),T(this,Pl,n),T(this,Tl,s),[e,t]=L(this,vc,Fp).call(this,e,t);const a=T(this,Hr,[NaN,NaN,NaN,NaN,e,t]);T(this,xn,[e,t]);const o=u(this,$r).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),u(this,$r).push({line:a,points:u(this,xn)}),u(this,ds).set(a,0),T(this,bi,0),this.toSVGPath(),null}getLastElement(){return u(this,$r).at(-1)}setLastElement(e){return u(this,$r)?(u(this,$r).push(e),T(this,Hr,e.line),T(this,xn,e.points),T(this,bi,0),{path:{d:this.toSVGPath()}}):u(this,kl).setLastElement(e)}removeLastElement(){if(!u(this,$r))return u(this,kl).removeLastElement();u(this,$r).pop(),T(this,Jr,"");for(let e=0,t=u(this,$r).length;e<t;e++){const{line:r,points:n}=u(this,$r)[e];T(this,Hr,r),T(this,xn,n),T(this,bi,0),this.toSVGPath()}return{path:{d:u(this,Jr)}}}toSVGPath(){const e=qe.svgRound(u(this,Hr)[4]),t=qe.svgRound(u(this,Hr)[5]);if(u(this,xn).length===2)return T(this,Jr,`${u(this,Jr)} M ${e} ${t} Z`),u(this,Jr);if(u(this,xn).length<=6){const n=u(this,Jr).lastIndexOf("M");T(this,Jr,`${u(this,Jr).slice(0,n)} M ${e} ${t}`),T(this,bi,6)}if(u(this,xn).length===4){const n=qe.svgRound(u(this,Hr)[10]),s=qe.svgRound(u(this,Hr)[11]);return T(this,Jr,`${u(this,Jr)} L ${n} ${s}`),T(this,bi,12),u(this,Jr)}const r=[];u(this,bi)===0&&(r.push(`M ${e} ${t}`),T(this,bi,6));for(let n=u(this,bi),s=u(this,Hr).length;n<s;n+=6){const[a,o,l,c,h,d]=u(this,Hr).slice(n,n+6).map(qe.svgRound);r.push(`C${a} ${o} ${l} ${c} ${h} ${d}`)}return T(this,Jr,u(this,Jr)+r.join(" ")),T(this,bi,u(this,Hr).length),u(this,Jr)}getOutlines(e,t,r,n){const s=u(this,$r).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),u(this,kl).build(u(this,$r),e,t,r,u(this,Tl),u(this,bc),n),T(this,ds,null),T(this,Hr,null),T(this,$r,null),T(this,Jr,null),u(this,kl)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}ds=new WeakMap,Hr=new WeakMap,$r=new WeakMap,Tl=new WeakMap,bc=new WeakMap,xn=new WeakMap,Jr=new WeakMap,bi=new WeakMap,kl=new WeakMap,Dl=new WeakMap,Pl=new WeakMap,vc=new WeakSet,Fp=function(e,t){return qe._normalizePoint(e,t,u(this,Dl),u(this,Pl),u(this,Tl))};var An,Af,Ef,ti,fs,ps,yc,wc,Rl,rn,Ds,Zw,Kw,Qw;class Rf extends qe{constructor(){super(...arguments);N(this,rn);N(this,An);N(this,Af,0);N(this,Ef);N(this,ti);N(this,fs);N(this,ps);N(this,yc);N(this,wc);N(this,Rl)}build(t,r,n,s,a,o,l){T(this,fs,r),T(this,ps,n),T(this,yc,s),T(this,wc,a),T(this,Rl,o),T(this,Ef,l??0),T(this,ti,t),L(this,rn,Kw).call(this)}get thickness(){return u(this,Rl)}setLastElement(t){return u(this,ti).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return u(this,ti).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:r}of u(this,ti)){if(t.push(`M${qe.svgRound(r[4])} ${qe.svgRound(r[5])}`),r.length===6){t.push("Z");continue}if(r.length===12&&isNaN(r[6])){t.push(`L${qe.svgRound(r[10])} ${qe.svgRound(r[11])}`);continue}for(let n=6,s=r.length;n<s;n+=6){const[a,o,l,c,h,d]=r.subarray(n,n+6).map(qe.svgRound);t.push(`C${a} ${o} ${l} ${c} ${h} ${d}`)}}return t.join("")}serialize([t,r,n,s],a){const o=[],l=[],[c,h,d,p]=L(this,rn,Zw).call(this);let g,y,b,w,v,A,E,_,C;switch(u(this,wc)){case 0:C=qe._rescale,g=t,y=r+s,b=n,w=-s,v=t+c*n,A=r+(1-h-p)*s,E=t+(c+d)*n,_=r+(1-h)*s;break;case 90:C=qe._rescaleAndSwap,g=t,y=r,b=n,w=s,v=t+h*n,A=r+c*s,E=t+(h+p)*n,_=r+(c+d)*s;break;case 180:C=qe._rescale,g=t+n,y=r,b=-n,w=s,v=t+(1-c-d)*n,A=r+h*s,E=t+(1-c)*n,_=r+(h+p)*s;break;case 270:C=qe._rescaleAndSwap,g=t+n,y=r+s,b=-n,w=-s,v=t+(1-h-p)*n,A=r+(1-c-d)*s,E=t+(1-h)*n,_=r+(1-c)*s;break}for(const{line:I,points:k}of u(this,ti))o.push(C(I,g,y,b,w,a?new Array(I.length):null)),l.push(C(k,g,y,b,w,a?new Array(k.length):null));return{lines:o,points:l,rect:[v,A,E,_]}}static deserialize(t,r,n,s,a,{paths:{lines:o,points:l},rotation:c,thickness:h}){const d=[];let p,g,y,b,w;switch(c){case 0:w=qe._rescale,p=-t/n,g=r/s+1,y=1/n,b=-1/s;break;case 90:w=qe._rescaleAndSwap,p=-r/s,g=-t/n,y=1/s,b=1/n;break;case 180:w=qe._rescale,p=t/n+1,g=-r/s,y=-1/n,b=1/s;break;case 270:w=qe._rescaleAndSwap,p=r/s+1,g=t/n+1,y=-1/s,b=-1/n;break}if(!o){o=[];for(const A of l){const E=A.length;if(E===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,A[0],A[1]]));continue}if(E===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,A[0],A[1],NaN,NaN,NaN,NaN,A[2],A[3]]));continue}const _=new Float32Array(3*(E-2));o.push(_);let[C,I,k,D]=A.subarray(0,4);_.set([NaN,NaN,NaN,NaN,C,I],0);for(let R=4;R<E;R+=2){const z=A[R],G=A[R+1];_.set(qe.createBezierPoints(C,I,k,D,z,G),(R-2)*3),[C,I,k,D]=[k,D,z,G]}}}for(let A=0,E=o.length;A<E;A++)d.push({line:w(o[A].map(_=>_??NaN),p,g,y,b),points:w(l[A].map(_=>_??NaN),p,g,y,b)});const v=new this.prototype.constructor;return v.build(d,n,s,1,c,h,a),v}get box(){return u(this,An)}updateProperty(t,r){return t==="stroke-width"?L(this,rn,Qw).call(this,r):null}updateParentDimensions([t,r],n){const[s,a]=L(this,rn,Ds).call(this);T(this,fs,t),T(this,ps,r),T(this,yc,n);const[o,l]=L(this,rn,Ds).call(this),c=o-s,h=l-a,d=u(this,An);return d[0]-=c,d[1]-=h,d[2]+=2*c,d[3]+=2*h,d}updateRotation(t){return T(this,Af,t),{path:{transform:this.rotationTransform}}}get viewBox(){return u(this,An).map(qe.svgRound).join(" ")}get defaultProperties(){const[t,r]=u(this,An);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`}}}get rotationTransform(){const[,,t,r]=u(this,An);let n=0,s=0,a=0,o=0,l=0,c=0;switch(u(this,Af)){case 90:s=r/t,a=-t/r,l=t;break;case 180:n=-1,o=-1,l=t,c=r;break;case 270:s=-r/t,a=t/r,c=r;break;default:return""}return`matrix(${n} ${s} ${a} ${o} ${qe.svgRound(l)} ${qe.svgRound(c)})`}getPathResizingSVGProperties([t,r,n,s]){const[a,o]=L(this,rn,Ds).call(this),[l,c,h,d]=u(this,An);if(Math.abs(h-a)<=qe.PRECISION||Math.abs(d-o)<=qe.PRECISION){const w=t+n/2-(l+h/2),v=r+s/2-(c+d/2);return{path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`,transform:`${this.rotationTransform} translate(${w} ${v})`}}}const p=(n-2*a)/(h-2*a),g=(s-2*o)/(d-2*o),y=h/n,b=d/s;return{path:{"transform-origin":`${qe.svgRound(l)} ${qe.svgRound(c)}`,transform:`${this.rotationTransform} scale(${y} ${b}) translate(${qe.svgRound(a)} ${qe.svgRound(o)}) scale(${p} ${g}) translate(${qe.svgRound(-a)} ${qe.svgRound(-o)})`}}}getPathResizedSVGProperties([t,r,n,s]){const[a,o]=L(this,rn,Ds).call(this),l=u(this,An),[c,h,d,p]=l;if(l[0]=t,l[1]=r,l[2]=n,l[3]=s,Math.abs(d-a)<=qe.PRECISION||Math.abs(p-o)<=qe.PRECISION){const v=t+n/2-(c+d/2),A=r+s/2-(h+p/2);for(const{line:E,points:_}of u(this,ti))qe._translate(E,v,A,E),qe._translate(_,v,A,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const g=(n-2*a)/(d-2*a),y=(s-2*o)/(p-2*o),b=-g*(c+a)+t+a,w=-y*(h+o)+r+o;if(g!==1||y!==1||b!==0||w!==0)for(const{line:v,points:A}of u(this,ti))qe._rescale(v,b,w,g,y,v),qe._rescale(A,b,w,g,y,A);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,r],n){const[s,a]=n,o=u(this,An),l=t-o[0],c=r-o[1];if(u(this,fs)===s&&u(this,ps)===a)for(const{line:h,points:d}of u(this,ti))qe._translate(h,l,c,h),qe._translate(d,l,c,d);else{const h=u(this,fs)/s,d=u(this,ps)/a;T(this,fs,s),T(this,ps,a);for(const{line:p,points:g}of u(this,ti))qe._rescale(p,l,c,h,d,p),qe._rescale(g,l,c,h,d,g);o[2]*=h,o[3]*=d}return o[0]=t,o[1]=r,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${qe.svgRound(t)} ${qe.svgRound(r)}`}}}get defaultSVGProperties(){const t=u(this,An);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${qe.svgRound(t[0])} ${qe.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}An=new WeakMap,Af=new WeakMap,Ef=new WeakMap,ti=new WeakMap,fs=new WeakMap,ps=new WeakMap,yc=new WeakMap,wc=new WeakMap,Rl=new WeakMap,rn=new WeakSet,Ds=function(t=u(this,Rl)){const r=u(this,Ef)+t/2*u(this,yc);return u(this,wc)%180===0?[r/u(this,fs),r/u(this,ps)]:[r/u(this,ps),r/u(this,fs)]},Zw=function(){const[t,r,n,s]=u(this,An),[a,o]=L(this,rn,Ds).call(this,0);return[t+a,r+o,n-2*a,s-2*o]},Kw=function(){const t=T(this,An,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:s}of u(this,ti)){if(s.length<=12){for(let l=4,c=s.length;l<c;l+=6)Qe.pointBoundingBox(s[l],s[l+1],t);continue}let a=s[4],o=s[5];for(let l=6,c=s.length;l<c;l+=6){const[h,d,p,g,y,b]=s.subarray(l,l+6);Qe.bezierBoundingBox(a,o,h,d,p,g,y,b,t),a=y,o=b}}const[r,n]=L(this,rn,Ds).call(this);t[0]=dn(t[0]-r,0,1),t[1]=dn(t[1]-n,0,1),t[2]=dn(t[2]+r,0,1),t[3]=dn(t[3]+n,0,1),t[2]-=t[0],t[3]-=t[1]},Qw=function(t){const[r,n]=L(this,rn,Ds).call(this);T(this,Rl,t);const[s,a]=L(this,rn,Ds).call(this),[o,l]=[s-r,a-n],c=u(this,An);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class Rg extends Xw{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:tr._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??(t=this["stroke-width"]),t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){const e=new Rg(this._viewParameters);return e.updateAll(this),e}}var Ag,Jw;const gu=class gu extends Qp{constructor(t){super({...t,name:"inkEditor"});N(this,Ag);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,r){tr.initialize(t,r),this._defaultDrawingOptions=new Rg(r.viewParameters)}static getDefaultDrawingOptions(t){const r=this._defaultDrawingOptions.clone();return r.updateProperties(t),r}static get supportMultipleDrawings(){return!0}static get typesMap(){return Ct(this,"typesMap",new Map([[kt.INK_THICKNESS,"stroke-width"],[kt.INK_COLOR,"stroke"],[kt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,r,n,s,a){return new rS(t,r,n,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,r,n,s,a,o){return Rf.deserialize(t,r,n,s,a,o)}static async deserialize(t,r,n){let s=null;if(t instanceof Hb){const{data:{inkLists:o,rect:l,rotation:c,id:h,color:d,opacity:p,borderStyle:{rawWidth:g},popupRef:y},parent:{page:{pageNumber:b}}}=t;s=t={annotationType:ot.INK,color:Array.from(d),thickness:g,opacity:p,paths:{points:o},boxes:null,pageIndex:b-1,rect:l.slice(0),rotation:c,annotationElementId:h,id:h,deleted:!1,popupRef:y}}const a=await super.deserialize(t,r,n);return a._initialData=s,a}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:r,parent:n}=this;r.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(t,r.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:r,opacity:n}){this._drawingOptions=gu.getDefaultDrawingOptions({stroke:Qe.makeHexColor(...t),"stroke-width":r,"stroke-opacity":n})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:r,points:n,rect:s}=this.serializeDraw(t),{_drawingOptions:{stroke:a,"stroke-opacity":o,"stroke-width":l}}=this,c={annotationType:ot.INK,color:tr._colorManager.convert(a),opacity:o,thickness:l,paths:{lines:r,points:n},pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(c.isCopy=!0,c):this.annotationElementId&&!L(this,Ag,Jw).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(t){const{points:r,rect:n}=this.serializeDraw(!1);return t.updateEdited({rect:n,thickness:this._drawingOptions["stroke-width"],points:r}),null}};Ag=new WeakSet,Jw=function(t){const{color:r,thickness:n,opacity:s,pageIndex:a}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||t.color.some((o,l)=>o!==r[l])||t.thickness!==n||t.opacity!==s||t.pageIndex!==a},Ie(gu,"_type","ink"),Ie(gu,"_editorType",ot.INK),Ie(gu,"_defaultDrawingOptions",null);let nb=gu;class ib extends Rf{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const ap=8,Jc=3;var Il,zt,sb,Hi,ex,tx,ab,Bp,rx,nx,ix,ob,lb,sx;class ys{static extractContoursFromText(e,{fontFamily:t,fontStyle:r,fontWeight:n},s,a,o,l){let c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const d=200,p=h.font=`${r} ${n} ${d}px ${t}`,{actualBoundingBoxLeft:g,actualBoundingBoxRight:y,actualBoundingBoxAscent:b,actualBoundingBoxDescent:w,fontBoundingBoxAscent:v,fontBoundingBoxDescent:A,width:E}=h.measureText(e),_=1.5,C=Math.ceil(Math.max(Math.abs(g)+Math.abs(y)||0,E)*_),I=Math.ceil(Math.max(Math.abs(b)+Math.abs(w)||d,Math.abs(v)+Math.abs(A)||d)*_);c=new OffscreenCanvas(C,I),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=p,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,C,I),h.fillStyle="black",h.fillText(e,C*(_-1)/2,I*(3-_)/2);const k=L(this,zt,ob).call(this,h.getImageData(0,0,C,I).data),D=L(this,zt,ix).call(this,k),R=L(this,zt,lb).call(this,D),z=L(this,zt,ab).call(this,k,C,I,R);return this.processDrawnLines({lines:{curves:z,width:C,height:I},pageWidth:s,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,t,r,n,s){const[a,o,l]=L(this,zt,sx).call(this,e),[c,h]=L(this,zt,nx).call(this,a,o,l,Math.hypot(o,l)*u(this,Il).sigmaSFactor,u(this,Il).sigmaR,u(this,Il).kernelSize),d=L(this,zt,lb).call(this,h),p=L(this,zt,ab).call(this,c,o,l,d);return this.processDrawnLines({lines:{curves:p,width:o,height:l},pageWidth:t,pageHeight:r,rotation:n,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:r,rotation:n,innerMargin:s,mustSmooth:a,areContours:o}){n%180!==0&&([t,r]=[r,t]);const{curves:l,width:c,height:h}=e,d=e.thickness??0,p=[],g=Math.min(t/c,r/h),y=g/t,b=g/r,w=[];for(const{points:A}of l){const E=a?L(this,zt,rx).call(this,A):A;if(!E)continue;w.push(E);const _=E.length,C=new Float32Array(_),I=new Float32Array(3*(_===2?2:_-2));if(p.push({line:I,points:C}),_===2){C[0]=E[0]*y,C[1]=E[1]*b,I.set([NaN,NaN,NaN,NaN,C[0],C[1]],0);continue}let[k,D,R,z]=E;k*=y,D*=b,R*=y,z*=b,C.set([k,D,R,z],0),I.set([NaN,NaN,NaN,NaN,k,D],0);for(let G=4;G<_;G+=2){const O=C[G]=E[G]*y,X=C[G+1]=E[G+1]*b;I.set(qe.createBezierPoints(k,D,R,z,O,X),(G-2)*3),[k,D,R,z]=[R,z,O,X]}}if(p.length===0)return null;const v=o?new ib:new Rf;return v.build(p,t,r,1,n,o?0:d,s),{outline:v,newCurves:w,areContours:o,thickness:d,width:c,height:h}}static async compressSignature({outlines:e,areContours:t,thickness:r,width:n,height:s}){let a=1/0,o=-1/0,l=0;for(const E of e){l+=E.length;for(let _=2,C=E.length;_<C;_++){const I=E[_]-E[_-2];a=Math.min(a,I),o=Math.max(o,I)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const h=e.length,d=ap+Jc*h,p=new Uint32Array(d);let g=0;p[g++]=d*Uint32Array.BYTES_PER_ELEMENT+(l-2*h)*c.BYTES_PER_ELEMENT,p[g++]=0,p[g++]=n,p[g++]=s,p[g++]=t?0:1,p[g++]=Math.max(0,Math.floor(r??0)),p[g++]=h,p[g++]=c.BYTES_PER_ELEMENT;for(const E of e)p[g++]=E.length-2,p[g++]=E[0],p[g++]=E[1];const y=new CompressionStream("deflate-raw"),b=y.writable.getWriter();await b.ready,b.write(p);const w=c.prototype.constructor;for(const E of e){const _=new w(E.length-2);for(let C=2,I=E.length;C<I;C++)_[C-2]=E[C]-E[C-2];b.write(_)}b.close();const v=await new Response(y.readable).arrayBuffer(),A=new Uint8Array(v);return n1(A)}static async decompressSignature(e){try{const t=I_(e),{readable:r,writable:n}=new DecompressionStream("deflate-raw"),s=n.getWriter();await s.ready,s.write(t).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(const E of r)a||(a=new Uint8Array(new Uint32Array(E.buffer,0,4)[0])),a.set(E,o),o+=E.length;const l=new Uint32Array(a.buffer,0,a.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const h=l[2],d=l[3],p=l[4]===0,g=l[5],y=l[6],b=l[7],w=[],v=(ap+Jc*y)*Uint32Array.BYTES_PER_ELEMENT;let A;switch(b){case Int8Array.BYTES_PER_ELEMENT:A=new Int8Array(a.buffer,v);break;case Int16Array.BYTES_PER_ELEMENT:A=new Int16Array(a.buffer,v);break;case Int32Array.BYTES_PER_ELEMENT:A=new Int32Array(a.buffer,v);break}o=0;for(let E=0;E<y;E++){const _=l[Jc*E+ap],C=new Float32Array(_+2);w.push(C);for(let I=0;I<Jc-1;I++)C[I]=l[Jc*E+ap+I+1];for(let I=0;I<_;I++)C[I+2]=C[I]+A[o++]}return{areContours:p,thickness:g,outlines:w,width:h,height:d}}catch(t){return ut(`decompressSignature: ${t}`),null}}}Il=new WeakMap,zt=new WeakSet,sb=function(e,t,r,n){return r-=e,n-=t,r===0?n>0?0:4:r===1?n+6:2-n},Hi=new WeakMap,ex=function(e,t,r,n,s,a,o){const l=L(this,zt,sb).call(this,r,n,s,a);for(let c=0;c<8;c++){const h=(-c+l-o+16)%8,d=u(this,Hi)[2*h],p=u(this,Hi)[2*h+1];if(e[(r+d)*t+(n+p)]!==0)return h}return-1},tx=function(e,t,r,n,s,a,o){const l=L(this,zt,sb).call(this,r,n,s,a);for(let c=0;c<8;c++){const h=(c+l+o+16)%8,d=u(this,Hi)[2*h],p=u(this,Hi)[2*h+1];if(e[(r+d)*t+(n+p)]!==0)return h}return-1},ab=function(e,t,r,n){const s=e.length,a=new Int32Array(s);for(let h=0;h<s;h++)a[h]=e[h]<=n?1:0;for(let h=1;h<r-1;h++)a[h*t]=a[h*t+t-1]=0;for(let h=0;h<t;h++)a[h]=a[t*r-1-h]=0;let o=1,l;const c=[];for(let h=1;h<r-1;h++){l=1;for(let d=1;d<t-1;d++){const p=h*t+d,g=a[p];if(g===0)continue;let y=h,b=d;if(g===1&&a[p-1]===0)o+=1,b-=1;else if(g>=1&&a[p+1]===0)o+=1,b+=1,g>1&&(l=g);else{g!==1&&(l=Math.abs(g));continue}const w=[d,h],v=b===d+1,A={isHole:v,points:w,id:o,parent:0};c.push(A);let E;for(const G of c)if(G.id===l){E=G;break}E?E.isHole?A.parent=v?E.parent:l:A.parent=v?l:E.parent:A.parent=v?l:0;const _=L(this,zt,ex).call(this,a,t,h,d,y,b,0);if(_===-1){a[p]=-o,a[p]!==1&&(l=Math.abs(a[p]));continue}let C=u(this,Hi)[2*_],I=u(this,Hi)[2*_+1];const k=h+C,D=d+I;y=k,b=D;let R=h,z=d;for(;;){const G=L(this,zt,tx).call(this,a,t,R,z,y,b,1);C=u(this,Hi)[2*G],I=u(this,Hi)[2*G+1];const O=R+C,X=z+I;w.push(X,O);const S=R*t+z;if(a[S+1]===0?a[S]=-o:a[S]===1&&(a[S]=o),O===h&&X===d&&R===k&&z===D){a[p]!==1&&(l=Math.abs(a[p]));break}else y=R,b=z,R=O,z=X}}}return c},Bp=function(e,t,r,n){if(r-t<=4){for(let k=t;k<r-2;k+=2)n.push(e[k],e[k+1]);return}const s=e[t],a=e[t+1],o=e[r-4]-s,l=e[r-3]-a,c=Math.hypot(o,l),h=o/c,d=l/c,p=h*a-d*s,g=l/o,y=1/c,b=Math.atan(g),w=Math.cos(b),v=Math.sin(b),A=y*(Math.abs(w)+Math.abs(v)),E=y*(1-A+A**2),_=Math.max(Math.atan(Math.abs(v+w)*E),Math.atan(Math.abs(v-w)*E));let C=0,I=t;for(let k=t+2;k<r-2;k+=2){const D=Math.abs(p-h*e[k+1]+d*e[k]);D>C&&(I=k,C=D)}C>(c*_)**2?(L(this,zt,Bp).call(this,e,t,I+2,n),L(this,zt,Bp).call(this,e,I,r,n)):n.push(s,a)},rx=function(e){const t=[],r=e.length;return L(this,zt,Bp).call(this,e,0,r,t),t.push(e[r-2],e[r-1]),t.length<=4?null:t},nx=function(e,t,r,n,s,a){const o=new Float32Array(a**2),l=-2*n**2,c=a>>1;for(let b=0;b<a;b++){const w=(b-c)**2;for(let v=0;v<a;v++)o[b*a+v]=Math.exp((w+(v-c)**2)/l)}const h=new Float32Array(256),d=-2*s**2;for(let b=0;b<256;b++)h[b]=Math.exp(b**2/d);const p=e.length,g=new Uint8Array(p),y=new Uint32Array(256);for(let b=0;b<r;b++)for(let w=0;w<t;w++){const v=b*t+w,A=e[v];let E=0,_=0;for(let I=0;I<a;I++){const k=b+I-c;if(!(k<0||k>=r))for(let D=0;D<a;D++){const R=w+D-c;if(R<0||R>=t)continue;const z=e[k*t+R],G=o[I*a+D]*h[Math.abs(z-A)];E+=z*G,_+=G}}const C=g[v]=Math.round(E/_);y[C]++}return[g,y]},ix=function(e){const t=new Uint32Array(256);for(const r of e)t[r]++;return t},ob=function(e){const t=e.length,r=new Uint8ClampedArray(t>>2);let n=-1/0,s=1/0;for(let o=0,l=r.length;o<l;o++){if(e[(o<<2)+3]===0){n=r[o]=255;continue}const h=r[o]=e[o<<2];h>n&&(n=h),h<s&&(s=h)}const a=255/(n-s);for(let o=0;o<t;o++)r[o]=(r[o]-s)*a;return r},lb=function(e){let t,r=-1/0,n=-1/0;const s=e.findIndex(l=>l!==0);let a=s,o=s;for(t=s;t<256;t++){const l=e[t];l>r&&(t-a>n&&(n=t-a,o=t-1),r=l,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t},sx=function(e){const t=e,{width:r,height:n}=e,{maxDim:s}=u(this,Il);let a=r,o=n;if(r>s||n>s){let p=r,g=n,y=Math.log2(Math.max(r,n)/s);const b=Math.floor(y);y=y===b?b-1:b;for(let v=0;v<y;v++){a=Math.ceil(p/2),o=Math.ceil(g/2);const A=new OffscreenCanvas(a,o);A.getContext("2d").drawImage(e,0,0,p,g,0,0,a,o),p=a,g=o,e!==t&&e.close(),e=A.transferToImageBitmap()}const w=Math.min(s/a,s/o);a=Math.round(a*w),o=Math.round(o*w)}const c=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,a,o);const h=c.getImageData(0,0,a,o).data;return[L(this,zt,ob).call(this,h),a,o]},N(ys,zt),N(ys,Il,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),N(ys,Hi,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class Vb extends Xw{constructor(){super(),super.updateProperties({fill:tr._defaultLineColor,"stroke-width":0})}clone(){const e=new Vb;return e.updateAll(this),e}}class Gb extends Rg{constructor(e){super(e),super.updateProperties({stroke:tr._defaultLineColor,"stroke-width":1})}clone(){const e=new Gb(this._viewParameters);return e.updateAll(this),e}}var Za,gs,Ka,Nl;const $n=class $n extends Qp{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});N(this,Za,!1);N(this,gs,null);N(this,Ka,null);N(this,Nl,null);this._willKeepAspectRatio=!0,T(this,Ka,t.signatureData||null),T(this,gs,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,r){tr.initialize(t,r),this._defaultDrawingOptions=new Vb,this._defaultDrawnSignatureOptions=new Gb(r.viewParameters)}static getDefaultDrawingOptions(t){const r=this._defaultDrawingOptions.clone();return r.updateProperties(t),r}static get supportMultipleDrawings(){return!1}static get typesMap(){return Ct(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!u(this,gs)}}static computeTelemetryFinalData(t){const r=t.get("hasDescription");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,r;const{_isCopy:n}=this;if(n&&(this._isCopy=!1,t=this.x,r=this.y),super.render(),this._drawId===null)if(u(this,Ka)){const{lines:s,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:h}=u(this,Ka),{rawDims:{pageWidth:d,pageHeight:p},rotation:g}=this.parent.viewport,y=ys.processDrawnLines({lines:s,pageWidth:d,pageHeight:p,rotation:g,innerMargin:$n._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(y,h,l,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);return n&&(this._isCopy=!0,this._moveAfterPaste(t,r)),this.div}setUuid(t){T(this,Nl,t),this.addEditToolbar()}getUuid(){return u(this,Nl)}get description(){return u(this,gs)}set description(t){T(this,gs,t),super.addEditToolbar().then(r=>{r==null||r.updateEditSignatureButton(t)})}getSignaturePreview(){const{newCurves:t,areContours:r,thickness:n,width:s,height:a}=u(this,Ka),o=Math.max(s,a),l=ys.processDrawnLines({lines:{curves:t.map(c=>({points:c})),thickness:n,width:s,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:r});return{areContours:r,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,r,n,s){const{x:a,y:o}=this,{outline:l}=T(this,Ka,t);T(this,Za,l instanceof ib),this.description=n,this.div.setAttribute("data-l10n-args",JSON.stringify({description:n}));let c;u(this,Za)?c=$n.getDefaultDrawingOptions():(c=$n._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[h,d]=this.parentDimensions,[,p]=this.pageDimensions;let g=r/p;g=g>=1?.5:g,this.width*=g/this.height,this.width>=1&&(g*=.9/this.width,this.width=.9),this.height=g,this.setDims(h*this.width,d*this.height),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!n}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:r,pageHeight:n},rotation:s}=this.parent.viewport;return ys.process(t,r,n,s,$n._INNER_MARGIN)}getFromText(t,r){const{rawDims:{pageWidth:n,pageHeight:s},rotation:a}=this.parent.viewport;return ys.extractContoursFromText(t,r,n,s,a,$n._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:r,pageHeight:n},rotation:s}=this.parent.viewport;return ys.processDrawnLines({lines:t,pageWidth:r,pageHeight:n,rotation:s,innerMargin:$n._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:r}){t?this._drawingOptions=$n.getDefaultDrawingOptions():(this._drawingOptions=$n._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":r}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:r,points:n,rect:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":a}}=this,o={annotationType:ot.SIGNATURE,isSignature:!0,areContours:u(this,Za),color:[0,0,0],thickness:u(this,Za)?0:a,pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(o.paths={lines:r,points:n},o.uuid=u(this,Nl),o.isCopy=!0):o.lines=r,u(this,gs)&&(o.accessibilityData={type:"Figure",alt:u(this,gs)}),o}static deserializeDraw(t,r,n,s,a,o){return o.areContours?ib.deserialize(t,r,n,s,a,o):Rf.deserialize(t,r,n,s,a,o)}static async deserialize(t,r,n){var a;const s=await super.deserialize(t,r,n);return T(s,Za,t.areContours),T(s,gs,((a=t.accessibilityData)==null?void 0:a.alt)||""),T(s,Nl,t.uuid),s}};Za=new WeakMap,gs=new WeakMap,Ka=new WeakMap,Nl=new WeakMap,Ie($n,"_type","signature"),Ie($n,"_editorType",ot.SIGNATURE),Ie($n,"_defaultDrawingOptions",null);let ub=$n;var lr,Vr,Qa,na,Ja,xc,ia,Ml,ms,ri,Ac,Ot,Eh,_h,zp,jp,Up,hb,Hp,ax;class cb extends tr{constructor(t){super({...t,name:"stampEditor"});N(this,Ot);N(this,lr,null);N(this,Vr,null);N(this,Qa,null);N(this,na,null);N(this,Ja,null);N(this,xc,"");N(this,ia,null);N(this,Ml,!1);N(this,ms,null);N(this,ri,!1);N(this,Ac,!1);T(this,na,t.bitmapUrl),T(this,Ja,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,r){tr.initialize(t,r)}static isHandlingMimeForPasting(t){return Xp.includes(t)}static paste(t,r){r.pasteEditor({mode:ot.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!((t=this.altTextData)!=null&&t.altText)}}static computeTelemetryFinalData(t){const r=t.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(t=null,r=!0){if(this.hasAltTextData())return null;const{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:a,height:o}=t||this.copyCanvas(null,null,!0).imageData,l=await n.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),r&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var t;u(this,Vr)&&(T(this,lr,null),this._uiManager.imageManager.deleteId(u(this,Vr)),(t=u(this,ia))==null||t.remove(),T(this,ia,null),u(this,ms)&&(clearTimeout(u(this,ms)),T(this,ms,null))),super.remove()}rebuild(){if(!this.parent){u(this,Vr)&&L(this,Ot,zp).call(this);return}super.rebuild(),this.div!==null&&(u(this,Vr)&&u(this,ia)===null&&L(this,Ot,zp).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(u(this,Qa)||u(this,lr)||u(this,na)||u(this,Ja)||u(this,Vr)||u(this,Ml))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,r;return this._isCopy&&(t=this.x,r=this.y),super.render(),this.div.hidden=!0,this.createAltText(),u(this,Ml)||(u(this,lr)?L(this,Ot,jp).call(this):L(this,Ot,zp).call(this)),this._isCopy&&this._moveAfterPaste(t,r),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,r){const{id:n,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,r);r.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(T(this,Vr,n),s&&T(this,lr,s),T(this,Ml,!1),L(this,Ot,jp).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;u(this,ms)!==null&&clearTimeout(u(this,ms)),T(this,ms,setTimeout(()=>{T(this,ms,null),L(this,Ot,hb).call(this)},200))}copyCanvas(t,r,n=!1){var g;t||(t=224);const{width:s,height:a}=u(this,lr),o=new Wi;let l=u(this,lr),c=s,h=a,d=null;if(r){if(s>r||a>r){const D=Math.min(r/s,r/a);c=Math.floor(s*D),h=Math.floor(a*D)}d=document.createElement("canvas");const y=d.width=Math.ceil(c*o.sx),b=d.height=Math.ceil(h*o.sy);u(this,ri)||(l=L(this,Ot,Up).call(this,y,b));const w=d.getContext("2d");w.filter=this._uiManager.hcmFilter;let v="white",A="#cfcfd8";this._uiManager.hcmFilter!=="none"?A="black":(g=window.matchMedia)!=null&&g.call(window,"(prefers-color-scheme: dark)").matches&&(v="#8f8f9d",A="#42414d");const E=15,_=E*o.sx,C=E*o.sy,I=new OffscreenCanvas(_*2,C*2),k=I.getContext("2d");k.fillStyle=v,k.fillRect(0,0,_*2,C*2),k.fillStyle=A,k.fillRect(0,0,_,C),k.fillRect(_,C,_,C),w.fillStyle=w.createPattern(I,"repeat"),w.fillRect(0,0,y,b),w.drawImage(l,0,0,l.width,l.height,0,0,y,b)}let p=null;if(n){let y,b;if(o.symmetric&&l.width<t&&l.height<t)y=l.width,b=l.height;else if(l=u(this,lr),s>t||a>t){const A=Math.min(t/s,t/a);y=Math.floor(s*A),b=Math.floor(a*A),u(this,ri)||(l=L(this,Ot,Up).call(this,y,b))}const v=new OffscreenCanvas(y,b).getContext("2d",{willReadFrequently:!0});v.drawImage(l,0,0,l.width,l.height,0,0,y,b),p={width:y,height:b,data:v.getImageData(0,0,y,b).data}}return{canvas:d,width:c,height:h,imageData:p}}static async deserialize(t,r,n){var w;let s=null,a=!1;if(t instanceof xw){const{data:{rect:v,rotation:A,id:E,structParent:_,popupRef:C},container:I,parent:{page:{pageNumber:k}},canvas:D}=t;let R,z;D?(delete t.canvas,{id:R,bitmap:z}=n.imageManager.getFromCanvas(I.id,D),D.remove()):(a=!0,t._hasNoCanvas=!0);const G=((w=await r._structTree.getAriaAttributes(`${Nb}${E}`))==null?void 0:w.get("aria-label"))||"";s=t={annotationType:ot.STAMP,bitmapId:R,bitmap:z,pageIndex:k-1,rect:v.slice(0),rotation:A,annotationElementId:E,id:E,deleted:!1,accessibilityData:{decorative:!1,altText:G},isSvg:!1,structParent:_,popupRef:C}}const o=await super.deserialize(t,r,n),{rect:l,bitmap:c,bitmapUrl:h,bitmapId:d,isSvg:p,accessibilityData:g}=t;a?(n.addMissingCanvas(t.id,o),T(o,Ml,!0)):d&&n.imageManager.isValidId(d)?(T(o,Vr,d),c&&T(o,lr,c)):T(o,na,h),T(o,ri,p);const[y,b]=o.pageDimensions;return o.width=(l[2]-l[0])/y,o.height=(l[3]-l[1])/b,g&&(o.altTextData=g),o._initialData=s,T(o,Ac,!!s),o}serialize(t=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n={annotationType:ot.STAMP,bitmapId:u(this,Vr),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:u(this,ri),structTreeParentId:this._structTreeParentId};if(t)return n.bitmapUrl=L(this,Ot,Hp).call(this,!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;const{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(n.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=L(this,Ot,ax).call(this,n);if(l.isSame)return null;l.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1}if(n.id=this.annotationElementId,r===null)return n;r.stamps||(r.stamps=new Map);const o=u(this,ri)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!r.stamps.has(u(this,Vr)))r.stamps.set(u(this,Vr),{area:o,serialized:n}),n.bitmap=L(this,Ot,Hp).call(this,!1);else if(u(this,ri)){const l=r.stamps.get(u(this,Vr));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=L(this,Ot,Hp).call(this,!1))}return n}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}lr=new WeakMap,Vr=new WeakMap,Qa=new WeakMap,na=new WeakMap,Ja=new WeakMap,xc=new WeakMap,ia=new WeakMap,Ml=new WeakMap,ms=new WeakMap,ri=new WeakMap,Ac=new WeakMap,Ot=new WeakSet,Eh=function(t,r=!1){if(!t){this.remove();return}T(this,lr,t.bitmap),r||(T(this,Vr,t.id),T(this,ri,t.isSvg)),t.file&&T(this,xc,t.file.name),L(this,Ot,jp).call(this)},_h=function(){if(T(this,Qa,null),this._uiManager.enableWaiting(!1),!!u(this,ia)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&u(this,lr)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&u(this,lr)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},zp=function(){if(u(this,Vr)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(u(this,Vr)).then(n=>L(this,Ot,Eh).call(this,n,!0)).finally(()=>L(this,Ot,_h).call(this));return}if(u(this,na)){const n=u(this,na);T(this,na,null),this._uiManager.enableWaiting(!0),T(this,Qa,this._uiManager.imageManager.getFromUrl(n).then(s=>L(this,Ot,Eh).call(this,s)).finally(()=>L(this,Ot,_h).call(this)));return}if(u(this,Ja)){const n=u(this,Ja);T(this,Ja,null),this._uiManager.enableWaiting(!0),T(this,Qa,this._uiManager.imageManager.getFromFile(n).then(s=>L(this,Ot,Eh).call(this,s)).finally(()=>L(this,Ot,_h).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=Xp.join(",");const r=this._uiManager._signal;T(this,Qa,new Promise(n=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const s=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),L(this,Ot,Eh).call(this,s)}n()},{signal:r}),t.addEventListener("cancel",()=>{this.remove(),n()},{signal:r})}).finally(()=>L(this,Ot,_h).call(this))),t.click()},jp=function(){var d;const{div:t}=this;let{width:r,height:n}=u(this,lr);const[s,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*s,n=this.height*a;else if(r>o*s||n>o*a){const p=Math.min(o*s/r,o*a/n);r*=p,n*=p}const[l,c]=this.parentDimensions;this.setDims(r*l/s,n*c/a),this._uiManager.enableWaiting(!1);const h=T(this,ia,document.createElement("canvas"));h.setAttribute("role","img"),this.addContainer(h),this.width=r/s,this.height=n/a,(d=this._initialOptions)!=null&&d.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),L(this,Ot,hb).call(this),u(this,Ac)||(this.parent.addUndoableEditor(this),T(this,Ac,!0)),this._reportTelemetry({action:"inserted_image"}),u(this,xc)&&this.div.setAttribute("aria-description",u(this,xc)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},Up=function(t,r){const{width:n,height:s}=u(this,lr);let a=n,o=s,l=u(this,lr);for(;a>2*t||o>2*r;){const c=a,h=o;a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const d=new OffscreenCanvas(a,o);d.getContext("2d").drawImage(l,0,0,c,h,0,0,a,o),l=d.transferToImageBitmap()}return l},hb=function(){const[t,r]=this.parentDimensions,{width:n,height:s}=this,a=new Wi,o=Math.ceil(n*t*a.sx),l=Math.ceil(s*r*a.sy),c=u(this,ia);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const h=u(this,ri)?u(this,lr):L(this,Ot,Up).call(this,o,l),d=c.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(h,0,0,h.width,h.height,0,0,o,l)},Hp=function(t){if(t){if(u(this,ri)){const s=this._uiManager.imageManager.getSvgUrl(u(this,Vr));if(s)return s}const r=document.createElement("canvas");return{width:r.width,height:r.height}=u(this,lr),r.getContext("2d").drawImage(u(this,lr),0,0),r.toDataURL()}if(u(this,ri)){const[r,n]=this.pageDimensions,s=Math.round(this.width*r*da.PDF_TO_CSS_UNITS),a=Math.round(this.height*n*da.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(u(this,lr),0,0,u(this,lr).width,u(this,lr).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(u(this,lr))},ax=function(t){var o;const{pageIndex:r,accessibilityData:{altText:n}}=this._initialData,s=t.pageIndex===r,a=(((o=t.accessibilityData)==null?void 0:o.alt)||"")===n;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}},Ie(cb,"_type","stamp"),Ie(cb,"_editorType",ot.STAMP);var Ll,Ec,bs,eo,sa,ni,to,_c,Ol,$i,aa,Gr,oa,ro,Cc,Ze,no,ur,ox,Ji,db,fb,$p;const Ii=class Ii{constructor({uiManager:e,pageIndex:t,div:r,structTreeLayer:n,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:h}){N(this,ur);N(this,Ll);N(this,Ec,!1);N(this,bs,null);N(this,eo,null);N(this,sa,null);N(this,ni,new Map);N(this,to,!1);N(this,_c,!1);N(this,Ol,!1);N(this,$i,null);N(this,aa,null);N(this,Gr,null);N(this,oa,null);N(this,ro,null);N(this,Cc,-1);N(this,Ze);const d=[...u(Ii,no).values()];if(!Ii._initialized){Ii._initialized=!0;for(const p of d)p.initialize(h,e)}e.registerEditorTypes(d),T(this,Ze,e),this.pageIndex=t,this.div=r,T(this,Ll,s),T(this,bs,a),this.viewport=c,T(this,Gr,l),this.drawLayer=o,this._structTree=n,u(this,Ze).addLayer(this)}get isEmpty(){return u(this,ni).size===0}get isInvisible(){return this.isEmpty&&u(this,Ze).getMode()===ot.NONE}updateToolbar(e){u(this,Ze).updateToolbar(e)}updateMode(e=u(this,Ze).getMode()){switch(L(this,ur,$p).call(this),e){case ot.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case ot.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case ot.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of u(Ii,no).values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=u(this,Gr))==null?void 0:t.div)}setEditingState(e){u(this,Ze).setEditingState(e)}addCommands(e){u(this,Ze).addCommands(e)}cleanUndoStack(e){u(this,Ze).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var t;(t=u(this,bs))==null||t.div.classList.toggle("disabled",!e)}async enable(){var r;T(this,Ol,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(r=u(this,ro))==null||r.abort(),T(this,ro,null);const e=new Set;for(const n of u(this,ni).values())n.enableEditing(),n.show(!0),n.annotationElementId&&(u(this,Ze).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));if(!u(this,bs)){T(this,Ol,!1);return}const t=u(this,bs).getEditableAnnotations();for(const n of t){if(n.hide(),u(this,Ze).isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;const s=await this.deserialize(n);s&&(this.addOrRebuild(s),s.enableEditing())}T(this,Ol,!1)}disable(){var n;if(T(this,_c,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),u(this,Gr)&&!u(this,ro)){T(this,ro,new AbortController);const s=u(this,Ze).combinedSignal(u(this,ro));u(this,Gr).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:h}=a,d=u(this,Cc);if(h-d>500){T(this,Cc,h);return}T(this,Cc,-1);const{classList:p}=this.div;p.toggle("getElements",!0);const g=document.elementsFromPoint(l,c);if(p.toggle("getElements",!1),!this.div.contains(g[0]))return;let y;const b=new RegExp(`^${Q2}[0-9]+$`);for(const v of g)if(b.test(v.id)){y=v.id;break}if(!y)return;const w=u(this,ni).get(y);(w==null?void 0:w.annotationElementId)===null&&(a.stopPropagation(),a.preventDefault(),w.dblclick())},{signal:s,capture:!0})}const e=new Map,t=new Map;for(const s of u(this,ni).values())if(s.disableEditing(),!!s.annotationElementId){if(s.serialize()!==null){e.set(s.annotationElementId,s);continue}else t.set(s.annotationElementId,s);(n=this.getEditableAnnotation(s.annotationElementId))==null||n.show(),s.remove()}if(u(this,bs)){const s=u(this,bs).getEditableAnnotations();for(const a of s){const{id:o}=a.data;if(u(this,Ze).isDeletedAnnotationElement(o))continue;let l=t.get(o);if(l){l.resetAnnotationElement(a),l.show(!1),a.show();continue}l=e.get(o),l&&(u(this,Ze).addChangedExistingAnnotation(l),l.renderAnnotationElement(a)&&l.show(!1)),a.show()}}L(this,ur,$p).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const s of u(Ii,no).values())r.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),T(this,_c,!1)}getEditableAnnotation(e){var t;return((t=u(this,bs))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){u(this,Ze).getActive()!==e&&u(this,Ze).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=u(this,Gr))!=null&&e.div&&!u(this,oa)){T(this,oa,new AbortController);const t=u(this,Ze).combinedSignal(u(this,oa));u(this,Gr).div.addEventListener("pointerdown",L(this,ur,ox).bind(this),{signal:t}),u(this,Gr).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=u(this,Gr))!=null&&e.div&&u(this,oa)&&(u(this,oa).abort(),T(this,oa,null),u(this,Gr).div.classList.remove("highlighting"))}enableClick(){if(u(this,eo))return;T(this,eo,new AbortController);const e=u(this,Ze).combinedSignal(u(this,eo));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){var e;(e=u(this,eo))==null||e.abort(),T(this,eo,null)}attach(e){u(this,ni).set(e.id,e);const{annotationElementId:t}=e;t&&u(this,Ze).isDeletedAnnotationElement(t)&&u(this,Ze).removeDeletedAnnotationElement(e)}detach(e){var t;u(this,ni).delete(e.id),(t=u(this,Ll))==null||t.removePointerInTextLayer(e.contentDiv),!u(this,_c)&&e.annotationElementId&&u(this,Ze).addDeletedAnnotationElement(e)}remove(e){this.detach(e),u(this,Ze).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(u(this,Ze).addDeletedAnnotationElement(e.annotationElementId),tr.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(t=e.parent)==null||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),u(this,Ze).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!u(this,Ol)),u(this,Ze).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!u(this,sa)&&(e._focusEventsAllowed=!1,T(this,sa,setTimeout(()=>{T(this,sa,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:u(this,Ze)._signal}),t.focus())},0))),e._structTreeParentId=(r=u(this,Ll))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const t=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:t,undo:r,mustExec:!1})}getNextId(){return u(this,Ze).getId()}combinedSignal(e){return u(this,Ze).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=u(this,ur,Ji))==null?void 0:e.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await u(this,Ze).updateMode(e.mode);const{offsetX:r,offsetY:n}=L(this,ur,fb).call(this),s=this.getNextId(),a=L(this,ur,db).call(this,{parent:this,id:s,x:r,y:n,uiManager:u(this,Ze),isCentered:!0,...t});a&&this.add(a)}async deserialize(e){var t;return await((t=u(Ii,no).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,u(this,Ze)))||null}createAndAddNewEditor(e,t,r={}){const n=this.getNextId(),s=L(this,ur,db).call(this,{parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:u(this,Ze),isCentered:t,...r});return s&&this.add(s),s}addNewEditor(e={}){this.createAndAddNewEditor(L(this,ur,fb).call(this),!0,e)}setSelected(e){u(this,Ze).setSelected(e)}toggleSelected(e){u(this,Ze).toggleSelected(e)}unselect(e){u(this,Ze).unselect(e)}pointerup(e){var n;const{isMac:t}=qr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!u(this,to)||(T(this,to,!1),(n=u(this,ur,Ji))!=null&&n.isDrawer&&u(this,ur,Ji).supportMultipleDrawings))return;if(!u(this,Ec)){T(this,Ec,!0);return}const r=u(this,Ze).getMode();if(r===ot.STAMP||r===ot.SIGNATURE){u(this,Ze).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){var n;if(u(this,Ze).getMode()===ot.HIGHLIGHT&&this.enableTextSelection(),u(this,to)){T(this,to,!1);return}const{isMac:t}=qr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(T(this,to,!0),(n=u(this,ur,Ji))!=null&&n.isDrawer){this.startDrawingSession(e);return}const r=u(this,Ze).getActive();T(this,Ec,!r||r.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),u(this,$i)){u(this,ur,Ji).startDrawing(this,u(this,Ze),!1,e);return}u(this,Ze).setCurrentDrawingSession(this),T(this,$i,new AbortController);const t=u(this,Ze).combinedSignal(u(this,$i));this.div.addEventListener("blur",({relatedTarget:r})=>{r&&!this.div.contains(r)&&(T(this,aa,null),this.commitOrRemove())},{signal:t}),u(this,ur,Ji).startDrawing(this,u(this,Ze),!1,e)}pause(e){if(e){const{activeElement:t}=document;this.div.contains(t)&&T(this,aa,t);return}u(this,aa)&&setTimeout(()=>{var t;(t=u(this,aa))==null||t.focus(),T(this,aa,null)},0)}endDrawingSession(e=!1){return u(this,$i)?(u(this,Ze).setCurrentDrawingSession(null),u(this,$i).abort(),T(this,$i,null),T(this,aa,null),u(this,ur,Ji).endDrawing(e)):null}findNewParent(e,t,r){const n=u(this,Ze).findParent(t,r);return n===null||n===this?!1:(n.changeParent(e),!0)}commitOrRemove(){return u(this,$i)?(this.endDrawingSession(),!0):!1}onScaleChanging(){u(this,$i)&&u(this,ur,Ji).onScaleChangingWhenDrawing(this)}destroy(){var e,t;this.commitOrRemove(),((e=u(this,Ze).getActive())==null?void 0:e.parent)===this&&(u(this,Ze).commitOrRemove(),u(this,Ze).setActiveEditor(null)),u(this,sa)&&(clearTimeout(u(this,sa)),T(this,sa,null));for(const r of u(this,ni).values())(t=u(this,Ll))==null||t.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,u(this,ni).clear(),u(this,Ze).removeLayer(this)}render({viewport:e}){this.viewport=e,so(this.div,e);for(const t of u(this,Ze).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){u(this,Ze).commitOrRemove(),L(this,ur,$p).call(this);const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,so(this.div,{rotation:r}),t!==r)for(const n of u(this,ni).values())n.rotate(r)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return u(this,Ze).viewParameters.realScale}};Ll=new WeakMap,Ec=new WeakMap,bs=new WeakMap,eo=new WeakMap,sa=new WeakMap,ni=new WeakMap,to=new WeakMap,_c=new WeakMap,Ol=new WeakMap,$i=new WeakMap,aa=new WeakMap,Gr=new WeakMap,oa=new WeakMap,ro=new WeakMap,Cc=new WeakMap,Ze=new WeakMap,no=new WeakMap,ur=new WeakSet,ox=function(e){u(this,Ze).unselectAll();const{target:t}=e;if(t===u(this,Gr).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&u(this,Gr).div.contains(t)){const{isMac:r}=qr.platform;if(e.button!==0||e.ctrlKey&&r)return;u(this,Ze).showAllEditors("highlight",!0,!0),u(this,Gr).div.classList.add("free"),this.toggleDrawing(),Kp.startHighlighting(this,u(this,Ze).direction==="ltr",{target:u(this,Gr).div,x:e.x,y:e.y}),u(this,Gr).div.addEventListener("pointerup",()=>{u(this,Gr).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:u(this,Ze)._signal}),e.preventDefault()}},Ji=function(){return u(Ii,no).get(u(this,Ze).getMode())},db=function(e){const t=u(this,ur,Ji);return t?new t.prototype.constructor(e):null},fb=function(){const{x:e,y:t,width:r,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+r),l=Math.min(window.innerHeight,t+n),c=(s+o)/2-e,h=(a+l)/2-t,[d,p]=this.viewport.rotation%180===0?[c,h]:[h,c];return{offsetX:d,offsetY:p}},$p=function(){for(const e of u(this,ni).values())e.isEmpty()&&e.remove()},Ie(Ii,"_initialized",!1),N(Ii,no,new Map([V0,nb,cb,Kp,ub].map(e=>[e._editorType,e])));let Jp=Ii;var Vi,En,Fl,_f,Eg,lx,As,pb,ux,gb;const Rr=class Rr{constructor({pageIndex:e}){N(this,As);N(this,Vi,null);N(this,En,new Map);N(this,Fl,new Map);this.pageIndex=e}setParent(e){if(!u(this,Vi)){T(this,Vi,e);return}if(u(this,Vi)!==e){if(u(this,En).size>0)for(const t of u(this,En).values())t.remove(),e.append(t);T(this,Vi,e)}}static get _svgFactory(){return Ct(this,"_svgFactory",new Lh)}draw(e,t=!1,r=!1){const n=bn(Rr,_f)._++,s=L(this,As,pb).call(this),a=Rr._svgFactory.createElement("defs");s.append(a);const o=Rr._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${n}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),t&&u(this,Fl).set(n,o);const c=r?L(this,As,ux).call(this,a,l):null,h=Rr._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${l}`),this.updateProperties(s,e),u(this,En).set(n,s),{id:n,clipPathId:`url(#${c})`}}drawOutline(e,t){const r=bn(Rr,_f)._++,n=L(this,As,pb).call(this),s=Rr._svgFactory.createElement("defs");n.append(s);const a=Rr._svgFactory.createElement("path");s.append(a);const o=`path_p${this.pageIndex}_${r}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(t){const d=Rr._svgFactory.createElement("mask");s.append(d),l=`mask_p${this.pageIndex}_${r}`,d.setAttribute("id",l),d.setAttribute("maskUnits","objectBoundingBox");const p=Rr._svgFactory.createElement("rect");d.append(p),p.setAttribute("width","1"),p.setAttribute("height","1"),p.setAttribute("fill","white");const g=Rr._svgFactory.createElement("use");d.append(g),g.setAttribute("href",`#${o}`),g.setAttribute("stroke","none"),g.setAttribute("fill","black"),g.setAttribute("fill-rule","nonzero"),g.classList.add("mask")}const c=Rr._svgFactory.createElement("use");n.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const h=c.cloneNode();return n.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(n,e),u(this,En).set(r,n),r}finalizeDraw(e,t){u(this,Fl).delete(e),this.updateProperties(e,t)}updateProperties(e,t){var l;if(!t)return;const{root:r,bbox:n,rootClass:s,path:a}=t,o=typeof e=="number"?u(this,En).get(e):e;if(o){if(r&&L(this,As,gb).call(this,o,r),n&&L(l=Rr,Eg,lx).call(l,o,n),s){const{classList:c}=o;for(const[h,d]of Object.entries(s))c.toggle(h,d)}if(a){const h=o.firstChild.firstChild;L(this,As,gb).call(this,h,a)}}}updateParent(e,t){if(t===this)return;const r=u(this,En).get(e);r&&(u(t,Vi).append(r),u(this,En).delete(e),u(t,En).set(e,r))}remove(e){u(this,Fl).delete(e),u(this,Vi)!==null&&(u(this,En).get(e).remove(),u(this,En).delete(e))}destroy(){T(this,Vi,null);for(const e of u(this,En).values())e.remove();u(this,En).clear(),u(this,Fl).clear()}};Vi=new WeakMap,En=new WeakMap,Fl=new WeakMap,_f=new WeakMap,Eg=new WeakSet,lx=function(e,[t,r,n,s]){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*t}%`,a.width=`${100*n}%`,a.height=`${100*s}%`},As=new WeakSet,pb=function(){const e=Rr._svgFactory.create(1,1,!0);return u(this,Vi).append(e),e.setAttribute("aria-hidden",!0),e},ux=function(e,t){const r=Rr._svgFactory.createElement("clipPath");e.append(r);const n=`clip_${t}`;r.setAttribute("id",n),r.setAttribute("clipPathUnits","objectBoundingBox");const s=Rr._svgFactory.createElement("use");return r.append(s),s.setAttribute("href",`#${t}`),s.classList.add("clip"),n},gb=function(e,t){for(const[r,n]of Object.entries(t))n===null?e.removeAttribute(r):e.setAttribute(r,n)},N(Rr,Eg),N(Rr,_f,0);let eg=Rr;globalThis._pdfjsTestingUtils={HighlightOutliner:q0};globalThis.pdfjsLib={AbortException:ha,AnnotationEditorLayer:Jp,AnnotationEditorParamsType:kt,AnnotationEditorType:ot,AnnotationEditorUIManager:ao,AnnotationLayer:$b,AnnotationMode:vs,AnnotationType:wr,build:uw,ColorPicker:Oh,createValidAbsoluteUrl:Pb,DOMSVGFactory:Lh,DrawLayer:eg,FeatureTest:qr,fetchData:Nc,getDocument:Bb,getFilenameFromUrl:i1,getPdfFilenameFromUrl:s1,getUuid:Ib,getXfaPageViewport:a1,GlobalWorkerOptions:yi,ImageKind:Th,InvalidPDFException:Wp,isDataScheme:kf,isPdfFile:kg,isValidExplicitDest:j1,MathClamp:dn,noContextMenu:Ei,normalizeUnicode:r1,OPS:Ph,OutputScale:Wi,PasswordResponses:e1,PDFDataRangeTransport:zb,PDFDateString:Dg,PDFWorker:Sc,PermissionFlag:J2,PixelsPerInch:da,RenderingCancelledException:Tg,ResponseException:Rh,setLayerDimensions:so,shadow:Ct,SignatureExtractor:ys,stopEvent:_r,SupportedImageMimeTypes:Xp,TextLayer:Nh,TouchManager:Ih,updateUrlHash:Rb,Util:Qe,VerbosityLevel:Cf,version:jb,XfaLayer:Ub};const nS=Object.freeze(Object.defineProperty({__proto__:null,AbortException:ha,AnnotationEditorLayer:Jp,AnnotationEditorParamsType:kt,AnnotationEditorType:ot,AnnotationEditorUIManager:ao,AnnotationLayer:$b,AnnotationMode:vs,AnnotationType:wr,ColorPicker:Oh,DOMSVGFactory:Lh,DrawLayer:eg,FeatureTest:qr,GlobalWorkerOptions:yi,ImageKind:Th,InvalidPDFException:Wp,MathClamp:dn,OPS:Ph,OutputScale:Wi,PDFDataRangeTransport:zb,PDFDateString:Dg,PDFWorker:Sc,PasswordResponses:e1,PermissionFlag:J2,PixelsPerInch:da,RenderingCancelledException:Tg,ResponseException:Rh,SignatureExtractor:ys,SupportedImageMimeTypes:Xp,TextLayer:Nh,TouchManager:Ih,Util:Qe,VerbosityLevel:Cf,XfaLayer:Ub,build:uw,createValidAbsoluteUrl:Pb,fetchData:Nc,getDocument:Bb,getFilenameFromUrl:i1,getPdfFilenameFromUrl:s1,getUuid:Ib,getXfaPageViewport:a1,isDataScheme:kf,isPdfFile:kg,isValidExplicitDest:j1,noContextMenu:Ei,normalizeUnicode:r1,setLayerDimensions:so,shadow:Ct,stopEvent:_r,updateUrlHash:Rb,version:jb},Symbol.toStringTag,{value:"Module"}));function cx(i){var e,t,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var n=i.length;for(e=0;e<n;e++)i[e]&&(t=cx(i[e]))&&(r&&(r+=" "),r+=t)}else for(t in i)i[t]&&(r&&(r+=" "),r+=t);return r}function Ig(){for(var i,e,t=0,r="",n=arguments.length;t<n;t++)(i=arguments[t])&&(e=cx(i))&&(r&&(r+=" "),r+=e);return r}var gy=Object.prototype.hasOwnProperty;function my(i,e,t){for(t of i.keys())if(bu(t,e))return t}function bu(i,e){var t,r,n;if(i===e)return!0;if(i&&e&&(t=i.constructor)===e.constructor){if(t===Date)return i.getTime()===e.getTime();if(t===RegExp)return i.toString()===e.toString();if(t===Array){if((r=i.length)===e.length)for(;r--&&bu(i[r],e[r]););return r===-1}if(t===Set){if(i.size!==e.size)return!1;for(r of i)if(n=r,n&&typeof n=="object"&&(n=my(e,n),!n)||!e.has(n))return!1;return!0}if(t===Map){if(i.size!==e.size)return!1;for(r of i)if(n=r[0],n&&typeof n=="object"&&(n=my(e,n),!n)||!bu(r[1],e.get(n)))return!1;return!0}if(t===ArrayBuffer)i=new Uint8Array(i),e=new Uint8Array(e);else if(t===DataView){if((r=i.byteLength)===e.byteLength)for(;r--&&i.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(i)){if((r=i.byteLength)===e.byteLength)for(;r--&&i[r]===e[r];);return r===-1}if(!t||typeof i=="object"){r=0;for(t in i)if(gy.call(i,t)&&++r&&!gy.call(e,t)||!(t in e)||!bu(i[t],e[t]))return!1;return Object.keys(e).length===r}}return i!==i&&e!==e}function If(i){let e=!1;return{promise:new Promise((r,n)=>{i.then(s=>!e&&r(s)).catch(s=>!e&&n(s))}),cancel(){e=!0}}}const iS=["onCopy","onCut","onPaste"],sS=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],aS=["onFocus","onBlur"],oS=["onInput","onInvalid","onReset","onSubmit"],lS=["onLoad","onError"],uS=["onKeyDown","onKeyPress","onKeyUp"],cS=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],hS=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dS=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],fS=["onSelect"],pS=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],gS=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],mS=["onScroll"],bS=["onWheel"],vS=["onAnimationStart","onAnimationEnd","onAnimationIteration"],yS=["onTransitionEnd"],wS=["onToggle"],xS=["onChange"],AS=[...iS,...sS,...aS,...oS,...lS,...uS,...cS,...hS,...dS,...fS,...pS,...gS,...mS,...bS,...vS,...yS,...xS,...wS];function hx(i,e){const t={};for(const r of AS){const n=i[r];n&&(e?t[r]=s=>n(s,e(r)):t[r]=n)}return t}var ES=process.env.NODE_ENV==="production",ym="Invariant failed";function Qt(i,e){if(!i){if(ES)throw new Error(ym);var t=typeof e=="function"?e():e,r=t?"".concat(ym,": ").concat(t):ym;throw new Error(r)}}var _S=process.env.NODE_ENV!=="production",dx=function(){};if(_S){var CS=function(e,t){var r=arguments.length;t=new Array(r>1?r-1:0);for(var n=1;n<r;n++)t[n-1]=arguments[n];var s=0,a="Warning: "+e.replace(/%s/g,function(){return t[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}};dx=function(i,e,t){var r=arguments.length;t=new Array(r>2?r-2:0);for(var n=2;n<r;n++)t[n-2]=arguments[n];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");i||CS.apply(null,[e].concat(t))}}var SS=dx;const fn=_g(SS),fx=Pe.createContext(null),TS="noopener noreferrer nofollow";class kS{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Qt(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(e){Qt(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(t=>{Qt(this.pdfDocument,"PDF document not loaded."),Qt(e,"Destination is not specified."),typeof e=="string"?this.pdfDocument.getDestination(e).then(t):Array.isArray(e)?t(e):e.then(t)}).then(t=>{Qt(Array.isArray(t),`"${t}" is not a valid destination array.`);const r=t[0];new Promise(n=>{Qt(this.pdfDocument,"PDF document not loaded."),r instanceof Object?this.pdfDocument.getPageIndex(r).then(s=>{n(s)}).catch(()=>{Qt(!1,`"${r}" is not a valid page reference.`)}):typeof r=="number"?n(r):Qt(!1,`"${r}" is not a valid destination reference.`)}).then(n=>{const s=n+1;Qt(this.pdfViewer,"PDF viewer is not initialized."),Qt(s>=1&&s<=this.pagesCount,`"${s}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:n,pageNumber:s})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const t=e-1;Qt(this.pdfViewer,"PDF viewer is not initialized."),Qt(e>=1&&e<=this.pagesCount,`"${e}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:t,pageNumber:e})}addLinkAttributes(e,t,r){e.href=t,e.rel=this.externalLinkRel||TS,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}function vu({children:i,type:e}){return we.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:i})}const by={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};function DS(i,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return i}}function Tc(){return Pe.useReducer(DS,{value:void 0,error:void 0})}const Ng=typeof window<"u",px=Ng&&window.location.protocol==="file:";function PS(i){return typeof i<"u"}function xo(i){return PS(i)&&i!==null}function RS(i){return typeof i=="string"}function IS(i){return i instanceof ArrayBuffer}function NS(i){return Qt(Ng,"isBlob can only be used in a browser environment"),i instanceof Blob}function mb(i){return RS(i)&&/^data:/.test(i)}function vy(i){Qt(mb(i),"Invalid data URI.");const[e="",t=""]=i.split(",");return e.split(";").indexOf("base64")!==-1?atob(t):unescape(t)}function MS(){return Ng&&window.devicePixelRatio||1}const gx="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function yy(){fn(!px,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${gx}`)}function LS(){fn(!px,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${gx}`)}function Ul(i){i!=null&&i.cancel&&i.cancel()}function bb(i,e){return Object.defineProperty(i,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(i,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(i,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(i,"originalHeight",{get(){return this.view[3]},configurable:!0}),i}function OS(i){return i.name==="RenderingCancelledException"}function FS(i){return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return t(new Error("Error while reading a file."));e(r.result)},r.onerror=n=>{if(!n.target)return t(new Error("Error while reading a file."));const{error:s}=n.target;if(!s)return t(new Error("Error while reading a file."));switch(s.code){case s.NOT_FOUND_ERR:return t(new Error("Error while reading a file: File not found."));case s.SECURITY_ERR:return t(new Error("Error while reading a file: Security error."));case s.ABORT_ERR:return t(new Error("Error while reading a file: Aborted."));default:return t(new Error("Error while reading a file."))}},r.readAsArrayBuffer(i)})}const{PDFDataRangeTransport:BS}=nS,zS=(i,e)=>{switch(e){case by.NEED_PASSWORD:{const t=prompt("Enter the password to open this PDF file.");i(t);break}case by.INCORRECT_PASSWORD:{const t=prompt("Invalid password. Please try again.");i(t);break}}};function wy(i){return typeof i=="object"&&i!==null&&("data"in i||"range"in i||"url"in i)}const jS=Pe.forwardRef(function({children:e,className:t,error:r="Failed to load PDF file.",externalLinkRel:n,externalLinkTarget:s,file:a,inputRef:o,imageResourcesPath:l,loading:c="Loading PDF…",noData:h="No PDF file specified.",onItemClick:d,onLoadError:p,onLoadProgress:g,onLoadSuccess:y,onPassword:b=zS,onSourceError:w,onSourceSuccess:v,options:A,renderMode:E,rotate:_,scale:C,...I},k){const[D,R]=Tc(),{value:z,error:G}=D,[O,X]=Tc(),{value:S,error:J}=O,Y=Pe.useRef(new kS),W=Pe.useRef([]),fe=Pe.useRef(void 0),K=Pe.useRef(void 0);a&&a!==fe.current&&wy(a)&&(fn(!bu(a,fe.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),fe.current=a),A&&A!==K.current&&(fn(!bu(A,K.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),K.current=A);const be=Pe.useRef({scrollPageIntoView:Te=>{const{dest:x,pageNumber:U,pageIndex:B=U-1}=Te;if(d){d({dest:x,pageIndex:B,pageNumber:U});return}const F=W.current[B];if(F){F.scrollIntoView();return}fn(!1,`An internal link leading to page ${U} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});Pe.useImperativeHandle(k,()=>({linkService:Y,pages:W,viewer:be}),[]);function te(){v&&v()}function j(){G&&(fn(!1,G.toString()),w&&w(G))}function ie(){R({type:"RESET"})}Pe.useEffect(ie,[a,R]);const ae=Pe.useCallback(async()=>{if(!a)return null;if(typeof a=="string")return mb(a)?{data:vy(a)}:(yy(),{url:a});if(a instanceof BS)return{range:a};if(IS(a))return{data:a};if(Ng&&NS(a))return{data:await FS(a)};if(Qt(typeof a=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),Qt(wy(a),"Invalid parameter object: need either .data, .range or .url"),"url"in a&&typeof a.url=="string"){if(mb(a.url)){const{url:Te,...x}=a;return{data:vy(Te),...x}}yy()}return a},[a]);Pe.useEffect(()=>{const Te=If(ae());return Te.promise.then(x=>{R({type:"RESOLVE",value:x})}).catch(x=>{R({type:"REJECT",error:x})}),()=>{Ul(Te)}},[ae,R]),Pe.useEffect(()=>{if(!(typeof z>"u")){if(z===!1){j();return}te()}},[z]);function H(){S&&(y&&y(S),W.current=new Array(S.numPages),Y.current.setDocument(S))}function se(){J&&(fn(!1,J.toString()),p&&p(J))}Pe.useEffect(function(){X({type:"RESET"})},[X,z]),Pe.useEffect(function(){if(!z)return;const x=A?{...z,...A}:z,U=Bb(x);g&&(U.onProgress=g),b&&(U.onPassword=b);const B=U,F=B.promise.then(M=>{X({type:"RESOLVE",value:M})}).catch(M=>{B.destroyed||X({type:"REJECT",error:M})});return()=>{F.finally(()=>B.destroy())}},[A,X,z]),Pe.useEffect(()=>{if(!(typeof S>"u")){if(S===!1){se();return}H()}},[S]),Pe.useEffect(function(){Y.current.setViewer(be.current),Y.current.setExternalLinkRel(n),Y.current.setExternalLinkTarget(s)},[n,s]);const le=Pe.useCallback((Te,x)=>{W.current[Te]=x},[]),oe=Pe.useCallback(Te=>{delete W.current[Te]},[]),ce=Pe.useMemo(()=>({imageResourcesPath:l,linkService:Y.current,onItemClick:d,pdf:S,registerPage:le,renderMode:E,rotate:_,scale:C,unregisterPage:oe}),[l,d,S,le,E,_,C,oe]),Ae=Pe.useMemo(()=>hx(I,()=>S),[I,S]);function Se(){function Te(U){return!!(U!=null&&U.pdf)}if(!Te(ce))throw new Error("pdf is undefined");const x=typeof e=="function"?e(ce):e;return we.jsx(fx.Provider,{value:ce,children:x})}function Ne(){return a?S==null?we.jsx(vu,{type:"loading",children:typeof c=="function"?c():c}):S===!1?we.jsx(vu,{type:"error",children:typeof r=="function"?r():r}):Se():we.jsx(vu,{type:"no-data",children:typeof h=="function"?h():h})}return we.jsx("div",{className:Ig("react-pdf__Document",t),ref:o,...Ae,children:Ne()})});function mx(){return Pe.useContext(fx)}function bx(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=i.filter(Boolean);if(t.length<=1){var r=t[0];return r||null}return function(s){for(var a=0,o=t;a<o.length;a++){var l=o[a];typeof l=="function"?l(s):l&&(l.current=s)}}}const vx=Pe.createContext(null);function Mg(){return Pe.useContext(vx)}function US(){const i=mx(),e=Mg();Qt(e,"Unable to find Page context.");const t={...i,...e},{imageResourcesPath:r,linkService:n,onGetAnnotationsError:s,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:l,page:c,pdf:h,renderForms:d,rotate:p,scale:g=1}=t;Qt(h,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),Qt(c,"Attempted to load page annotations, but no page was specified."),Qt(n,"Attempted to load page annotations, but no linkService was specified.");const[y,b]=Tc(),{value:w,error:v}=y,A=Pe.useRef(null);fn(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function E(){w&&a&&a(w)}function _(){v&&(fn(!1,v.toString()),s&&s(v))}Pe.useEffect(function(){b({type:"RESET"})},[b,c]),Pe.useEffect(function(){if(!c)return;const R=If(c.getAnnotations()),z=R;return R.promise.then(G=>{b({type:"RESOLVE",value:G})}).catch(G=>{b({type:"REJECT",error:G})}),()=>{Ul(z)}},[b,c]),Pe.useEffect(()=>{if(w!==void 0){if(w===!1){_();return}E()}},[w]);function C(){l&&l()}function I(D){fn(!1,`${D}`),o&&o(D)}const k=Pe.useMemo(()=>c.getViewport({scale:g,rotation:p}),[c,p,g]);return Pe.useEffect(function(){if(!h||!c||!n||!w)return;const{current:R}=A;if(!R)return;const z=k.clone({dontFlip:!0}),G={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:R,l10n:null,page:c,structTreeLayer:null,viewport:z},O={annotations:w,annotationStorage:h.annotationStorage,div:R,imageResourcesPath:r,linkService:n,page:c,renderForms:d,viewport:z};R.innerHTML="";try{new $b(G).render(O),C()}catch(X){I(X)}return()=>{}},[w,r,n,c,h,d,k]),we.jsx("div",{className:Ig("react-pdf__Page__annotations","annotationLayer"),ref:A})}const yx={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HS=/^H(\d+)$/;function $S(i){return i in yx}function Lg(i){return"children"in i}function wx(i){return Lg(i)?i.children.length===1&&0 in i.children&&"id"in i.children[0]:!1}function VS(i){const e={};if(Lg(i)){const{role:t}=i,r=t.match(HS);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if($S(t)){const n=yx[t];n&&(e.role=n)}}return e}function xx(i){const e={};if(Lg(i)){if(i.alt!==void 0&&(e["aria-label"]=i.alt),i.lang!==void 0&&(e.lang=i.lang),wx(i)){const[t]=i.children;if(t){const r=xx(t);return{...e,...r}}}}else"id"in i&&(e["aria-owns"]=i.id);return e}function GS(i){return i?{...VS(i),...xx(i)}:null}function Ax({className:i,node:e}){const t=Pe.useMemo(()=>GS(e),[e]),r=Pe.useMemo(()=>!Lg(e)||wx(e)?null:e.children.map((n,s)=>we.jsx(Ax,{node:n},s)),[e]);return we.jsx("span",{className:i,...t,children:r})}function qS(){const i=Mg();Qt(i,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:t}=i,[r,n]=Tc(),{value:s,error:a}=r,{customTextRenderer:o,page:l}=i;function c(){s&&t&&t(s)}function h(){a&&(fn(!1,a.toString()),e&&e(a))}return Pe.useEffect(function(){n({type:"RESET"})},[n,l]),Pe.useEffect(function(){if(o||!l)return;const p=If(l.getStructTree()),g=p;return p.promise.then(y=>{n({type:"RESOLVE",value:y})}).catch(y=>{n({type:"REJECT",error:y})}),()=>Ul(g)},[o,l,n]),Pe.useEffect(()=>{if(s!==void 0){if(s===!1){h();return}c()}},[s]),s?we.jsx(Ax,{className:"react-pdf__Page__structTree structTree",node:s}):null}const xy=vs;function WS(i){const e=Mg();Qt(e,"Unable to find Page context.");const t={...e,...i},{_className:r,canvasBackground:n,devicePixelRatio:s=MS(),onRenderError:a,onRenderSuccess:o,page:l,renderForms:c,renderTextLayer:h,rotate:d,scale:p}=t,{canvasRef:g}=i;Qt(l,"Attempted to render page canvas, but no page was specified.");const y=Pe.useRef(null);function b(){l&&o&&o(bb(l,p))}function w(_){OS(_)||(fn(!1,_.toString()),a&&a(_))}const v=Pe.useMemo(()=>l.getViewport({scale:p*s,rotation:d}),[s,l,d,p]),A=Pe.useMemo(()=>l.getViewport({scale:p,rotation:d}),[l,d,p]);Pe.useEffect(function(){if(!l)return;l.cleanup();const{current:C}=y;if(!C)return;C.width=v.width,C.height=v.height,C.style.width=`${Math.floor(A.width)}px`,C.style.height=`${Math.floor(A.height)}px`,C.style.visibility="hidden";const I={annotationMode:c?xy.ENABLE_FORMS:xy.ENABLE,canvasContext:C.getContext("2d",{alpha:!1}),viewport:v};n&&(I.background=n);const k=l.render(I),D=k;return k.promise.then(()=>{C.style.visibility="",b()}).catch(w),()=>Ul(D)},[n,l,c,v,A]);const E=Pe.useCallback(()=>{const{current:_}=y;_&&(_.width=0,_.height=0)},[]);return Pe.useEffect(()=>E,[E]),we.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:bx(g,y),style:{display:"block",userSelect:"none"},children:h?we.jsx(qS,{}):null})}function XS(i){return"str"in i}function YS(){const i=Mg();Qt(i,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:t,onGetTextSuccess:r,onRenderTextLayerError:n,onRenderTextLayerSuccess:s,page:a,pageIndex:o,pageNumber:l,rotate:c,scale:h}=i;Qt(a,"Attempted to load page text content, but no page was specified.");const[d,p]=Tc(),{value:g,error:y}=d,b=Pe.useRef(null);fn(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function w(){g&&r&&r(g)}function v(){y&&(fn(!1,y.toString()),t&&t(y))}Pe.useEffect(function(){p({type:"RESET"})},[a,p]),Pe.useEffect(function(){if(!a)return;const D=If(a.getTextContent()),R=D;return D.promise.then(z=>{p({type:"RESOLVE",value:z})}).catch(z=>{p({type:"REJECT",error:z})}),()=>Ul(R)},[a,p]),Pe.useEffect(()=>{if(g!==void 0){if(g===!1){v();return}w()}},[g]);const A=Pe.useCallback(()=>{s&&s()},[s]),E=Pe.useCallback(k=>{fn(!1,k.toString()),n&&n(k)},[n]);function _(){const k=b.current;k&&k.classList.add("selecting")}function C(){const k=b.current;k&&k.classList.remove("selecting")}const I=Pe.useMemo(()=>a.getViewport({scale:h,rotation:c}),[a,c,h]);return Pe.useLayoutEffect(function(){if(!a||!g)return;const{current:D}=b;if(!D)return;D.innerHTML="";const R=a.streamTextContent({includeMarkedContent:!0}),z={container:D,textContentSource:R,viewport:I},G=new Nh(z),O=G;return G.render().then(()=>{const X=document.createElement("div");X.className="endOfContent",D.append(X);const S=D.querySelectorAll('[role="presentation"]');if(e){let J=0;g.items.forEach((Y,W)=>{if(!XS(Y))return;const fe=S[J];if(!fe)return;const K=e({pageIndex:o,pageNumber:l,itemIndex:W,...Y});fe.innerHTML=K,J+=Y.str&&Y.hasEOL?2:1})}A()}).catch(E),()=>Ul(O)},[e,E,A,a,o,l,g,I]),we.jsx("div",{className:Ig("react-pdf__Page__textContent","textLayer"),onMouseUp:C,onMouseDown:_,ref:b})}const Ay=1;function ZS(i){const t={...mx(),...i},{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:n=!0,canvasBackground:s,canvasRef:a,children:o,className:l,customRenderer:c,customTextRenderer:h,devicePixelRatio:d,error:p="Failed to load the page.",height:g,inputRef:y,loading:b="Loading page…",noData:w="No page specified.",onGetAnnotationsError:v,onGetAnnotationsSuccess:A,onGetStructTreeError:E,onGetStructTreeSuccess:_,onGetTextError:C,onGetTextSuccess:I,onLoadError:k,onLoadSuccess:D,onRenderAnnotationLayerError:R,onRenderAnnotationLayerSuccess:z,onRenderError:G,onRenderSuccess:O,onRenderTextLayerError:X,onRenderTextLayerSuccess:S,pageIndex:J,pageNumber:Y,pdf:W,registerPage:fe,renderAnnotationLayer:K=!0,renderForms:be=!1,renderMode:te="canvas",renderTextLayer:j=!0,rotate:ie,scale:ae=Ay,unregisterPage:H,width:se,...le}=t,[oe,ce]=Tc(),{value:Ae,error:Se}=oe,Ne=Pe.useRef(null);Qt(W,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const Te=xo(Y)?Y-1:J??null,x=Y??(xo(J)?J+1:null),U=ie??(Ae?Ae.rotate:null),B=Pe.useMemo(()=>{if(!Ae)return null;let $e=1;const Xe=ae??Ay;if(se||g){const Tt=Ae.getViewport({scale:1,rotation:U});se?$e=se/Tt.width:g&&($e=g/Tt.height)}return Xe*$e},[g,Ae,U,ae,se]);Pe.useEffect(function(){return()=>{xo(Te)&&n&&H&&H(Te)}},[n,W,Te,H]);function F(){if(D){if(!Ae||!B)return;D(bb(Ae,B))}if(n&&fe){if(!xo(Te)||!Ne.current)return;fe(Te,Ne.current)}}function M(){Se&&(fn(!1,Se.toString()),k&&k(Se))}Pe.useEffect(function(){ce({type:"RESET"})},[ce,W,Te]),Pe.useEffect(function(){if(!W||!x)return;const Xe=If(W.getPage(x)),Tt=Xe;return Xe.promise.then(nr=>{ce({type:"RESOLVE",value:nr})}).catch(nr=>{ce({type:"REJECT",error:nr})}),()=>Ul(Tt)},[ce,W,x]),Pe.useEffect(()=>{if(Ae!==void 0){if(Ae===!1){M();return}F()}},[Ae,B]);const q=Pe.useMemo(()=>xo(Te)&&x&&xo(U)&&xo(B)?{_className:r,canvasBackground:s,customTextRenderer:h,devicePixelRatio:d,onGetAnnotationsError:v,onGetAnnotationsSuccess:A,onGetStructTreeError:E,onGetStructTreeSuccess:_,onGetTextError:C,onGetTextSuccess:I,onRenderAnnotationLayerError:R,onRenderAnnotationLayerSuccess:z,onRenderError:G,onRenderSuccess:O,onRenderTextLayerError:X,onRenderTextLayerSuccess:S,page:Ae,pageIndex:Te,pageNumber:x,renderForms:be,renderTextLayer:j,rotate:U,scale:B}:null,[r,s,h,d,v,A,E,_,C,I,R,z,G,O,X,S,Ae,Te,x,be,j,U,B]),de=Pe.useMemo(()=>hx(le,()=>Ae&&(B?bb(Ae,B):void 0)),[le,Ae,B]),ye=`${Te}@${B}/${U}`;function ee(){switch(te){case"custom":return Qt(c,'renderMode was set to "custom", but no customRenderer was passed.'),we.jsx(c,{},`${ye}_custom`);case"none":return null;case"canvas":default:return we.jsx(WS,{canvasRef:a},`${ye}_canvas`)}}function Ee(){return j?we.jsx(YS,{},`${ye}_text`):null}function De(){return K?we.jsx(US,{},`${ye}_annotations`):null}function Ce(){function $e(Tt){return!!(Tt!=null&&Tt.page)}if(!$e(q))throw new Error("page is undefined");const Xe=typeof o=="function"?o(q):o;return we.jsxs(vx.Provider,{value:q,children:[ee(),Ee(),De(),Xe]})}function Me(){return x?W===null||Ae===void 0||Ae===null?we.jsx(vu,{type:"loading",children:typeof b=="function"?b():b}):W===!1||Ae===!1?we.jsx(vu,{type:"error",children:typeof p=="function"?p():p}):Ce():we.jsx(vu,{type:"no-data",children:typeof w=="function"?w():w})}return we.jsx("div",{className:Ig(r,l),"data-page-number":x,ref:bx(y,Ne),style:{"--scale-round-x":"1px","--scale-round-y":"1px","--scale-factor":"1","--user-unit":`${B}`,"--total-scale-factor":"calc(var(--scale-factor) * var(--user-unit))",backgroundColor:s||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"},...de,children:Me()})}LS();yi.workerSrc="pdf.worker.mjs";yi.workerSrc=`//unpkg.com/pdfjs-dist@${jb}/build/pdf.worker.min.mjs`;const KS=({onClose:i,src:e,title:t="PDF Viewer",className:r,onOpen:n})=>{const[s,a]=X2(),[o,l]=Y2(),[{currentPage:c,totalPages:h},d]=K2(),[{pan:p,isDragging:g},y]=Z2(),b=v=>{if(n?(console.debug("[PdfViewer] onOpen callback triggered",{hasHandler:!0}),n(v)):console.debug("[PdfViewer] open button clicked",{hasHandler:!1}),!v.defaultPrevented){if(!e){v.preventDefault();return}window.open(e,"_blank","noopener,noreferrer")}},w=we.jsx(Mt.IconButton,{variant:"text",color:"gray",onClick:b,children:we.jsx(W2,{className:"size-4"})});return we.jsxs("div",{className:zl("shadow rounded-t-lg flex flex-col h-full",r),children:[we.jsx(q2.Header,{onClose:i,right:w,children:t}),we.jsxs("div",{className:"grid grow h-full overflow-hidden",children:[we.jsx("div",{className:zl("col-start-1 row-start-1 bg-gray-200 h-full overflow-hidden select-none p-8",g?"cursor-grabbing":"cursor-grab"),onMouseDown:y.handleMouseDown,onMouseMove:y.handleMouseMove,onMouseUp:y.handleMouseUp,onMouseLeave:y.handleMouseUp,style:{userSelect:"none"},children:we.jsx("div",{style:{transform:`translate(${p.x}px, ${p.y}px)`,transition:g?"none":"transform 0.1s",pointerEvents:"none"},children:we.jsx(jS,{file:e,onLoadSuccess:({numPages:v})=>{d.setTotalPages(v)},scale:s/100,rotate:o,children:we.jsx(ZS,{pageNumber:c,renderTextLayer:!0,renderAnnotationLayer:!0})})})}),we.jsxs("div",{className:"col-start-1 row-start-1 self-end p-4 flex gap-2 justify-between w-full z-10",children:[we.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:a.zoomOut,children:we.jsx(vi.Icon,{icon:"lucide:minus"})}),we.jsx(Mt.Tooltip,{content:"Click to reset zoom and pan",children:we.jsxs("button",{className:"!bg-white text-center cursor-pointer w-[60px]",onClick:()=>{a.reset(),y.reset()},children:[s,"%"]})}),we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:a.zoomIn,children:we.jsx(vi.Icon,{icon:"lucide:plus"})})]}),we.jsxs(Mt.ButtonGroup,{className:"divide-x-0 h-[52px]",children:[we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:l.rotateClockwise,children:we.jsx(vi.Icon,{icon:"lucide:iteration-cw"})}),we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:l.rotateCounterClockwise,children:we.jsx(vi.Icon,{icon:"lucide:iteration-ccw"})})]}),we.jsxs(Mt.ButtonGroup,{className:"divide-x-0 ",children:[we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:d.prevPage,disabled:c===1,children:we.jsx(vi.Icon,{icon:"lucide:chevron-left"})}),we.jsx("input",{className:"bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]",value:c,onChange:v=>{const A=parseInt(v.target.value);isNaN(A)||d.goToPage(A)},type:"number",min:"1",max:h}),we.jsxs("div",{className:"flex items-center bg-white px-2",children:["of ",h]}),we.jsx(Mt.IconButton,{variant:"filled",color:"white",className:"py-[26px]",onClick:d.nextPage,disabled:c===h,children:we.jsx(vi.Icon,{icon:"lucide:chevron-right"})})]})]})]})]})},QS=({...i})=>we.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...i,children:[we.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.16699 7.7334C4.91574 7.73357 6.33301 9.1516 6.33301 10.9004C6.33283 12.3905 5.30337 13.6386 3.91699 13.9756V15.25C3.91685 15.664 3.58098 15.9998 3.16699 16C2.75287 16 2.41713 15.6641 2.41699 15.25V13.9756C1.0303 13.6387 0.000177983 12.3906 0 10.9004C0 9.15149 1.41809 7.7334 3.16699 7.7334ZM3.16699 9.2334C2.24652 9.2334 1.5 9.97992 1.5 10.9004C1.50021 11.8207 2.24665 12.5664 3.16699 12.5664C4.08719 12.5662 4.8328 11.8206 4.83301 10.9004C4.83301 9.98002 4.08732 9.23357 3.16699 9.2334Z",fill:"currentColor"}),we.jsx("path",{d:"M11.8662 9.66699C12.2804 9.66699 12.6162 10.0028 12.6162 10.417V15.25C12.616 15.6641 12.2803 16 11.8662 16C11.4523 15.9998 11.1164 15.6639 11.1162 15.25V10.417C11.1162 10.0029 11.4522 9.66722 11.8662 9.66699Z",fill:"currentColor"}),we.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.8662 0C12.2804 0 12.6162 0.335786 12.6162 0.75V2.02344C14.0032 2.36025 15.0332 3.60999 15.0332 5.10059C15.0329 6.84904 13.6157 8.26633 11.8672 8.2666C10.1185 8.2666 8.70052 6.84921 8.7002 5.10059C8.7002 3.6104 9.7297 2.36066 11.1162 2.02344V0.75C11.1162 0.335929 11.4522 0.000230806 11.8662 0ZM11.8672 3.43359C10.9467 3.43359 10.2002 4.18011 10.2002 5.10059C10.2005 6.02078 10.9469 6.7666 11.8672 6.7666C12.7872 6.76633 13.5329 6.02062 13.5332 5.10059C13.5332 4.18028 12.7874 3.43387 11.8672 3.43359Z",fill:"currentColor"}),we.jsx("path",{d:"M3.16699 0C3.58107 0.000164881 3.91699 0.335888 3.91699 0.75V5.58301C3.91699 5.99712 3.58107 6.33284 3.16699 6.33301C2.75278 6.33301 2.41699 5.99722 2.41699 5.58301V0.75C2.41699 0.335786 2.75278 0 3.16699 0Z",fill:"currentColor"})]}),JS=()=>we.jsxs(Mt.Tabs,{className:"w-[800px]",children:[we.jsxs(Mt.TabsHeader,{children:[we.jsx(Mt.Tab,{value:"chats",children:"Chats"}),we.jsx(Mt.Tab,{value:"issues",children:"Issues"}),we.jsx("button",{className:"cursor-pointer mb-2 ml-auto rounded p-1 hover:bg-gray-100",children:we.jsx(QS,{className:"size-4"})})]}),we.jsxs(Mt.TabsBody,{children:[we.jsx(Mt.TabPanel,{value:"chats",children:"ChatsPanel"}),we.jsx(Mt.TabPanel,{value:"issues",children:"IssuesPanel"})]})]});var Ex={exports:{}},Nt={},br={};function eT(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var r=0;r<i.length;r++)if(Xl(i,r)){var n=i[r];if(e.call(void 0,n,r,i))return n}}function Mc(i,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(i=e.create(null,e.getOwnPropertyDescriptors(i))),e&&typeof e.freeze=="function"?e.freeze(i):i}function Xl(i,e){return Object.prototype.hasOwnProperty.call(i,e)}function tT(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Xl(e,t)&&(i[t]=e[t]);return i}var _x=Mc({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function rT(i){return Xl(_x,i.toLowerCase())}var Cx=Mc({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function nT(i){return Xl(Cx,i.toLowerCase())}var Fh=Mc({script:!1,style:!1,textarea:!0,title:!0});function iT(i){var e=i.toLowerCase();return Xl(Fh,e)&&!Fh[e]}function sT(i){var e=i.toLowerCase();return Xl(Fh,e)&&Fh[e]}function Sx(i){return i===Bh.HTML}function aT(i){return Sx(i)||i===Bh.XML_XHTML_APPLICATION}var Bh=Mc({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),oT=Object.keys(Bh).map(function(i){return Bh[i]});function lT(i){return oT.indexOf(i)>-1}var uT=Mc({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});br.assign=tT;br.find=eT;br.freeze=Mc;br.HTML_BOOLEAN_ATTRIBUTES=_x;br.HTML_RAW_TEXT_ELEMENTS=Fh;br.HTML_VOID_ELEMENTS=Cx;br.hasDefaultHTMLNamespace=aT;br.hasOwn=Xl;br.isHTMLBooleanAttribute=rT;br.isHTMLRawTextElement=iT;br.isHTMLEscapableRawTextElement=sT;br.isHTMLMimeType=Sx;br.isHTMLVoidElement=nT;br.isValidMimeType=lT;br.MIME_TYPE=Bh;br.NAMESPACE=uT;var go={},cT=br;function Tx(i,e){i.prototype=Object.create(Error.prototype,{constructor:{value:i},name:{value:i.name,enumerable:!0,writable:e}})}var zh=cT.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),kx=Object.keys(zh);function Dx(i){return typeof i=="number"&&i>=1&&i<=25}function hT(i){return typeof i=="string"&&i.substring(i.length-zh.Error.length)===zh.Error}function Nf(i,e){Dx(i)?(this.name=kx[i],this.message=e||""):(this.message=i,this.name=hT(e)?e:zh.Error),Error.captureStackTrace&&Error.captureStackTrace(this,Nf)}Tx(Nf,!0);Object.defineProperties(Nf.prototype,{code:{enumerable:!0,get:function(){var i=kx.indexOf(this.name);return Dx(i)?i:0}}});var Px={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},wm=Object.entries(Px);for(var op=0;op<wm.length;op++){var dT=wm[op][0];Nf[dT]=wm[op][1]}function qb(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,qb)}Tx(qb);go.DOMException=Nf;go.DOMExceptionName=zh;go.ExceptionCode=Px;go.ParseError=qb;var vr={},gt={};function Rx(i){try{typeof i!="function"&&(i=RegExp);var e=new i("𝌆","u").exec("𝌆");return!!e&&e[0].length===2}catch{}return!1}var Mf=Rx();function Hl(i){if(i.source[0]!=="[")throw new Error(i+" can not be used with chars");return i.source.slice(1,i.source.lastIndexOf("]"))}function kc(i,e){if(i.source[0]!=="[")throw new Error("/"+i.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(i.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+i.source+"/");if(e==="-"&&i.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+i.source+"/");return new RegExp(i.source.replace(e,""),Mf?"u":"")}function St(i){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var r=typeof t=="string";if(r&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return r?t:t.source}).join(""),Mf?"mu":"m")}function it(i){if(arguments.length===0)throw new Error("no parameters provided");return St.apply(it,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var fT="�",$l=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Mf&&($l=St("[",Hl($l),"\\u{10000}-\\u{10FFFF}","]"));var Wb=/[\x20\x09\x0D\x0A]/,pT=Hl(Wb),$t=St(Wb,"+"),dr=St(Wb,"*"),jh=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Mf&&(jh=St("[",Hl(jh),"\\u{10000}-\\u{10FFFF}","]"));var gT=Hl(jh),Xb=St("[",gT,Hl(/[-.0-9\xB7]/),Hl(/[\u0300-\u036F\u203F-\u2040]/),"]"),_i=St(jh,Xb,"*"),Ey=St(Xb,"+"),mT=St("&",_i,";"),bT=it(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Uh=it(mT,"|",bT),Hh=St("%",_i,";"),Yb=it(St('"',it(/[^%&"]/,"|",Hh,"|",Uh),"*",'"'),"|",St("'",it(/[^%&']/,"|",Hh,"|",Uh),"*","'")),vT=it('"',it(/[^<&"]/,"|",Uh),"*",'"',"|","'",it(/[^<&']/,"|",Uh),"*","'"),yT=kc(jh,":"),wT=kc(Xb,":"),_y=St(yT,wT,"*"),Lf=St(_y,it(":",_y),"?"),xT=St("^",Lf,"$"),AT=St("(",Lf,")"),$h=it(/"[^"]*"|'[^']*'/),ET=St(/^<\?/,"(",_i,")",it($t,"(",$l,"*?)"),"?",/\?>/),Cy=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Og=it('"',Cy,'*"',"|","'",kc(Cy,"'"),"*'"),Ix="<!--",Nx="-->",_T=St(Ix,it(kc($l,"-"),"|",St("-",kc($l,"-"))),"*",Nx),Sy="#PCDATA",CT=it(St(/\(/,dr,Sy,it(dr,/\|/,dr,Lf),"*",dr,/\)\*/),"|",St(/\(/,dr,Sy,dr,/\)/)),ST=/[?*+]?/,TT=St(/\([^>]+\)/,ST),kT=it("EMPTY","|","ANY","|",CT,"|",TT),DT="<!ELEMENT",PT=St(DT,$t,it(Lf,"|",Hh),$t,it(kT,"|",Hh),dr,">"),RT=St("NOTATION",$t,/\(/,dr,_i,it(dr,/\|/,dr,_i),"*",dr,/\)/),IT=St(/\(/,dr,Ey,it(dr,/\|/,dr,Ey),"*",dr,/\)/),NT=it(RT,"|",IT),MT=it(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",NT),LT=it(/#REQUIRED|#IMPLIED/,"|",it(it("#FIXED",$t),"?",vT)),OT=it($t,_i,$t,MT,$t,LT),FT="<!ATTLIST",BT=St(FT,$t,_i,OT,"*",dr,">"),vb="about:legacy-compat",zT=it('"'+vb+'"',"|","'"+vb+"'"),Zb="SYSTEM",Fg="PUBLIC",Bg=it(it(Zb,$t,$h),"|",it(Fg,$t,Og,$t,$h)),jT=St("^",it(it(Zb,$t,"(?<SystemLiteralOnly>",$h,")"),"|",it(Fg,$t,"(?<PubidLiteral>",Og,")",$t,"(?<SystemLiteral>",$h,")"))),UT=it($t,"NDATA",$t,_i),HT=it(Yb,"|",it(Bg,UT,"?")),Mx="<!ENTITY",$T=St(Mx,$t,_i,$t,HT,dr,">"),VT=it(Yb,"|",Bg),GT=St(Mx,$t,"%",$t,_i,$t,VT,dr,">"),qT=it($T,"|",GT),WT=St(Fg,$t,Og),XT=St("<!NOTATION",$t,_i,$t,it(Bg,"|",WT),dr,">"),Kb=St(dr,"=",dr),Ty=/1[.]\d+/,YT=St($t,"version",Kb,it("'",Ty,"'","|",'"',Ty,'"')),ky=/[A-Za-z][-A-Za-z0-9._]*/,ZT=it($t,"encoding",Kb,it('"',ky,'"',"|","'",ky,"'")),KT=it($t,"standalone",Kb,it("'",it("yes","|","no"),"'","|",'"',it("yes","|","no"),'"')),QT=St(/^<\?xml/,YT,ZT,"?",KT,"?",dr,/\?>/),JT="<!DOCTYPE",ek="<![CDATA[",tk="]]>",rk=/<!\[CDATA\[/,nk=/\]\]>/,ik=St($l,"*?",nk),sk=St(rk,ik);gt.chars=Hl;gt.chars_without=kc;gt.detectUnicodeSupport=Rx;gt.reg=St;gt.regg=it;gt.ABOUT_LEGACY_COMPAT=vb;gt.ABOUT_LEGACY_COMPAT_SystemLiteral=zT;gt.AttlistDecl=BT;gt.CDATA_START=ek;gt.CDATA_END=tk;gt.CDSect=sk;gt.Char=$l;gt.Comment=_T;gt.COMMENT_START=Ix;gt.COMMENT_END=Nx;gt.DOCTYPE_DECL_START=JT;gt.elementdecl=PT;gt.EntityDecl=qT;gt.EntityValue=Yb;gt.ExternalID=Bg;gt.ExternalID_match=jT;gt.Name=_i;gt.NotationDecl=XT;gt.Reference=Uh;gt.PEReference=Hh;gt.PI=ET;gt.PUBLIC=Fg;gt.PubidLiteral=Og;gt.QName=Lf;gt.QName_exact=xT;gt.QName_group=AT;gt.S=$t;gt.SChar_s=pT;gt.S_OPT=dr;gt.SYSTEM=Zb;gt.SystemLiteral=$h;gt.UNICODE_REPLACEMENT_CHARACTER=fT;gt.UNICODE_SUPPORT=Mf;gt.XMLDecl=QT;var xi=br,ws=xi.find,ak=xi.hasDefaultHTMLNamespace,Dc=xi.hasOwn,ok=xi.isHTMLMimeType,lk=xi.isHTMLRawTextElement,uk=xi.isHTMLVoidElement,Ch=xi.MIME_TYPE,xs=xi.NAMESPACE,Cn=Symbol(),Lx=go,et=Lx.DOMException,ck=Lx.DOMExceptionName,es=gt;function On(i){if(i!==Cn)throw new TypeError("Illegal constructor")}function hk(i){return i!==""}function dk(i){return i?i.split(/[\t\n\f\r ]+/).filter(hk):[]}function fk(i,e){return Dc(i,e)||(i[e]=!0),i}function Dy(i){if(!i)return[];var e=dk(i);return Object.keys(e.reduce(fk,{}))}function pk(i){return function(e){return i&&i.indexOf(e)!==-1}}function Ox(i){if(!es.QName_exact.test(i))throw new et(et.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+i+'"')}function yb(i,e){Ox(e),i=i||null;var t=null,r=e;if(e.indexOf(":")>=0){var n=e.split(":");t=n[0],r=n[1]}if(t!==null&&i===null)throw new et(et.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&i!==xi.NAMESPACE.XML)throw new et(et.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&i!==xi.NAMESPACE.XMLNS)throw new et(et.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(i===xi.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new et(et.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[i,t,r]}function Lc(i,e){for(var t in i)Dc(i,t)&&(e[t]=i[t])}function Fn(i,e){var t=i.prototype;if(!(t instanceof e)){let r=function(){};r.prototype=e.prototype,r=new r,Lc(t,r),i.prototype=t=r}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var Bn={},Gi=Bn.ELEMENT_NODE=1,Pc=Bn.ATTRIBUTE_NODE=2,tg=Bn.TEXT_NODE=3,Fx=Bn.CDATA_SECTION_NODE=4,Bx=Bn.ENTITY_REFERENCE_NODE=5,gk=Bn.ENTITY_NODE=6,zx=Bn.PROCESSING_INSTRUCTION_NODE=7,jx=Bn.COMMENT_NODE=8,Vh=Bn.DOCUMENT_NODE=9,Ux=Bn.DOCUMENT_TYPE_NODE=10,oo=Bn.DOCUMENT_FRAGMENT_NODE=11,mk=Bn.NOTATION_NODE=12,fr=xi.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Hx(i,e){if(e.length<i.length)return Hx(e,i);var t=null;for(var r in i){if(i[r]!==e[r])return t;t=i[r]}return t}function Py(i){return i.guid||(i.guid=Math.random()),i.guid}function Mr(){}Mr.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i){for(var e=[],t=0;t<this.length;t++)fu(this[t],e,i);return e.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};Mr.prototype[Symbol.iterator]=function(){var i=this,e=0;return{next:function(){return e<i.length?{value:i[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Bl(i,e){this._node=i,this._refresh=e,zg(this)}function zg(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(eA(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var r=t.length;r in i;r++)Dc(i,r)&&delete i[r];Lc(t,i),i._inc=e}}Bl.prototype.item=function(i){return zg(this),this[i]||null};Fn(Bl,Mr);function Rc(){}function $x(i,e){for(var t=0;t<i.length;){if(i[t]===e)return t;t++}}function bk(i,e,t,r){if(r?e[$x(e,r)]=t:(e[e.length]=t,e.length++),i){t.ownerElement=i;var n=i.ownerDocument;n&&(r&&qx(n,i,r),vk(n,i,t))}}function Ry(i,e,t){var r=$x(e,t);if(r>=0){for(var n=e.length-1;r<=n;)e[r]=e[++r];if(e.length=n,i){var s=i.ownerDocument;s&&qx(s,i,t),t.ownerElement=null}}}Rc.prototype={length:0,item:Mr.prototype.item,getNamedItem:function(i){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(i=i.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===i)return t;e++}return null},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!==this._ownerElement)throw new et(et.INUSE_ATTRIBUTE_ERR);var t=this.getNamedItemNS(i.namespaceURI,i.localName);return t===i?i:(bk(this._ownerElement,this,i,t),t)},setNamedItemNS:function(i){return this.setNamedItem(i)},removeNamedItem:function(i){var e=this.getNamedItem(i);if(!e)throw new et(et.NOT_FOUND_ERR,i);return Ry(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);if(!t)throw new et(et.NOT_FOUND_ERR,i?i+" : "+e:e);return Ry(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){i||(i=null);for(var t=0;t<this.length;){var r=this[t];if(r.localName===e&&r.namespaceURI===i)return r;t++}return null}};Rc.prototype[Symbol.iterator]=function(){var i=this,e=0;return{next:function(){return e<i.length?{value:i[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Vx(){}Vx.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var r=Ch.XML_APPLICATION;i===xs.HTML?r=Ch.XML_XHTML_APPLICATION:i===xs.SVG&&(r=Ch.XML_SVG_IMAGE);var n=new lo(Cn,{contentType:r});if(n.implementation=this,n.childNodes=new Mr,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(i,e);n.appendChild(s)}return n},createDocumentType:function(i,e,t,r){Ox(i);var n=new Hg(Cn);return n.name=i,n.nodeName=i,n.publicId=e||"",n.systemId=t||"",n.internalSubset=r||"",n.childNodes=new Mr,n},createHTMLDocument:function(i){var e=new lo(Cn,{contentType:Ch.HTML});if(e.implementation=this,e.childNodes=new Mr,i!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var r=e.createElement("head");if(t.appendChild(r),typeof i=="string"){var n=e.createElement("title");n.appendChild(e.createTextNode(i)),r.appendChild(n)}t.appendChild(e.createElement("body"))}return e}};function It(i){On(i)}It.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var i=this.getRootNode();return i&&i.nodeType===i.DOCUMENT_NODE},contains:function(i){if(!i)return!1;var e=i;do{if(this===e)return!0;e=i.parentNode}while(e);return!1},getRootNode:function(i){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(i){if(!i||this.nodeType!==i.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==i.name||this.publicId!==i.publicId||this.systemId!==i.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==i.namespaceURI||this.prefix!==i.prefix||this.localName!==i.localName||this.attributes.length!==i.attributes.length)return!1;for(var e=0;e<this.attributes.length;e++){var t=this.attributes.item(e);if(!t.isEqualNode(i.getAttributeNodeNS(t.namespaceURI,t.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==i.namespaceURI||this.localName!==i.localName||this.value!==i.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==i.target||this.data!==i.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==i.data)return!1;break}if(this.childNodes.length!==i.childNodes.length)return!1;for(var e=0;e<this.childNodes.length;e++)if(!this.childNodes[e].isEqualNode(i.childNodes[e]))return!1;return!0},isSameNode:function(i){return this===i},insertBefore:function(i,e){return rg(this,i,e)},replaceChild:function(i,e){rg(this,i,e,Zx),e&&this.removeChild(e)},removeChild:function(i){return Xx(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return wb(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==tg&&i.nodeType==tg?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var r in t)if(Dc(t,r)&&t[r]===i)return r}e=e.nodeType==Pc?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Dc(t,i))return t[i];e=e.nodeType==Pc?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null},compareDocumentPosition:function(i){if(this===i)return 0;var e=i,t=this,r=null,n=null;if(e instanceof Vl&&(r=e,e=r.ownerElement),t instanceof Vl&&(n=t,t=n.ownerElement,r&&e&&t===e))for(var s=0,a;a=t.attributes[s];s++){if(a===r)return fr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+fr.DOCUMENT_POSITION_PRECEDING;if(a===n)return fr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+fr.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return fr.DOCUMENT_POSITION_DISCONNECTED+fr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Py(t.ownerDocument)>Py(e.ownerDocument)?fr.DOCUMENT_POSITION_FOLLOWING:fr.DOCUMENT_POSITION_PRECEDING);if(n&&e===t)return fr.DOCUMENT_POSITION_CONTAINS+fr.DOCUMENT_POSITION_PRECEDING;if(r&&e===t)return fr.DOCUMENT_POSITION_CONTAINED_BY+fr.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!n&&l===t)return fr.DOCUMENT_POSITION_CONTAINED_BY+fr.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var c=[],h=t.parentNode;h;){if(!r&&h===e)return fr.DOCUMENT_POSITION_CONTAINS+fr.DOCUMENT_POSITION_PRECEDING;c.push(h),h=h.parentNode}c.reverse();var d=Hx(o,c);for(var p in d.childNodes){var g=d.childNodes[p];if(g===t)return fr.DOCUMENT_POSITION_FOLLOWING;if(g===e)return fr.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(g)>=0)return fr.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(g)>=0)return fr.DOCUMENT_POSITION_PRECEDING}return 0}};function Gx(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}Lc(Bn,It);Lc(Bn,It.prototype);Lc(fr,It);Lc(fr,It.prototype);function kh(i,e){if(e(i))return!0;if(i=i.firstChild)do if(kh(i,e))return!0;while(i=i.nextSibling)}function lo(i,e){On(i);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||Ch.XML_APPLICATION,this.type=ok(this.contentType)?"html":"xml"}function vk(i,e,t){i&&i._inc++;var r=t.namespaceURI;r===xs.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function qx(i,e,t,r){i&&i._inc++;var n=t.namespaceURI;n===xs.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Wx(i,e,t){if(i&&i._inc){i._inc++;var r=e.childNodes;if(t&&!t.nextSibling)r[r.length++]=t;else{for(var n=e.firstChild,s=0;n;)r[s++]=n,n=n.nextSibling;r.length=s,delete r[r.length]}}}function Xx(i,e){if(i!==e.parentNode)throw new et(et.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,r=e.nextSibling;return t?t.nextSibling=r:i.firstChild=r,r?r.previousSibling=t:i.lastChild=t,Wx(i.ownerDocument,i),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function yk(i){return i&&(i.nodeType===It.DOCUMENT_NODE||i.nodeType===It.DOCUMENT_FRAGMENT_NODE||i.nodeType===It.ELEMENT_NODE)}function wk(i){return i&&(i.nodeType===It.CDATA_SECTION_NODE||i.nodeType===It.COMMENT_NODE||i.nodeType===It.DOCUMENT_FRAGMENT_NODE||i.nodeType===It.DOCUMENT_TYPE_NODE||i.nodeType===It.ELEMENT_NODE||i.nodeType===It.PROCESSING_INSTRUCTION_NODE||i.nodeType===It.TEXT_NODE)}function uo(i){return i&&i.nodeType===It.DOCUMENT_TYPE_NODE}function la(i){return i&&i.nodeType===It.ELEMENT_NODE}function Yx(i){return i&&i.nodeType===It.TEXT_NODE}function Iy(i,e){var t=i.childNodes||[];if(ws(t,la)||uo(e))return!1;var r=ws(t,uo);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function Ny(i,e){var t=i.childNodes||[];function r(s){return la(s)&&s!==e}if(ws(t,r))return!1;var n=ws(t,uo);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function xk(i,e,t){if(!yk(i))throw new et(et.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new et(et.NOT_FOUND_ERR,"child not in parent");if(!wk(e)||uo(e)&&i.nodeType!==It.DOCUMENT_NODE)throw new et(et.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function Ak(i,e,t){var r=i.childNodes||[],n=e.childNodes||[];if(e.nodeType===It.DOCUMENT_FRAGMENT_NODE){var s=n.filter(la);if(s.length>1||ws(n,Yx))throw new et(et.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Iy(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(la(e)&&!Iy(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(uo(e)){if(ws(r,uo))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=ws(r,la);if(t&&r.indexOf(a)<r.indexOf(t))throw new et(et.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new et(et.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Zx(i,e,t){var r=i.childNodes||[],n=e.childNodes||[];if(e.nodeType===It.DOCUMENT_FRAGMENT_NODE){var s=n.filter(la);if(s.length>1||ws(n,Yx))throw new et(et.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Ny(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(la(e)&&!Ny(i,t))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(uo(e)){if(ws(r,function(l){return uo(l)&&l!==t}))throw new et(et.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=ws(r,la);if(t&&r.indexOf(a)<r.indexOf(t))throw new et(et.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function rg(i,e,t,r){xk(i,e,t),i.nodeType===It.DOCUMENT_NODE&&(r||Ak)(i,e,t);var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===oo){var s=e.firstChild;if(s==null)return e;var a=e.lastChild}else s=a=e;var o=t?t.previousSibling:i.lastChild;s.previousSibling=o,a.nextSibling=t,o?o.nextSibling=s:i.firstChild=s,t==null?i.lastChild=a:t.previousSibling=a;do s.parentNode=i;while(s!==a&&(s=s.nextSibling));return Wx(i.ownerDocument||i,i,e),e.nodeType==oo&&(e.firstChild=e.lastChild=null),e}lo.prototype={implementation:null,nodeName:"#document",nodeType:Vh,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType===oo){for(var t=i.firstChild;t;){var r=t.nextSibling;this.insertBefore(t,e),t=r}return i}return rg(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===Gi&&(this.documentElement=i),i},removeChild:function(i){var e=Xx(this,i);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(i,e){rg(this,i,e,Zx),i.ownerDocument=this,e&&this.removeChild(e),la(i)&&(this.documentElement=i)},importNode:function(i,e){return Jx(this,i,e)},getElementById:function(i){var e=null;return kh(this.documentElement,function(t){if(t.nodeType==Gi&&t.getAttribute("id")==i)return e=t,!0}),e},createElement:function(i){var e=new co(Cn);e.ownerDocument=this,this.type==="html"&&(i=i.toLowerCase()),ak(this.contentType)&&(e.namespaceURI=xs.HTML),e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Mr;var t=e.attributes=new Rc;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Ff(Cn);return i.ownerDocument=this,i.childNodes=new Mr,i},createTextNode:function(i){var e=new Of(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.appendData(i),e},createComment:function(i){var e=new jg(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.appendData(i),e},createCDATASection:function(i){var e=new Ug(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Vg(Cn);return t.ownerDocument=this,t.childNodes=new Mr,t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){if(!es.QName_exact.test(i))throw new et(et.INVALID_CHARACTER_ERR,'invalid character in name "'+i+'"');return this.type==="html"&&(i=i.toLowerCase()),this._createAttribute(i)},_createAttribute:function(i){var e=new Vl(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){if(!es.Name.test(i))throw new et(et.INVALID_CHARACTER_ERR,'not a valid xml name "'+i+'"');if(this.type==="html")throw new et("document is an html document",ck.NotSupportedError);var e=new $g(Cn);return e.ownerDocument=this,e.childNodes=new Mr,e.nodeName=i,e},createElementNS:function(i,e){var t=yb(i,e),r=new co(Cn),n=r.attributes=new Rc;return r.childNodes=new Mr,r.ownerDocument=this,r.nodeName=e,r.tagName=e,r.namespaceURI=t[0],r.prefix=t[1],r.localName=t[2],n._ownerElement=r,r},createAttributeNS:function(i,e){var t=yb(i,e),r=new Vl(Cn);return r.ownerDocument=this,r.childNodes=new Mr,r.nodeName=e,r.name=e,r.specified=!0,r.namespaceURI=t[0],r.prefix=t[1],r.localName=t[2],r}};Fn(lo,It);function co(i){On(i),this._nsMap=Object.create(null)}co.prototype={nodeType:Gi,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===xs.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(i){return!!this.getAttributeNode(i)},getAttribute:function(i){var e=this.getAttributeNode(i);return e?e.value:null},getAttributeNode:function(i){return this._isInHTMLDocumentAndNamespace()&&(i=i.toLowerCase()),this.attributes.getNamedItem(i)},setAttribute:function(i,e){this._isInHTMLDocumentAndNamespace()&&(i=i.toLowerCase());var t=this.getAttributeNode(i);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(i),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t?t.value:null},setAttributeNS:function(i,e,t){var r=yb(i,e),n=r[2],s=this.getAttributeNodeNS(i,n);s?s.value=s.nodeValue=""+t:(s=this.ownerDocument.createAttributeNS(i,e),s.value=s.nodeValue=""+t,this.setAttributeNode(s))},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByClassName:function(i){var e=Dy(i);return new Bl(this,function(t){var r=[];return e.length>0&&kh(t,function(n){if(n!==t&&n.nodeType===Gi){var s=n.getAttribute("class");if(s){var a=i===s;if(!a){var o=Dy(s);a=e.every(pk(o))}a&&r.push(n)}}}),r})},getElementsByTagName:function(i){var e=(this.nodeType===Vh?this:this.ownerDocument).type==="html",t=i.toLowerCase();return new Bl(this,function(r){var n=[];return kh(r,function(s){if(!(s===r||s.nodeType!==Gi))if(i==="*")n.push(s);else{var a=s.getQualifiedName(),o=e&&s.namespaceURI===xs.HTML?t:i;a===o&&n.push(s)}}),n})},getElementsByTagNameNS:function(i,e){return new Bl(this,function(t){var r=[];return kh(t,function(n){n!==t&&n.nodeType===Gi&&(i==="*"||n.namespaceURI===i)&&(e==="*"||n.localName==e)&&r.push(n)}),r})}};lo.prototype.getElementsByClassName=co.prototype.getElementsByClassName;lo.prototype.getElementsByTagName=co.prototype.getElementsByTagName;lo.prototype.getElementsByTagNameNS=co.prototype.getElementsByTagNameNS;Fn(co,It);function Vl(i){On(i),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Vl.prototype.nodeType=Pc;Fn(Vl,It);function Oc(i){On(i)}Oc.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var r=this.data.substring(0,i),n=this.data.substring(i+e);t=r+t+n,this.nodeValue=this.data=t,this.length=t.length}};Fn(Oc,It);function Of(i){On(i)}Of.prototype={nodeName:"#text",nodeType:tg,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};Fn(Of,Oc);function jg(i){On(i)}jg.prototype={nodeName:"#comment",nodeType:jx};Fn(jg,Oc);function Ug(i){On(i)}Ug.prototype={nodeName:"#cdata-section",nodeType:Fx};Fn(Ug,Of);function Hg(i){On(i)}Hg.prototype.nodeType=Ux;Fn(Hg,It);function Qb(i){On(i)}Qb.prototype.nodeType=mk;Fn(Qb,It);function Jb(i){On(i)}Jb.prototype.nodeType=gk;Fn(Jb,It);function $g(i){On(i)}$g.prototype.nodeType=Bx;Fn($g,It);function Ff(i){On(i)}Ff.prototype.nodeName="#document-fragment";Ff.prototype.nodeType=oo;Fn(Ff,It);function Vg(i){On(i)}Vg.prototype.nodeType=zx;Fn(Vg,Oc);function Kx(){}Kx.prototype.serializeToString=function(i,e){return Qx.call(i,e)};It.prototype.toString=Qx;function Qx(i){var e=[],t=this.nodeType===Vh&&this.documentElement||this,r=t.prefix,n=t.namespaceURI;if(n&&r==null){var r=t.lookupPrefix(n);if(r==null)var s=[{namespace:n,prefix:null}]}return fu(this,e,i,s),e.join("")}function My(i,e,t){var r=i.prefix||"",n=i.namespaceURI;if(!n||r==="xml"&&n===xs.XML||n===xs.XMLNS)return!1;for(var s=t.length;s--;){var a=t[s];if(a.prefix===r)return a.namespace!==n}return!0}function xm(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Gx),'"')}function fu(i,e,t,r){r||(r=[]);var n=i.nodeType===Vh?i:i.ownerDocument,s=n.type==="html";if(t)if(i=t(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case Gi:var a=i.attributes,o=a.length,E=i.firstChild,l=i.tagName,c=l;if(!s&&!i.prefix&&i.namespaceURI){for(var h,d=0;d<a.length;d++)if(a.item(d).name==="xmlns"){h=a.item(d).value;break}if(!h)for(var p=r.length-1;p>=0;p--){var g=r[p];if(g.prefix===""&&g.namespace===i.namespaceURI){h=g.namespace;break}}if(h!==i.namespaceURI)for(var p=r.length-1;p>=0;p--){var g=r[p];if(g.namespace===i.namespaceURI){g.prefix&&(c=g.prefix+":"+l);break}}}e.push("<",c);for(var y=0;y<o;y++){var b=a.item(y);b.prefix=="xmlns"?r.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&r.push({prefix:"",namespace:b.value})}for(var y=0;y<o;y++){var b=a.item(y);if(My(b,s,r)){var w=b.prefix||"",v=b.namespaceURI;xm(e,w?"xmlns:"+w:"xmlns",v),r.push({prefix:w,namespace:v})}fu(b,e,t,r)}if(l===c&&My(i,s,r)){var w=i.prefix||"",v=i.namespaceURI;xm(e,w?"xmlns:"+w:"xmlns",v),r.push({prefix:w,namespace:v})}var A=!E;if(A&&(s||i.namespaceURI===xs.HTML)&&(A=uk(l)),A)e.push("/>");else{if(e.push(">"),s&&lk(l))for(;E;)E.data?e.push(E.data):fu(E,e,t,r.slice()),E=E.nextSibling;else for(;E;)fu(E,e,t,r.slice()),E=E.nextSibling;e.push("</",c,">")}return;case Vh:case oo:for(var E=i.firstChild;E;)fu(E,e,t,r.slice()),E=E.nextSibling;return;case Pc:return xm(e,i.name,i.value);case tg:return e.push(i.data.replace(/[<&>]/g,Gx));case Fx:return e.push(es.CDATA_START,i.data,es.CDATA_END);case jx:return e.push(es.COMMENT_START,i.data,es.COMMENT_END);case Ux:var _=i.publicId,C=i.systemId;e.push(es.DOCTYPE_DECL_START," ",i.name),_?(e.push(" ",es.PUBLIC," ",_),C&&C!=="."&&e.push(" ",C)):C&&C!=="."&&e.push(" ",es.SYSTEM," ",C),i.internalSubset&&e.push(" [",i.internalSubset,"]"),e.push(">");return;case zx:return e.push("<?",i.target," ",i.data,"?>");case Bx:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Jx(i,e,t){var r;switch(e.nodeType){case Gi:r=e.cloneNode(!1),r.ownerDocument=i;case oo:break;case Pc:t=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=i,r.parentNode=null,t)for(var n=e.firstChild;n;)r.appendChild(Jx(i,n,t)),n=n.nextSibling;return r}function wb(i,e,t){var r=new e.constructor(Cn);for(var n in e)if(Dc(e,n)){var s=e[n];typeof s!="object"&&s!=r[n]&&(r[n]=s)}switch(e.childNodes&&(r.childNodes=new Mr),r.ownerDocument=i,r.nodeType){case Gi:var a=e.attributes,o=r.attributes=new Rc,l=a.length;o._ownerElement=r;for(var c=0;c<l;c++)r.setAttributeNode(wb(i,a.item(c),!0));break;case Pc:t=!0}if(t)for(var h=e.firstChild;h;)r.appendChild(wb(i,h,t)),h=h.nextSibling;return r}function eA(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case Gi:case oo:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(Bl.prototype,"length",{get:function(){return zg(this),this.$$length}}),Object.defineProperty(It.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case Gi:case oo:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),eA=function(e,t,r){e["$$"+t]=r}}}catch{}vr._updateLiveList=zg;vr.Attr=Vl;vr.CDATASection=Ug;vr.CharacterData=Oc;vr.Comment=jg;vr.Document=lo;vr.DocumentFragment=Ff;vr.DocumentType=Hg;vr.DOMImplementation=Vx;vr.Element=co;vr.Entity=Jb;vr.EntityReference=$g;vr.LiveNodeList=Bl;vr.NamedNodeMap=Rc;vr.Node=It;vr.NodeList=Mr;vr.Notation=Qb;vr.Text=Of;vr.ProcessingInstruction=Vg;vr.XMLSerializer=Kx;var Fc={},tA={};(function(i){var e=br.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
42
42
  `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(tA);var Gg={},Bc=br,dt=gt,rA=go,Ek=Bc.isHTMLEscapableRawTextElement,_k=Bc.isHTMLMimeType,Ck=Bc.isHTMLRawTextElement,Gh=Bc.hasOwn,Ly=Bc.NAMESPACE,Oy=rA.ParseError,Sk=rA.DOMException,eh=0,ba=1,eu=2,th=3,tu=4,ru=5,rh=6,lp=7;function nA(){}nA.prototype={parse:function(i,e,t){var r=this.domBuilder;r.startDocument(),iA(e,e=Object.create(null)),Tk(i,e,t,r,this.errorHandler),r.endDocument()}};var ev=/&#?\w+;?/g;function Tk(i,e,t,r,n){var s=_k(r.mimeType);i.indexOf(dt.UNICODE_REPLACEMENT_CHARACTER)>=0&&n.warning("Unicode replacement character detected, source encoding issues?");function a(K){if(K>65535){K-=65536;var be=55296+(K>>10),te=56320+(K&1023);return String.fromCharCode(be,te)}else return String.fromCharCode(K)}function o(K){var be=K[K.length-1]===";"?K:K+";";if(!s&&be!==K)return n.error("EntityRef: expecting ;"),K;var te=dt.Reference.exec(be);if(!te||te[0].length!==be.length)return n.error("entity not matching Reference production: "+K),K;var j=be.slice(1,-1);return Gh(t,j)?t[j]:j.charAt(0)==="#"?a(parseInt(j.substring(1).replace("x","0x"))):(n.error("entity not found:"+K),K)}function l(K){if(K>w){var be=i.substring(w,K).replace(ev,o);p&&g(w),r.characters(be,0,K-w),w=K}}var c=0,h=0,d=/\r\n?|\n|$/g,p=r.locator;function g(K,be){for(;K>=h&&(be=d.exec(i));)c=h,h=be.index+be[0].length,p.lineNumber++;p.columnNumber=K-c+1}for(var y=[{currentNSMap:e}],b=[],w=0;;){try{var v=i.indexOf("<",w);if(v<0){if(!s&&b.length>0)return n.fatalError("unclosed xml tag(s): "+b.join(", "));if(!i.substring(w).match(/^\s*$/)){var A=r.doc,E=A.createTextNode(i.substring(w));if(A.documentElement)return n.error("Extra content at the end of the document");A.appendChild(E),r.currentElement=E}return}if(v>w){var _=i.substring(w,v);!s&&b.length===0&&(_=_.replace(new RegExp(dt.S_OPT.source,"g"),""),_&&n.error("Unexpected content outside root element: '"+_+"'")),l(v)}switch(i.charAt(v+1)){case"/":var S=i.indexOf(">",v+2),C=i.substring(v+2,S>0?S:void 0);if(!C)return n.fatalError("end tag name missing");var I=S>0&&dt.reg("^",dt.QName_group,dt.S_OPT,"$").exec(C);if(!I)return n.fatalError('end tag name contains invalid characters: "'+C+'"');if(!r.currentElement&&!r.doc.documentElement)return;var k=b[b.length-1]||r.currentElement.tagName||r.doc.documentElement.tagName||"";if(k!==I[1]){var D=I[1].toLowerCase();if(!s||k.toLowerCase()!==D)return n.fatalError('Opening and ending tag mismatch: "'+k+'" != "'+C+'"')}var R=y.pop();b.pop();var z=R.localNSMap;if(r.endElement(R.uri,R.localName,k),z)for(var G in z)Gh(z,G)&&r.endPrefixMapping(G);S++;break;case"?":p&&g(v),S=Rk(i,v,r,n);break;case"!":p&&g(v),S=aA(i,v,r,n,s);break;default:p&&g(v);var O=new oA,X=y[y.length-1].currentNSMap,S=kk(i,v,O,X,o,n,s),J=O.length;if(O.closed||(s&&Bc.isHTMLVoidElement(O.tagName)?O.closed=!0:b.push(O.tagName)),p&&J){for(var Y=Fy(p,{}),W=0;W<J;W++){var fe=O[W];g(fe.offset),fe.locator=Fy(p,{})}r.locator=Y,By(O,r,X)&&y.push(O),r.locator=p}else By(O,r,X)&&y.push(O);s&&!O.closed?S=Dk(i,S,O.tagName,o,r):S++}}catch(K){if(K instanceof Oy)throw K;if(K instanceof Sk)throw new Oy(K.name+": "+K.message,r.locator,K);n.error("element parse error: "+K),S=-1}S>w?w=S:l(Math.max(v,w)+1)}}function Fy(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function kk(i,e,t,r,n,s,a){function o(g,y,b){if(Gh(t.attributeNames,g))return s.fatalError("Attribute "+g+" redefined");if(!a&&y.indexOf("<")>=0)return s.fatalError("Unescaped '<' not allowed in attributes values");t.addValue(g,y.replace(/[\t\n\r]/g," ").replace(ev,n),b)}for(var l,c,h=++e,d=eh;;){var p=i.charAt(h);switch(p){case"=":if(d===ba)l=i.slice(e,h),d=th;else if(d===eu)d=th;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===th||d===ba)if(d===ba&&(s.warning('attribute value must after "="'),l=i.slice(e,h)),e=h+1,h=i.indexOf(p,e),h>0)c=i.slice(e,h),o(l,c,e-1),d=ru;else throw new Error("attribute value no end '"+p+"' match");else if(d==tu)c=i.slice(e,h),o(l,c,e),s.warning('attribute "'+l+'" missed start quot('+p+")!!"),e=h+1,d=ru;else throw new Error('attribute value must after "="');break;case"/":switch(d){case eh:t.setTagName(i.slice(e,h));case ru:case rh:case lp:d=lp,t.closed=!0;case tu:case ba:break;case eu:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),d==eh&&t.setTagName(i.slice(e,h)),h;case">":switch(d){case eh:t.setTagName(i.slice(e,h));case ru:case rh:case lp:break;case tu:case ba:c=i.slice(e,h),c.slice(-1)==="/"&&(t.closed=!0,c=c.slice(0,-1));case eu:d===eu&&(c=l),d==tu?(s.warning('attribute "'+c+'" missed quot(")!'),o(l,c,e)):(a||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),o(c,c,e));break;case th:if(!a)return s.fatalError(`AttValue: ' or " expected`)}return h;case"€":p=" ";default:if(p<=" ")switch(d){case eh:t.setTagName(i.slice(e,h)),d=rh;break;case ba:l=i.slice(e,h),d=eu;break;case tu:var c=i.slice(e,h);s.warning('attribute "'+c+'" missed quot(")!!'),o(l,c,e);case ru:d=rh;break}else switch(d){case eu:a||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=h,d=ba;break;case ru:s.warning('attribute space is required"'+l+'"!!');case rh:d=ba,e=h;break;case th:d=tu,e=h;break;case lp:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function By(i,e,t){for(var r=i.tagName,n=null,d=i.length;d--;){var s=i[d],a=s.qName,o=s.value,p=a.indexOf(":");if(p>0)var l=s.prefix=a.slice(0,p),c=a.slice(p+1),h=l==="xmlns"&&c;else c=a,l=null,h=a==="xmlns"&&"";s.localName=c,h!==!1&&(n==null&&(n=Object.create(null),iA(t,t=Object.create(null))),t[h]=n[h]=o,s.uri=Ly.XMLNS,e.startPrefixMapping(h,o))}for(var d=i.length;d--;)s=i[d],s.prefix&&(s.prefix==="xml"&&(s.uri=Ly.XML),s.prefix!=="xmlns"&&(s.uri=t[s.prefix]));var p=r.indexOf(":");p>0?(l=i.prefix=r.slice(0,p),c=i.localName=r.slice(p+1)):(l=null,c=i.localName=r);var g=i.uri=t[l||""];if(e.startElement(g,c,r,i),i.closed){if(e.endElement(g,c,r),n)for(l in n)Gh(n,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=n,!0}function Dk(i,e,t,r,n){var s=Ek(t);if(s||Ck(t)){var a=i.indexOf("</"+t+">",e),o=i.substring(e+1,a);return s&&(o=o.replace(ev,r)),n.characters(o,0,o.length),a}return e+1}function iA(i,e){for(var t in i)Gh(i,t)&&(e[t]=i[t])}function sA(i,e){var t=e;function r(h){return h=h||0,i.charAt(t+h)}function n(h){h=h||1,t+=h}function s(){for(var h=0;t<i.length;){var d=r();if(d!==" "&&d!==`
43
43
  `&&d!==" "&&d!=="\r")return h;h++,n()}return-1}function a(){return i.substring(t)}function o(h){return i.substring(t,t+h.length)===h}function l(h){return i.substring(t,t+h.length).toUpperCase()===h.toUpperCase()}function c(h){var d=dt.reg("^",h),p=d.exec(a());return p?(n(p[0].length),p[0]):null}return{char:r,getIndex:function(){return t},getMatch:c,getSource:function(){return i},skip:n,skipBlanks:s,substringFromIndex:a,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}function Pk(i,e){function t(o,l){var c=dt.PI.exec(o.substringFromIndex());return c?c[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(c[0].length),c[0]):l.fatalError("processing instruction is not well-formed at position "+o.getIndex())}var r=i.getSource();if(i.char()==="["){i.skip(1);for(var n=i.getIndex();i.getIndex()<r.length;){if(i.skipBlanks(),i.char()==="]"){var s=r.substring(n,i.getIndex());return i.skip(1),s}var a=null;if(i.char()==="<"&&i.char(1)==="!")switch(i.char(2)){case"E":i.char(3)==="L"?a=i.getMatch(dt.elementdecl):i.char(3)==="N"&&(a=i.getMatch(dt.EntityDecl));break;case"A":a=i.getMatch(dt.AttlistDecl);break;case"N":a=i.getMatch(dt.NotationDecl);break;case"-":a=i.getMatch(dt.Comment);break}else if(i.char()==="<"&&i.char(1)==="?")a=t(i,e);else if(i.char()==="%")a=i.getMatch(dt.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!a)return e.fatalError("Error in internal subset at position "+i.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function aA(i,e,t,r,n){var s=sA(i,e);switch(n?s.char(2).toUpperCase():s.char(2)){case"-":var a=s.getMatch(dt.Comment);return a?(t.comment(a,dt.COMMENT_START.length,a.length-dt.COMMENT_START.length-dt.COMMENT_END.length),s.getIndex()):r.fatalError("comment is not well-formed at position "+s.getIndex());case"[":var o=s.getMatch(dt.CDSect);return o?!n&&!t.currentElement?r.fatalError("CDATA outside of element"):(t.startCDATA(),t.characters(o,dt.CDATA_START.length,o.length-dt.CDATA_START.length-dt.CDATA_END.length),t.endCDATA(),s.getIndex()):r.fatalError("Invalid CDATA starting at position "+e);case"D":{if(t.doc&&t.doc.documentElement)return r.fatalError("Doctype not allowed inside or after documentElement at position "+s.getIndex());if(n?!s.substringStartsWithCaseInsensitive(dt.DOCTYPE_DECL_START):!s.substringStartsWith(dt.DOCTYPE_DECL_START))return r.fatalError("Expected "+dt.DOCTYPE_DECL_START+" at position "+s.getIndex());if(s.skip(dt.DOCTYPE_DECL_START.length),s.skipBlanks()<1)return r.fatalError("Expected whitespace after "+dt.DOCTYPE_DECL_START+" at position "+s.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=s.getMatch(dt.Name),!l.name)return r.fatalError("doctype name missing or contains unexpected characters at position "+s.getIndex());if(n&&l.name.toLowerCase()!=="html"&&r.warning("Unexpected DOCTYPE in HTML document at position "+s.getIndex()),s.skipBlanks(),s.substringStartsWith(dt.PUBLIC)||s.substringStartsWith(dt.SYSTEM)){var c=dt.ExternalID_match.exec(s.substringFromIndex());if(!c)return r.fatalError("doctype external id is not well-formed at position "+s.getIndex());c.groups.SystemLiteralOnly!==void 0?l.systemId=c.groups.SystemLiteralOnly:(l.systemId=c.groups.SystemLiteral,l.publicId=c.groups.PubidLiteral),s.skip(c[0].length)}else if(n&&s.substringStartsWithCaseInsensitive(dt.SYSTEM)){if(s.skip(dt.SYSTEM.length),s.skipBlanks()<1)return r.fatalError("Expected whitespace after "+dt.SYSTEM+" at position "+s.getIndex());if(l.systemId=s.getMatch(dt.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return r.fatalError("Expected "+dt.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+dt.SYSTEM+" at position "+s.getIndex())}return n&&l.systemId&&!dt.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&r.warning("Unexpected doctype.systemId in HTML document at position "+s.getIndex()),n||(s.skipBlanks(),l.internalSubset=Pk(s,r)),s.skipBlanks(),s.char()!==">"?r.fatalError("doctype not terminated with > at position "+s.getIndex()):(s.skip(1),t.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),t.endDTD(),s.getIndex())}default:return r.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function Rk(i,e,t,r){var n=i.substring(e).match(dt.PI);if(!n)return r.fatalError("Invalid processing instruction starting at position "+e);if(n[1].toLowerCase()==="xml"){if(e>0)return r.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!dt.XMLDecl.test(i.substring(e)))return r.fatalError("xml declaration is not well-formed")}return t.processingInstruction(n[1],n[2]),e+n[0].length}function oA(){this.attributeNames=Object.create(null)}oA.prototype={setTagName:function(i){if(!dt.QName_exact.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!dt.QName_exact.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};Gg.XMLReader=nA;Gg.parseUtils=sA;Gg.parseDoctypeCommentOrCData=aA;var Yl=br,Ik=vr,Nk=go,zy=tA,Mk=Gg,Lk=Ik.DOMImplementation,Ok=Yl.hasDefaultHTMLNamespace,Fk=Yl.isHTMLMimeType,Bk=Yl.isValidMimeType,lA=Yl.MIME_TYPE,Am=Yl.NAMESPACE,jy=Nk.ParseError,zk=Mk.XMLReader;function uA(i){return i.replace(/\r[\n\u0085]/g,`
44
44
  `).replace(/[\r\u0085\u2028\u2029]/g,`
@@ -47,14 +47,14 @@ React keys must be passed directly to JSX without using spread:
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AD(i,e){if(i){if(typeof i=="string")return $y(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?$y(i,e):void 0}}function $y(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function ED(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,n,s,a,o=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(h){c=!0,n=h}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw n}}return o}}function _D(i){if(Array.isArray(i))return i}var dA=Nt,CD=dA.DOMParser,SD=dA.XMLSerializer,TD=Xi,fA=TD.throwXmlTagNotFound,pA=tv,kD=pA.last,DD=pA.first;function PD(i){return/^[ \n\r\t]+$/.test(i)}function RD(i){return{get:function(t){return i==="."?t:t&&t[i]}}}var Em={};function ID(i,e,t){var r;if(Em[e]?r=Em[e]:(r=new RegExp("(<.* ".concat(e,'=")([^"]*)(".*)$')),Em[e]=r),r.test(i))return i.replace(r,"$1".concat(t,"$3"));var n=i.lastIndexOf("/>");return n===-1&&(n=i.lastIndexOf(">")),i.substr(0,n)+" ".concat(e,'="').concat(t,'"')+i.substr(n)}function ND(i,e){var t=i.indexOf(" ".concat(e,'="'));if(t===-1)return null;var r=i.substr(t).search(/["']/)+t,n=i.substr(r+1).search(/["']/)+r;return i.substr(r+1,n-r)}function MD(i,e){return i.indexOf(e,i.length-e.length)!==-1}function LD(i,e){return i.substring(0,e.length)===e}function OD(i){for(var e=[],t={},r=[],n=0,s=i.length;n<s;++n)t[i[n]]?e.push(i[n]):(t[i[n]]=!0,r.push(i[n]));return e}function FD(i){for(var e={},t=[],r=0,n=i.length;r<n;++r)e[i[r]]||(e[i[r]]=!0,t.push(i[r]));return t}function BD(i,e){for(var t=[[]],r=0;r<i.length;r++){var n=i[r],s=t[t.length-1],a=e(n);a==="start"?t.push([n]):a==="end"?(s.push(n),t.push([])):s.push(n)}for(var o=[],l=0;l<t.length;l++){var c=t[l];c.length>0&&o.push(c)}return o}function zD(){return{errorLogging:"json",stripInvalidXMLChars:!1,paragraphLoop:!1,nullGetter:function(e){return e.module?"":"undefined"},xmlFileNames:["[Content_Types].xml"],parser:RD,linebreaks:!1,fileTypeConfig:null,delimiters:{start:"{",end:"}"},syntax:{changeDelimiterPrefix:"="}}}function jD(i){return new SD().serializeToString(i).replace(/xmlns(:[a-z0-9]+)?="" ?/g,"")}function UD(i){return i.charCodeAt(0)===65279&&(i=i.substr(1)),new CD().parseFromString(i,"text/xml")}var gA=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&apos;"]],Xh=gA.map(function(i){var e=wD(i,2),t=e[0],r=e[1];return{rstart:new RegExp(r,"g"),rend:new RegExp(t,"g"),start:r,end:t}});function HD(i){for(var e=Xh.length-1;e>=0;e--){var t=Xh[e];i=i.replace(t.rstart,t.end)}return i}function $D(i){var e;(e=i)!==null&&e!==void 0&&e.toString?i=i.toString():i="";for(var t,r=0,n=Xh.length;r<n;r++)t=Xh[r],i=i.replace(t.rend,t.start);return i}function VD(i){for(var e=[],t=0;t<i.length;t++)for(var r=i[t],n=0;n<r.length;n++){var s=r[n];e.push(s)}return e}function GD(i,e){if(!e)return i;for(var t=0,r=e.length;t<r;t++)i.push(e[t]);return i}var qD=new RegExp(" ","g");function WD(i){return i.replace(qD," ")}function XD(i,e){for(var t=[],r;(r=i.exec(e))!=null;)t.push({array:r,offset:r.index});return t}function nv(i,e){return i==="</"+e+">"}function iv(i,e){return i.indexOf("<"+e)===0&&[">"," ","/"].indexOf(i[e.length+1])!==-1}function YD(i,e,t){var r=mA(i,e,t);if(r!==null)return r;fA({position:"right",element:e,parsed:i,index:t})}function mA(i,e,t){typeof e=="string"&&(e=[e]);for(var r=1,n=t,s=i.length;n<s;n++)for(var a=i[n],o=0,l=e;o<l.length;o++){var c=l[o];if(nv(a.value,c)&&r--,iv(a.value,c)&&r++,r===0)return n}return null}function ZD(i,e,t){var r=bA(i,e,t);if(r!==null)return r;fA({position:"left",element:e,parsed:i,index:t})}function bA(i,e,t){typeof e=="string"&&(e=[e]);for(var r=1,n=t;n>=0;n--)for(var s=i[n],a=0,o=e;a<o.length;a++){var l=o[a];if(iv(s.value,l)&&r--,nv(s.value,l)&&r++,r===0)return n}return null}function KD(i,e){var t=e.type,r=e.tag,n=e.position;return t==="tag"&&r===i&&(n==="start"||n==="selfclosing")}function QD(i,e){var t=e.type,r=e.tag,n=e.position;return t==="tag"&&r===i&&n==="end"}function JD(i){var e=i.type,t=i.tag,r=i.position;return["w:p","a:p","text:p"].indexOf(t)!==-1&&e==="tag"&&r==="start"}function eP(i){var e=i.type,t=i.tag,r=i.position;return["w:p","a:p","text:p"].indexOf(t)!==-1&&e==="tag"&&r==="end"}function tP(i){var e=i.type,t=i.position,r=i.text;return r&&e==="tag"&&t==="start"}function rP(i){var e=i.type,t=i.position,r=i.text;return r&&e==="tag"&&t==="end"}function nP(i){var e=i.type,t=i.position;return e==="placeholder"||e==="content"&&t==="insidetag"}function iP(i,e){var t=i.module,r=i.type;return e instanceof Array||(e=[e]),r==="placeholder"&&e.indexOf(t)!==-1}var xb=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function sP(i){return xb.lastIndex=0,xb.test(i)}function aP(i){return typeof i!="string"&&(i=String(i)),i.replace(xb,"")}function oP(i){var e={};for(var t in i){var r=i[t];e[r]||(e[r]=[]),e[r].push(t)}return e}function lP(i,e){return i.map(function(t,r){return{item:t,index:r}}).sort(function(t,r){return e(t.item,r.item)||t.index-r.index}).map(function(t){var r=t.item;return r})}var Fr={endsWith:MD,startsWith:LD,isContent:nP,isParagraphStart:JD,isParagraphEnd:eP,isTagStart:KD,isTagEnd:QD,isTextStart:tP,isTextEnd:rP,isStarting:iv,isEnding:nv,isModule:iP,uniq:FD,getDuplicates:OD,chunkBy:BD,last:kD,first:DD,xml2str:jD,str2xml:UD,getRightOrNull:mA,getRight:YD,getLeftOrNull:bA,getLeft:ZD,pregMatchAll:XD,convertSpaces:WD,charMapRegexes:Xh,hasCorruptCharacters:sP,removeCorruptCharacters:aP,getDefaults:zD,wordToUtf8:HD,utf8ToWord:$D,concatArrays:VD,pushArray:GD,invertMap:oP,charMap:gA,getSingleAttribute:ND,setSingleAttribute:ID,isWhiteSpace:PD,stableSort:lP};function uP(i,e){return fP(i)||dP(i,e)||hP(i,e)||cP()}function cP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hP(i,e){if(i){if(typeof i=="string")return Vy(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Vy(i,e):void 0}}function Vy(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function dP(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,n,s,a,o=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(h){c=!0,n=h}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw n}}return o}}function fP(i){if(Array.isArray(i))return i}function en(i){"@babel/helpers - typeof";return en=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en(i)}function pP(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function gP(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,bP(r.key),r)}}function mP(i,e,t){return t&&gP(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function bP(i){var e=vP(i,"string");return en(e)=="symbol"?e:e+""}function vP(i,e){if(en(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(en(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var yP=function(){function i(){pP(this,i)}return mP(i,null,[{key:"createSchema",value:function(t){var r={validate:t,optional:function(){return i.createSchema(function(s){return s===void 0?{success:!0,value:s}:t(s)})},nullable:function(){return i.createSchema(function(s){return s==null?{success:!0,value:s}:t(s)})}};return r}},{key:"string",value:function(){return i.createSchema(function(t){return typeof t!="string"?{success:!1,error:"Expected string, received ".concat(en(t))}:{success:!0,value:t}})}},{key:"date",value:function(){return i.createSchema(function(t){return t instanceof Date?{success:!0,value:t}:{success:!1,error:"Expected date, received ".concat(en(t))}})}},{key:"boolean",value:function(){return i.createSchema(function(t){return typeof t!="boolean"?{success:!1,error:"Expected boolean, received ".concat(en(t))}:{success:!0,value:t}})}},{key:"number",value:function(){return i.createSchema(function(t){return typeof t!="number"?{success:!1,error:"Expected number, received ".concat(en(t))}:{success:!0,value:t}})}},{key:"function",value:function(){return i.createSchema(function(t){return typeof t!="function"?{success:!1,error:"Expected function, received ".concat(en(t))}:{success:!0,value:t}})}},{key:"array",value:function(t){return i.createSchema(function(r){if(!Array.isArray(r))return{success:!1,error:"Expected array, received ".concat(en(r))};for(var n=0;n<r.length;n++){var s=t.validate(r[n]);if(!s.success)return{success:!1,error:"".concat(s.error," at index ").concat(n)}}return{success:!0,value:r}})}},{key:"any",value:function(){return i.createSchema(function(t){return{success:!0,value:t}})}},{key:"isRegex",value:function(){return i.createSchema(function(t){return t instanceof RegExp?{success:!0,value:t}:{success:!1,error:"Expected RegExp, received ".concat(en(t))}})}},{key:"union",value:function(t){return i.createSchema(function(r){for(var n=0;n<t.length;n++){var s=t[n],a=s.validate(r);if(a.success)return a}return{success:!1,error:"Value ".concat(r," does not match any schema in union")}})}},{key:"object",value:function(t){var r=i.createSchema(function(n){if(n==null)return{success:!1,error:"Expected object, received ".concat(n)};if(en(n)!=="object")return{success:!1,error:"Expected object, received ".concat(en(n))};for(var s=0,a=Object.entries(t);s<a.length;s++){var o=uP(a[s],2),l=o[0],c=o[1],h=c.validate(n[l]);if(!h.success)return{success:!1,error:"".concat(h.error," at ").concat(l)}}return{success:!0,value:n}});return r.strict=function(){return i.createSchema(function(n){var s=r.validate(n);if(!s.success)return s;var a=Object.keys(n).filter(function(o){return!(o in t)});return a.length>0?{success:!1,error:"Unexpected properties: ".concat(a.join(", "))}:s})},r}},{key:"record",value:function(t){return i.createSchema(function(r){if(r===null)return{success:!1,error:"Expected object, received null"};if(en(r)!=="object")return{success:!1,error:"Expected object, received ".concat(en(r))};for(var n=0,s=Object.keys(r);n<s.length;n++){var a=s[n];if(typeof a!="string")return{success:!1,error:"Expected string key, received ".concat(en(a)," at ").concat(a)};var o=t.validate(r[a]);if(!o.success)return{success:!1,error:"".concat(o.error," at key ").concat(a)}}return{success:!0,value:r}})}}])}(),wP=yP,_m,Gy;function xP(){if(Gy)return _m;Gy=1;var i=Fr,e=i.str2xml,t="_rels/.rels";function r(n){for(var s=n.files[t],a=s?e(s.asText()):null,o=a?a.getElementsByTagName("Relationship"):[],l={},c=0;c<o.length;c++){var h=o[c];l[h.getAttribute("Target")]=h.getAttribute("Type")}return l}return _m={getRelsTypes:r},_m}var Cm,qy;function AP(){if(qy)return Cm;qy=1;var i=Fr,e=i.str2xml,t="[Content_Types].xml";function r(s,a,o){for(var l={},c=0;c<s.length;c++){var h=s[c],d=h.getAttribute("ContentType"),p=h.getAttribute("PartName").substr(1);l[p]=d}for(var g=function(){var w=a[y],v=w.getAttribute("ContentType"),A=w.getAttribute("Extension");o.file(/./).map(function(E){var _=E.name;_.slice(_.length-A.length)===A&&!l[_]&&_!==t&&(l[_]=v)})},y=0;y<a.length;y++)g();return l}function n(s){var a=s.files[t],o=a?e(a.asText()):null,l=o?o.getElementsByTagName("Override"):null,c=o?o.getElementsByTagName("Default"):null;return{overrides:l,defaults:c,contentTypes:a,contentTypeXml:o}}return Cm={collectContentTypes:r,getContentTypes:n},Cm}var Sm,Wy;function Kl(){if(Wy)return Sm;Wy=1;var i=Xi,e=i.XTInternalError;function t(){}function r(n){return n}return Sm=function(n){var s={set:t,matchers:function(){return[]},parse:t,render:t,getTraits:t,getFileType:t,nullGetter:t,optionsTransformer:r,postrender:r,errorsTransformer:r,getRenderedMap:r,preparse:r,postparse:r,on:t,resolve:t,preResolve:t};if(Object.keys(s).every(function(l){return!n[l]})){var a=new e("This module cannot be wrapped, because it doesn't define any of the necessary functions");throw a.properties={id:"module_cannot_be_wrapped",explanation:"This module cannot be wrapped, because it doesn't define any of the necessary functions"},a}for(var o in s)n[o]||(n[o]=s[o]);return n},Sm}var Tm,Xy;function sv(){if(Xy)return Tm;Xy=1;function i(j){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ie){return typeof ie}:function(ie){return ie&&typeof Symbol=="function"&&ie.constructor===Symbol&&ie!==Symbol.prototype?"symbol":typeof ie},i(j)}function e(j){return n(j)||r(j)||o(j)||t()}function t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
49
49
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(j){if(typeof Symbol<"u"&&j[Symbol.iterator]!=null||j["@@iterator"]!=null)return Array.from(j)}function n(j){if(Array.isArray(j))return l(j)}function s(j,ie){return h(j)||c(j,ie)||o(j,ie)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(j,ie){if(j){if(typeof j=="string")return l(j,ie);var ae={}.toString.call(j).slice(8,-1);return ae==="Object"&&j.constructor&&(ae=j.constructor.name),ae==="Map"||ae==="Set"?Array.from(j):ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ae)?l(j,ie):void 0}}function l(j,ie){(ie==null||ie>j.length)&&(ie=j.length);for(var ae=0,H=Array(ie);ae<ie;ae++)H[ae]=j[ae];return H}function c(j,ie){var ae=j==null?null:typeof Symbol<"u"&&j[Symbol.iterator]||j["@@iterator"];if(ae!=null){var H,se,le,oe,ce=[],Ae=!0,Se=!1;try{if(le=(ae=ae.call(j)).next,ie!==0)for(;!(Ae=(H=le.call(ae)).done)&&(ce.push(H.value),ce.length!==ie);Ae=!0);}catch(Ne){Se=!0,se=Ne}finally{try{if(!Ae&&ae.return!=null&&(oe=ae.return(),Object(oe)!==oe))return}finally{if(Se)throw se}}return ce}}function h(j){if(Array.isArray(j))return j}function d(j,ie){var ae=Object.keys(j);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(j);ie&&(H=H.filter(function(se){return Object.getOwnPropertyDescriptor(j,se).enumerable})),ae.push.apply(ae,H)}return ae}function p(j){for(var ie=1;ie<arguments.length;ie++){var ae=arguments[ie]!=null?arguments[ie]:{};ie%2?d(Object(ae),!0).forEach(function(H){g(j,H,ae[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(ae)):d(Object(ae)).forEach(function(H){Object.defineProperty(j,H,Object.getOwnPropertyDescriptor(ae,H))})}return j}function g(j,ie,ae){return(ie=y(ie))in j?Object.defineProperty(j,ie,{value:ae,enumerable:!0,configurable:!0,writable:!0}):j[ie]=ae,j}function y(j){var ie=b(j,"string");return i(ie)=="symbol"?ie:ie+""}function b(j,ie){if(i(j)!="object"||!j)return j;var ae=j[Symbol.toPrimitive];if(ae!==void 0){var H=ae.call(j,ie);if(i(H)!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ie==="string"?String:Number)(j)}var w=Fr,v=w.getRightOrNull,A=w.getRight,E=w.getLeft,_=w.getLeftOrNull,C=w.chunkBy,I=w.isTagStart,k=w.isTagEnd,D=w.isContent,R=w.last,z=w.first,G=Xi,O=G.XTTemplateError,X=G.throwExpandNotFound,S=G.getLoopPositionProducesInvalidXMLError;function J(j,ie){if(j.length===0)return!1;var ae=R(j).substr(1);return ae.indexOf(ie)===0}function Y(j){for(var ie=[],ae=0;ae<j.length;ae++){var H=j[ae],se=H.position,le=H.value,oe=H.tag;oe&&(se==="end"?J(ie,oe)?ie.pop():ie.push(le):se==="start"&&ie.push(le))}return ie}function W(j,ie){for(var ae=0;ae<ie.length;ae++){var H=ie[ae];if(H.indexOf("<".concat(j))===0)return!0}return!1}function fe(j,ie,ae){var H=j.slice(ie[0].offset,ie[1].offset),se=Y(H),le=se.filter(function(Ne){return Ne[1]==="/"}).length,oe=se.filter(function(Ne){return Ne[1]!=="/"&&Ne[Ne.length-2]!=="/"}).length;if(le!==oe)return{error:S({tag:z(ie).part.value,offset:[z(ie).part.offset,R(ie).part.offset]})};for(var ce=function(){var Te=ae[Se],x=Te.contains,U=Te.expand,B=Te.onlyTextInTag;if(W(x,se)){if(B){var F=_(j,x,ie[0].offset),M=v(j,x,ie[1].offset);if(F===null||M===null)return 0;var q=C(j.slice(F,M),function(De){return I(x,De)?"start":k(x,De)?"end":null}),de=z(q),we=R(q),ee=de.filter(D),Ee=we.filter(D);if(ee.length!==1||Ee.length!==1)return 0}return{v:{value:U}}}},Ae,Se=0;Se<ae.length;Se++)if(Ae=ce(),Ae!==0&&Ae)return Ae.v;return{}}function K(j,ie,ae,H){var se=j.expandTo||H.expandTo;if(se){var le,oe;try{oe=E(ae,se,ie),le=A(ae,se,ie)}catch(Se){var ce=p({part:j,rootError:Se,postparsed:ae,expandTo:se,index:ie},H.error);if(H.onError){var Ae=H.onError(ce);if(Ae==="ignore")return}X(ce)}return[oe,le]}}function be(j,ie,ae,H){var se=s(j,2),le=se[0],oe=se[1],ce=ae.indexOf(ie),Ae=ae.slice(le,ce),Se=ae.slice(ce+1,oe+1),Ne=H.getInner({postparse:H.postparse,index:ce,part:ie,leftParts:Ae,rightParts:Se,left:le,right:oe,postparsed:ae});return Ne.length||(Ne.expanded=[Ae,Se],Ne=[Ne]),{left:le,right:oe,inner:Ne}}function te(j,ie){var ae=[];j.errors&&(ae=j.errors,j=j.postparsed);for(var H=[],se=0,le=j.length;se<le;se++){var oe=j[se];if(oe.type==="placeholder"&&oe.module===ie.moduleName&&!oe.subparsed&&!oe.expanded)try{var ce=K(oe,se,j,ie);if(!ce)continue;var Ae=s(ce,2),Se=Ae[0],Ne=Ae[1];H.push({left:Se,right:Ne,part:oe,i:se,leftPart:j[Se],rightPart:j[Ne]})}catch(we){ae.push(we)}}H.sort(function(we,ee){return we.left===ee.left?ee.part.lIndex<we.part.lIndex?1:-1:ee.left<we.left?1:-1});for(var Te=-1,x=0,U=0,B=H.length;U<B;U++){var F,M=H[U];if(Te=Math.max(Te,U>0?H[U-1].right:0),!(M.left<Te)){var q=void 0;try{q=be([M.left+x,M.right+x],M.part,j,ie)}catch(we){if(ie.onError){var de=ie.onError(p({part:M.part,rootError:we,postparsed:j,expandOne:be},ie.errors));if(de==="ignore")continue}if(we instanceof O)ae.push(we);else throw we}q&&(x+=q.inner.length-(q.right+1-q.left),(F=j).splice.apply(F,[q.left,q.right+1-q.left].concat(e(q.inner))))}}return{postparsed:j,errors:ae}}return Tm={expandToOne:te,getExpandToDefault:fe},Tm}var km,Yy;function av(){if(Yy)return km;Yy=1;var i="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",e="application/vnd.ms-word.document.macroEnabled.main+xml",t="application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml",r="application/vnd.ms-word.template.macroEnabledTemplate.main+xml",n="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",s="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",a="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",o="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",l="application/vnd.openxmlformats-officedocument.presentationml.slide+xml",c="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",h="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",d="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",p="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",g="application/vnd.ms-excel.sheet.macroEnabled.main+xml",y="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",b=[i,e,t,r],w={main:b,docx:[n].concat(b,[o,s,a]),pptx:[l,c,h,d],xlsx:[p,g,y]};return km=w,km}var Dm,Zy;function vA(){if(Zy)return Dm;Zy=1;var i="application/vnd.openxmlformats-package.core-properties+xml",e="application/vnd.openxmlformats-officedocument.extended-properties+xml",t="application/vnd.openxmlformats-officedocument.custom-properties+xml",r="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",n="application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml",s="application/vnd.ms-office.drawingml.diagramDrawing+xml";return Dm={settingsContentType:r,coreContentType:i,appContentType:e,customContentType:t,diagramDataContentType:n,diagramDrawingContentType:s},Dm}var Pm,Ky;function EP(){if(Ky)return Pm;Ky=1;function i(E){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},i(E)}function e(E,_){if(!(E instanceof _))throw new TypeError("Cannot call a class as a function")}function t(E,_){for(var C=0;C<_.length;C++){var I=_[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(E,n(I.key),I)}}function r(E,_,C){return _&&t(E.prototype,_),Object.defineProperty(E,"prototype",{writable:!1}),E}function n(E){var _=s(E,"string");return i(_)=="symbol"?_:_+""}function s(E,_){if(i(E)!="object"||!E)return E;var C=E[Symbol.toPrimitive];if(C!==void 0){var I=C.call(E,_);if(i(I)!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}var a=Fr,o=a.pushArray,l=Kl(),c=av(),h=vA(),d=h.settingsContentType,p=h.coreContentType,g=h.appContentType,y=h.customContentType,b=h.diagramDataContentType,w=h.diagramDrawingContentType,v=[d,p,g,y,b,w],A=function(){function E(){e(this,E),this.name="Common"}return r(E,[{key:"getFileType",value:function(C){var I=C.doc,k=I.invertedContentTypes;if(k){for(var D=0;D<v.length;D++){var R=v[D];k[R]&&o(I.targets,k[R])}for(var z=["docx","pptx","xlsx"],G,O=0;O<z.length;O++){for(var X=z[O],S=c[X],J=0;J<S.length;J++){var Y=S[J];if(k[Y])for(var W=0,fe=k[Y];W<fe.length;W++){var K=fe[W];I.relsTypes[K]&&["http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"].indexOf(I.relsTypes[K])===-1||(G=X,(c.main.indexOf(Y)!==-1||Y===c.pptx[0])&&(I.textTarget||(I.textTarget=K)),G!=="xlsx"&&I.targets.push(K))}}if(G)return G}return G}}}])}();return Pm=function(){return l(new A)},Pm}var Rm,Qy;function _P(){if(Qy)return Rm;Qy=1;function i(w){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},i(w)}function e(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function t(w,v){for(var A=0;A<v.length;A++){var E=v[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,n(E.key),E)}}function r(w,v,A){return v&&t(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),w}function n(w){var v=s(w,"string");return i(v)=="symbol"?v:v+""}function s(w,v){if(i(w)!="object"||!w)return w;var A=w[Symbol.toPrimitive];if(A!==void 0){var E=A.call(w,v);if(i(E)!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var a=Xi,o=a.getScopeParserExecutionError,l=tv,c=l.last,h=Fr,d=h.concatArrays;function p(w,v){for(var A=w.length>>>0,E,_=0;_<A;_++)if(E=w[_],v.call(this,E,_,w))return E}function g(w,v,A){var E=this,_=this.scopeList[A];if(this.root.finishedResolving){for(var C=this.resolved,I=function(){var O=E.scopeLindex[k];C=p(C,function(X){return X.lIndex===O}),C=C.value[E.scopePathItem[k]]},k=this.resolveOffset,D=this.scopePath.length;k<D;k++)I();return p(C,function(G){return v.part.lIndex===G.lIndex}).value}var R,z;!this.cachedParsers||!v.part?z=this.parser(w,{tag:v.part,scopePath:this.scopePath}):this.cachedParsers[v.part.lIndex]?z=this.cachedParsers[v.part.lIndex]:z=this.cachedParsers[v.part.lIndex]=this.parser(w,{tag:v.part,scopePath:this.scopePath});try{R=z.get(_,this.getContext(v,A))}catch(G){throw o({tag:w,scope:_,error:G,offset:v.part.offset})}return R==null&&A>0?g.call(this,w,v,A-1):R}function y(w,v,A){var E=this,_=this.scopeList[A],C;return!this.cachedParsers||!v.part?C=this.parser(w,{tag:v.part,scopePath:this.scopePath}):this.cachedParsers[v.part.lIndex]?C=this.cachedParsers[v.part.lIndex]:C=this.cachedParsers[v.part.lIndex]=this.parser(w,{tag:v.part,scopePath:this.scopePath}),Promise.resolve().then(function(){return C.get(_,E.getContext(v,A))}).catch(function(I){throw o({tag:w,scope:_,error:I,offset:v.part.offset})}).then(function(I){return I==null&&A>0?y.call(E,w,v,A-1):I})}var b=function(){function w(v){e(this,w),this.root=v.root||this,this.resolveOffset=v.resolveOffset||0,this.scopePath=v.scopePath,this.scopePathItem=v.scopePathItem,this.scopePathLength=v.scopePathLength,this.scopeList=v.scopeList,this.scopeType="",this.scopeTypes=v.scopeTypes,this.scopeLindex=v.scopeLindex,this.parser=v.parser,this.resolved=v.resolved,this.cachedParsers=v.cachedParsers}return r(w,[{key:"loopOver",value:function(A,E,_,C){return this.loopOverValue(this.getValue(A,C),E,_)}},{key:"functorIfInverted",value:function(A,E,_,C,I){return A&&E(_,C,I),A}},{key:"isValueFalsy",value:function(A,E){return A==null||!A||E==="[object Array]"&&A.length===0}},{key:"loopOverValue",value:function(A,E,_){this.root.finishedResolving&&(_=!1);var C=Object.prototype.toString.call(A);if(this.isValueFalsy(A,C))return this.scopeType=!1,this.functorIfInverted(_,E,c(this.scopeList),0,1);if(C==="[object Array]"){this.scopeType="array";for(var I=0;I<A.length;I++)this.functorIfInverted(!_,E,A[I],I,A.length);return!0}return C==="[object Object]"?(this.scopeType="object",this.functorIfInverted(!_,E,A,0,1)):this.functorIfInverted(!_,E,c(this.scopeList),0,1)}},{key:"getValue",value:function(A,E){var _=g.call(this,A,E,this.scopeList.length-1);return typeof _=="function"?_(this.scopeList[this.scopeList.length-1],this):_}},{key:"getValueAsync",value:function(A,E){var _=this;return y.call(this,A,E,this.scopeList.length-1).then(function(C){return typeof C=="function"?C(_.scopeList[_.scopeList.length-1],_):C})}},{key:"getContext",value:function(A,E){return{num:E,meta:A,scopeList:this.scopeList,resolved:this.resolved,scopePath:this.scopePath,scopeTypes:this.scopeTypes,scopePathItem:this.scopePathItem,scopePathLength:this.scopePathLength}}},{key:"createSubScopeManager",value:function(A,E,_,C,I){return new w({root:this.root,resolveOffset:this.resolveOffset,resolved:this.resolved,parser:this.parser,cachedParsers:this.cachedParsers,scopeTypes:d([this.scopeTypes,[this.scopeType]]),scopeList:d([this.scopeList,[A]]),scopePath:d([this.scopePath,[E]]),scopePathItem:d([this.scopePathItem,[_]]),scopePathLength:d([this.scopePathLength,[I]]),scopeLindex:d([this.scopeLindex,[C.lIndex]])})}}])}();return Rm=function(w){return w.scopePath=[],w.scopePathItem=[],w.scopePathLength=[],w.scopeTypes=[],w.scopeLindex=[],w.scopeList=[w.tags],new b(w)},Rm}var Im,Jy;function yA(){if(Jy)return Im;Jy=1;function i(H){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},i(H)}function e(H,se){return a(H)||s(H,se)||r(H,se)||t()}function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
51
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(H,se){if(H){if(typeof H=="string")return n(H,se);var le={}.toString.call(H).slice(8,-1);return le==="Object"&&H.constructor&&(le=H.constructor.name),le==="Map"||le==="Set"?Array.from(H):le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le)?n(H,se):void 0}}function n(H,se){(se==null||se>H.length)&&(se=H.length);for(var le=0,oe=Array(se);le<se;le++)oe[le]=H[le];return oe}function s(H,se){var le=H==null?null:typeof Symbol<"u"&&H[Symbol.iterator]||H["@@iterator"];if(le!=null){var oe,ce,Ae,Se,Ne=[],Te=!0,x=!1;try{if(Ae=(le=le.call(H)).next,se!==0)for(;!(Te=(oe=Ae.call(le)).done)&&(Ne.push(oe.value),Ne.length!==se);Te=!0);}catch(U){x=!0,ce=U}finally{try{if(!Te&&le.return!=null&&(Se=le.return(),Object(Se)!==Se))return}finally{if(x)throw ce}}return Ne}}function a(H){if(Array.isArray(H))return H}function o(H,se){var le=Object.keys(H);if(Object.getOwnPropertySymbols){var oe=Object.getOwnPropertySymbols(H);se&&(oe=oe.filter(function(ce){return Object.getOwnPropertyDescriptor(H,ce).enumerable})),le.push.apply(le,oe)}return le}function l(H){for(var se=1;se<arguments.length;se++){var le=arguments[se]!=null?arguments[se]:{};se%2?o(Object(le),!0).forEach(function(oe){c(H,oe,le[oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(le)):o(Object(le)).forEach(function(oe){Object.defineProperty(H,oe,Object.getOwnPropertyDescriptor(le,oe))})}return H}function c(H,se,le){return(se=h(se))in H?Object.defineProperty(H,se,{value:le,enumerable:!0,configurable:!0,writable:!0}):H[se]=le,H}function h(H){var se=d(H,"string");return i(se)=="symbol"?se:se+""}function d(H,se){if(i(H)!="object"||!H)return H;var le=H[Symbol.toPrimitive];if(le!==void 0){var oe=le.call(H,se);if(i(oe)!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(H)}var p=Xi,g=p.getUnclosedTagException,y=p.getUnopenedTagException,b=p.getDuplicateOpenTagException,w=p.getDuplicateCloseTagException,v=p.throwMalformedXml,A=p.throwXmlInvalid,E=p.XTTemplateError,_=Fr,C=_.isTextStart,I=_.isTextEnd,k=_.wordToUtf8,D=_.pushArray,R=0,z=1,G=2,O=3;function X(H,se){return H[0]<=se.offset&&se.offset<H[1]}function S(H,se){return C(H)?(se&&v(),!0):I(H)?(se||v(),!1):se}function J(H){var se="",le=1,oe=H.indexOf(" ");return H[H.length-2]==="/"?(se="selfclosing",oe===-1&&(oe=H.length-2)):H[1]==="/"?(le=2,se="end",oe===-1&&(oe=H.length-1)):(se="start",oe===-1&&(oe=H.length-1)),{tag:H.slice(le,oe),position:se}}function Y(H,se,le){for(var oe=0,ce=H.length,Ae={},Se=0;Se<se.length;Se++){var Ne=se[Se];Ae[Ne]=!0}for(var Te=0;Te<le.length;Te++){var x=le[Te];Ae[x]=!1}for(var U=[];oe<ce&&(oe=H.indexOf("<",oe),oe!==-1);){var B=oe,F=H.indexOf("<",oe+1);oe=H.indexOf(">",oe),(oe===-1||F!==-1&&oe>F)&&A(H,B);var M=H.slice(B,oe+1),q=J(M),de=q.tag,we=q.position,ee=Ae[de];ee!=null&&U.push({type:"tag",position:we,text:ee,offset:B,value:M,tag:de})}return U}function W(H,se,le){var oe=[],ce=!1,Ae={offset:0},Se,Ne=H.reduce(function(x,U){var B=U.position,F=U.offset,M=Ae.offset,q=Ae.length;if(Se=se.substr(M,F-M),ce&&B==="start"){if(M+q===F&&(Se=se.substr(M,F-M+q+4),!le.allowUnclosedTag))return oe.push(b({xtag:Se,offset:M})),Ae=U,x.push(l(l({},U),{},{error:!0})),x;if(!le.allowUnclosedTag)return oe.push(g({xtag:k(Se),offset:M})),Ae=U,x.push(l(l({},U),{},{error:!0})),x;x.pop()}return!ce&&B==="end"?le.allowUnopenedTag?x:M+q===F?(Se=se.substr(M-4,F-M+q+4),oe.push(w({xtag:Se,offset:M})),Ae=U,x.push(l(l({},U),{},{error:!0})),x):(oe.push(y({xtag:Se,offset:F})),Ae=U,x.push(l(l({},U),{},{error:!0})),x):(ce=B==="start",Ae=U,x.push(U),x)},[]);if(ce){var Te=Ae.offset;Se=se.substr(Te,se.length-Te),le.allowUnclosedTag?Ne.pop():oe.push(g({xtag:k(Se),offset:Te}))}return{delimiterWithErrors:Ne,errors:oe}}function fe(H,se){return H===-1&&se===-1?R:H===se?z:H===-1||se===-1?se<H?G:O:H<se?G:O}function K(H){var se=H.split(" ");if(se.length!==2){var le=new E("New Delimiters cannot be parsed");throw le.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},le}var oe=e(se,2),ce=oe[0],Ae=oe[1];if(ce.length===0||Ae.length===0){var Se=new E("New Delimiters cannot be parsed");throw Se.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},Se}return[ce,Ae]}function be(H,se,le){var oe=[],ce=se.start,Ae=se.end,Se=-1,Ne=!1;if(ce==null&&Ae==null)return[];for(;;){var Te=H.indexOf(ce,Se+1),x=H.indexOf(Ae,Se+1),U=null,B=void 0,F=fe(Te,x);switch(F===z&&(F=Ne?O:G),F){case R:return oe;case O:Ne=!1,Se=x,U="end",B=Ae.length;break;case G:Ne=!0,Se=Te,U="start",B=ce.length;break}if(le.changeDelimiterPrefix&&F===G&&H[Se+ce.length]===le.changeDelimiterPrefix){oe.push({offset:Te,position:"start",length:ce.length,changedelimiter:!0});var M=H.indexOf(le.changeDelimiterPrefix,Se+ce.length+1),q=H.indexOf(Ae,M+1);oe.push({offset:q,position:"end",length:Ae.length,changedelimiter:!0});var de=H.substr(Se+ce.length+1,M-Se-ce.length-1),we=K(de),ee=e(we,2);ce=ee[0],Ae=ee[1],Se=q;continue}oe.push({offset:Se,position:U,length:B})}}function te(H,se,le){var oe=H.map(function(M){return M.value}).join(""),ce=be(oe,se,le),Ae=0,Se=H.map(function(M){return Ae+=M.value.length,{offset:Ae-M.value.length,lIndex:M.lIndex}}),Ne=W(ce,oe,le),Te=Ne.delimiterWithErrors,x=Ne.errors,U=0,B=0,F=Se.map(function(M,q){for(var de=M.offset,we=[de,de+H[q].value.length],ee=H[q].value,Ee=[];B<Te.length&&X(we,Te[B]);)Ee.push(Te[B]),B++;var De=[],Ce=0;U>0&&(Ce=U,U=0);for(var Me=0;Me<Ee.length;Me++){var $e=Ee[Me],Xe=ee.substr(Ce,$e.offset-de-Ce);if($e.changedelimiter){$e.position==="start"?Xe.length>0&&De.push({type:"content",value:Xe}):Ce=$e.offset-de+$e.length;continue}Xe.length>0&&(De.push({type:"content",value:Xe}),Ce+=Xe.length);var Tt={type:"delimiter",position:$e.position,offset:Ce+de};De.push(Tt),Ce=$e.offset-de+$e.length}U=Ce-ee.length;var nr=ee.substr(Ce);return nr.length>0&&De.push({type:"content",value:nr}),De},this);return{parsed:F,errors:x}}function j(H){return H.type==="content"&&H.position==="insidetag"}function ie(H){return H.filter(j)}function ae(H,se){for(var le=!1,oe=0;oe<H.length;oe++){var ce=H[oe];le=S(ce,le),ce.type==="content"&&(ce.position=le?"insidetag":"outsidetag"),se!=="text"&&j(ce)&&(ce.value=ce.value.replace(/>/g,"&gt;"))}}return Im={parseDelimiters:te,parse:function(se,le,oe,ce){ae(se,ce);for(var Ae=te(ie(se),le,oe),Se=Ae.parsed,Ne=Ae.errors,Te=[],x=0,U=0,B=0;B<se.length;B++){var F=se[B];if(j(F)){for(var M=0,q=Se[x];M<q.length;M++){var de=q[M];de.type==="content"&&(de.position="insidetag"),de.lIndex=U++}D(Te,Se[x]),x++}else F.lIndex=U++,Te.push(F)}return{errors:Ne,lexed:Te}},xmlparse:function(se,le){for(var oe=Y(se,le.text,le.other),ce=0,Ae=[],Se=0;Se<oe.length;Se++){var Ne=oe[Se];se.length>ce&&Ne.offset-ce>0&&Ae.push({type:"content",value:se.substr(ce,Ne.offset-ce)}),ce=Ne.offset+Ne.value.length,delete Ne.offset,Ae.push(Ne)}return se.length>ce&&Ae.push({type:"content",value:se.substr(ce)}),Ae}},Im}var Nm,e2;function CP(){if(e2)return Nm;e2=1;function i(l){return n(l)||r(l)||t(l)||e()}function e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(j,ie){if(j){if(typeof j=="string")return l(j,ie);var ae={}.toString.call(j).slice(8,-1);return ae==="Object"&&j.constructor&&(ae=j.constructor.name),ae==="Map"||ae==="Set"?Array.from(j):ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ae)?l(j,ie):void 0}}function l(j,ie){(ie==null||ie>j.length)&&(ie=j.length);for(var ae=0,H=Array(ie);ae<ie;ae++)H[ae]=j[ae];return H}function c(j,ie){var ae=j==null?null:typeof Symbol<"u"&&j[Symbol.iterator]||j["@@iterator"];if(ae!=null){var H,se,le,oe,ce=[],Ae=!0,Se=!1;try{if(le=(ae=ae.call(j)).next,ie!==0)for(;!(Ae=(H=le.call(ae)).done)&&(ce.push(H.value),ce.length!==ie);Ae=!0);}catch(Ne){Se=!0,se=Ne}finally{try{if(!Ae&&ae.return!=null&&(oe=ae.return(),Object(oe)!==oe))return}finally{if(Se)throw se}}return ce}}function h(j){if(Array.isArray(j))return j}function d(j,ie){var ae=Object.keys(j);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(j);ie&&(H=H.filter(function(se){return Object.getOwnPropertyDescriptor(j,se).enumerable})),ae.push.apply(ae,H)}return ae}function p(j){for(var ie=1;ie<arguments.length;ie++){var ae=arguments[ie]!=null?arguments[ie]:{};ie%2?d(Object(ae),!0).forEach(function(H){g(j,H,ae[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(ae)):d(Object(ae)).forEach(function(H){Object.defineProperty(j,H,Object.getOwnPropertyDescriptor(ae,H))})}return j}function g(j,ie,ae){return(ie=y(ie))in j?Object.defineProperty(j,ie,{value:ae,enumerable:!0,configurable:!0,writable:!0}):j[ie]=ae,j}function y(j){var ie=b(j,"string");return i(ie)=="symbol"?ie:ie+""}function b(j,ie){if(i(j)!="object"||!j)return j;var ae=j[Symbol.toPrimitive];if(ae!==void 0){var H=ae.call(j,ie);if(i(H)!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ie==="string"?String:Number)(j)}var w=Fr,v=w.getRightOrNull,A=w.getRight,E=w.getLeft,_=w.getLeftOrNull,C=w.chunkBy,I=w.isTagStart,k=w.isTagEnd,D=w.isContent,R=w.last,z=w.first,G=Xi,O=G.XTTemplateError,X=G.throwExpandNotFound,S=G.getLoopPositionProducesInvalidXMLError;function J(j,ie){if(j.length===0)return!1;var ae=R(j).substr(1);return ae.indexOf(ie)===0}function Y(j){for(var ie=[],ae=0;ae<j.length;ae++){var H=j[ae],se=H.position,le=H.value,oe=H.tag;oe&&(se==="end"?J(ie,oe)?ie.pop():ie.push(le):se==="start"&&ie.push(le))}return ie}function W(j,ie){for(var ae=0;ae<ie.length;ae++){var H=ie[ae];if(H.indexOf("<".concat(j))===0)return!0}return!1}function fe(j,ie,ae){var H=j.slice(ie[0].offset,ie[1].offset),se=Y(H),le=se.filter(function(Ne){return Ne[1]==="/"}).length,oe=se.filter(function(Ne){return Ne[1]!=="/"&&Ne[Ne.length-2]!=="/"}).length;if(le!==oe)return{error:S({tag:z(ie).part.value,offset:[z(ie).part.offset,R(ie).part.offset]})};for(var ce=function(){var Te=ae[Se],x=Te.contains,U=Te.expand,B=Te.onlyTextInTag;if(W(x,se)){if(B){var F=_(j,x,ie[0].offset),M=v(j,x,ie[1].offset);if(F===null||M===null)return 0;var q=C(j.slice(F,M),function(De){return I(x,De)?"start":k(x,De)?"end":null}),de=z(q),ye=R(q),ee=de.filter(D),Ee=ye.filter(D);if(ee.length!==1||Ee.length!==1)return 0}return{v:{value:U}}}},Ae,Se=0;Se<ae.length;Se++)if(Ae=ce(),Ae!==0&&Ae)return Ae.v;return{}}function K(j,ie,ae,H){var se=j.expandTo||H.expandTo;if(se){var le,oe;try{oe=E(ae,se,ie),le=A(ae,se,ie)}catch(Se){var ce=p({part:j,rootError:Se,postparsed:ae,expandTo:se,index:ie},H.error);if(H.onError){var Ae=H.onError(ce);if(Ae==="ignore")return}X(ce)}return[oe,le]}}function be(j,ie,ae,H){var se=s(j,2),le=se[0],oe=se[1],ce=ae.indexOf(ie),Ae=ae.slice(le,ce),Se=ae.slice(ce+1,oe+1),Ne=H.getInner({postparse:H.postparse,index:ce,part:ie,leftParts:Ae,rightParts:Se,left:le,right:oe,postparsed:ae});return Ne.length||(Ne.expanded=[Ae,Se],Ne=[Ne]),{left:le,right:oe,inner:Ne}}function te(j,ie){var ae=[];j.errors&&(ae=j.errors,j=j.postparsed);for(var H=[],se=0,le=j.length;se<le;se++){var oe=j[se];if(oe.type==="placeholder"&&oe.module===ie.moduleName&&!oe.subparsed&&!oe.expanded)try{var ce=K(oe,se,j,ie);if(!ce)continue;var Ae=s(ce,2),Se=Ae[0],Ne=Ae[1];H.push({left:Se,right:Ne,part:oe,i:se,leftPart:j[Se],rightPart:j[Ne]})}catch(ye){ae.push(ye)}}H.sort(function(ye,ee){return ye.left===ee.left?ee.part.lIndex<ye.part.lIndex?1:-1:ee.left<ye.left?1:-1});for(var Te=-1,x=0,U=0,B=H.length;U<B;U++){var F,M=H[U];if(Te=Math.max(Te,U>0?H[U-1].right:0),!(M.left<Te)){var q=void 0;try{q=be([M.left+x,M.right+x],M.part,j,ie)}catch(ye){if(ie.onError){var de=ie.onError(p({part:M.part,rootError:ye,postparsed:j,expandOne:be},ie.errors));if(de==="ignore")continue}if(ye instanceof O)ae.push(ye);else throw ye}q&&(x+=q.inner.length-(q.right+1-q.left),(F=j).splice.apply(F,[q.left,q.right+1-q.left].concat(e(q.inner))))}}return{postparsed:j,errors:ae}}return Tm={expandToOne:te,getExpandToDefault:fe},Tm}var km,Yy;function av(){if(Yy)return km;Yy=1;var i="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",e="application/vnd.ms-word.document.macroEnabled.main+xml",t="application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml",r="application/vnd.ms-word.template.macroEnabledTemplate.main+xml",n="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",s="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",a="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",o="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",l="application/vnd.openxmlformats-officedocument.presentationml.slide+xml",c="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",h="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",d="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",p="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",g="application/vnd.ms-excel.sheet.macroEnabled.main+xml",y="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",b=[i,e,t,r],w={main:b,docx:[n].concat(b,[o,s,a]),pptx:[l,c,h,d],xlsx:[p,g,y]};return km=w,km}var Dm,Zy;function vA(){if(Zy)return Dm;Zy=1;var i="application/vnd.openxmlformats-package.core-properties+xml",e="application/vnd.openxmlformats-officedocument.extended-properties+xml",t="application/vnd.openxmlformats-officedocument.custom-properties+xml",r="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",n="application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml",s="application/vnd.ms-office.drawingml.diagramDrawing+xml";return Dm={settingsContentType:r,coreContentType:i,appContentType:e,customContentType:t,diagramDataContentType:n,diagramDrawingContentType:s},Dm}var Pm,Ky;function EP(){if(Ky)return Pm;Ky=1;function i(E){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},i(E)}function e(E,_){if(!(E instanceof _))throw new TypeError("Cannot call a class as a function")}function t(E,_){for(var C=0;C<_.length;C++){var I=_[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(E,n(I.key),I)}}function r(E,_,C){return _&&t(E.prototype,_),Object.defineProperty(E,"prototype",{writable:!1}),E}function n(E){var _=s(E,"string");return i(_)=="symbol"?_:_+""}function s(E,_){if(i(E)!="object"||!E)return E;var C=E[Symbol.toPrimitive];if(C!==void 0){var I=C.call(E,_);if(i(I)!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}var a=Fr,o=a.pushArray,l=Kl(),c=av(),h=vA(),d=h.settingsContentType,p=h.coreContentType,g=h.appContentType,y=h.customContentType,b=h.diagramDataContentType,w=h.diagramDrawingContentType,v=[d,p,g,y,b,w],A=function(){function E(){e(this,E),this.name="Common"}return r(E,[{key:"getFileType",value:function(C){var I=C.doc,k=I.invertedContentTypes;if(k){for(var D=0;D<v.length;D++){var R=v[D];k[R]&&o(I.targets,k[R])}for(var z=["docx","pptx","xlsx"],G,O=0;O<z.length;O++){for(var X=z[O],S=c[X],J=0;J<S.length;J++){var Y=S[J];if(k[Y])for(var W=0,fe=k[Y];W<fe.length;W++){var K=fe[W];I.relsTypes[K]&&["http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"].indexOf(I.relsTypes[K])===-1||(G=X,(c.main.indexOf(Y)!==-1||Y===c.pptx[0])&&(I.textTarget||(I.textTarget=K)),G!=="xlsx"&&I.targets.push(K))}}if(G)return G}return G}}}])}();return Pm=function(){return l(new A)},Pm}var Rm,Qy;function _P(){if(Qy)return Rm;Qy=1;function i(w){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},i(w)}function e(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function t(w,v){for(var A=0;A<v.length;A++){var E=v[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,n(E.key),E)}}function r(w,v,A){return v&&t(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),w}function n(w){var v=s(w,"string");return i(v)=="symbol"?v:v+""}function s(w,v){if(i(w)!="object"||!w)return w;var A=w[Symbol.toPrimitive];if(A!==void 0){var E=A.call(w,v);if(i(E)!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var a=Xi,o=a.getScopeParserExecutionError,l=tv,c=l.last,h=Fr,d=h.concatArrays;function p(w,v){for(var A=w.length>>>0,E,_=0;_<A;_++)if(E=w[_],v.call(this,E,_,w))return E}function g(w,v,A){var E=this,_=this.scopeList[A];if(this.root.finishedResolving){for(var C=this.resolved,I=function(){var O=E.scopeLindex[k];C=p(C,function(X){return X.lIndex===O}),C=C.value[E.scopePathItem[k]]},k=this.resolveOffset,D=this.scopePath.length;k<D;k++)I();return p(C,function(G){return v.part.lIndex===G.lIndex}).value}var R,z;!this.cachedParsers||!v.part?z=this.parser(w,{tag:v.part,scopePath:this.scopePath}):this.cachedParsers[v.part.lIndex]?z=this.cachedParsers[v.part.lIndex]:z=this.cachedParsers[v.part.lIndex]=this.parser(w,{tag:v.part,scopePath:this.scopePath});try{R=z.get(_,this.getContext(v,A))}catch(G){throw o({tag:w,scope:_,error:G,offset:v.part.offset})}return R==null&&A>0?g.call(this,w,v,A-1):R}function y(w,v,A){var E=this,_=this.scopeList[A],C;return!this.cachedParsers||!v.part?C=this.parser(w,{tag:v.part,scopePath:this.scopePath}):this.cachedParsers[v.part.lIndex]?C=this.cachedParsers[v.part.lIndex]:C=this.cachedParsers[v.part.lIndex]=this.parser(w,{tag:v.part,scopePath:this.scopePath}),Promise.resolve().then(function(){return C.get(_,E.getContext(v,A))}).catch(function(I){throw o({tag:w,scope:_,error:I,offset:v.part.offset})}).then(function(I){return I==null&&A>0?y.call(E,w,v,A-1):I})}var b=function(){function w(v){e(this,w),this.root=v.root||this,this.resolveOffset=v.resolveOffset||0,this.scopePath=v.scopePath,this.scopePathItem=v.scopePathItem,this.scopePathLength=v.scopePathLength,this.scopeList=v.scopeList,this.scopeType="",this.scopeTypes=v.scopeTypes,this.scopeLindex=v.scopeLindex,this.parser=v.parser,this.resolved=v.resolved,this.cachedParsers=v.cachedParsers}return r(w,[{key:"loopOver",value:function(A,E,_,C){return this.loopOverValue(this.getValue(A,C),E,_)}},{key:"functorIfInverted",value:function(A,E,_,C,I){return A&&E(_,C,I),A}},{key:"isValueFalsy",value:function(A,E){return A==null||!A||E==="[object Array]"&&A.length===0}},{key:"loopOverValue",value:function(A,E,_){this.root.finishedResolving&&(_=!1);var C=Object.prototype.toString.call(A);if(this.isValueFalsy(A,C))return this.scopeType=!1,this.functorIfInverted(_,E,c(this.scopeList),0,1);if(C==="[object Array]"){this.scopeType="array";for(var I=0;I<A.length;I++)this.functorIfInverted(!_,E,A[I],I,A.length);return!0}return C==="[object Object]"?(this.scopeType="object",this.functorIfInverted(!_,E,A,0,1)):this.functorIfInverted(!_,E,c(this.scopeList),0,1)}},{key:"getValue",value:function(A,E){var _=g.call(this,A,E,this.scopeList.length-1);return typeof _=="function"?_(this.scopeList[this.scopeList.length-1],this):_}},{key:"getValueAsync",value:function(A,E){var _=this;return y.call(this,A,E,this.scopeList.length-1).then(function(C){return typeof C=="function"?C(_.scopeList[_.scopeList.length-1],_):C})}},{key:"getContext",value:function(A,E){return{num:E,meta:A,scopeList:this.scopeList,resolved:this.resolved,scopePath:this.scopePath,scopeTypes:this.scopeTypes,scopePathItem:this.scopePathItem,scopePathLength:this.scopePathLength}}},{key:"createSubScopeManager",value:function(A,E,_,C,I){return new w({root:this.root,resolveOffset:this.resolveOffset,resolved:this.resolved,parser:this.parser,cachedParsers:this.cachedParsers,scopeTypes:d([this.scopeTypes,[this.scopeType]]),scopeList:d([this.scopeList,[A]]),scopePath:d([this.scopePath,[E]]),scopePathItem:d([this.scopePathItem,[_]]),scopePathLength:d([this.scopePathLength,[I]]),scopeLindex:d([this.scopeLindex,[C.lIndex]])})}}])}();return Rm=function(w){return w.scopePath=[],w.scopePathItem=[],w.scopePathLength=[],w.scopeTypes=[],w.scopeLindex=[],w.scopeList=[w.tags],new b(w)},Rm}var Im,Jy;function yA(){if(Jy)return Im;Jy=1;function i(H){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},i(H)}function e(H,se){return a(H)||s(H,se)||r(H,se)||t()}function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
51
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(H,se){if(H){if(typeof H=="string")return n(H,se);var le={}.toString.call(H).slice(8,-1);return le==="Object"&&H.constructor&&(le=H.constructor.name),le==="Map"||le==="Set"?Array.from(H):le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le)?n(H,se):void 0}}function n(H,se){(se==null||se>H.length)&&(se=H.length);for(var le=0,oe=Array(se);le<se;le++)oe[le]=H[le];return oe}function s(H,se){var le=H==null?null:typeof Symbol<"u"&&H[Symbol.iterator]||H["@@iterator"];if(le!=null){var oe,ce,Ae,Se,Ne=[],Te=!0,x=!1;try{if(Ae=(le=le.call(H)).next,se!==0)for(;!(Te=(oe=Ae.call(le)).done)&&(Ne.push(oe.value),Ne.length!==se);Te=!0);}catch(U){x=!0,ce=U}finally{try{if(!Te&&le.return!=null&&(Se=le.return(),Object(Se)!==Se))return}finally{if(x)throw ce}}return Ne}}function a(H){if(Array.isArray(H))return H}function o(H,se){var le=Object.keys(H);if(Object.getOwnPropertySymbols){var oe=Object.getOwnPropertySymbols(H);se&&(oe=oe.filter(function(ce){return Object.getOwnPropertyDescriptor(H,ce).enumerable})),le.push.apply(le,oe)}return le}function l(H){for(var se=1;se<arguments.length;se++){var le=arguments[se]!=null?arguments[se]:{};se%2?o(Object(le),!0).forEach(function(oe){c(H,oe,le[oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(le)):o(Object(le)).forEach(function(oe){Object.defineProperty(H,oe,Object.getOwnPropertyDescriptor(le,oe))})}return H}function c(H,se,le){return(se=h(se))in H?Object.defineProperty(H,se,{value:le,enumerable:!0,configurable:!0,writable:!0}):H[se]=le,H}function h(H){var se=d(H,"string");return i(se)=="symbol"?se:se+""}function d(H,se){if(i(H)!="object"||!H)return H;var le=H[Symbol.toPrimitive];if(le!==void 0){var oe=le.call(H,se);if(i(oe)!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(H)}var p=Xi,g=p.getUnclosedTagException,y=p.getUnopenedTagException,b=p.getDuplicateOpenTagException,w=p.getDuplicateCloseTagException,v=p.throwMalformedXml,A=p.throwXmlInvalid,E=p.XTTemplateError,_=Fr,C=_.isTextStart,I=_.isTextEnd,k=_.wordToUtf8,D=_.pushArray,R=0,z=1,G=2,O=3;function X(H,se){return H[0]<=se.offset&&se.offset<H[1]}function S(H,se){return C(H)?(se&&v(),!0):I(H)?(se||v(),!1):se}function J(H){var se="",le=1,oe=H.indexOf(" ");return H[H.length-2]==="/"?(se="selfclosing",oe===-1&&(oe=H.length-2)):H[1]==="/"?(le=2,se="end",oe===-1&&(oe=H.length-1)):(se="start",oe===-1&&(oe=H.length-1)),{tag:H.slice(le,oe),position:se}}function Y(H,se,le){for(var oe=0,ce=H.length,Ae={},Se=0;Se<se.length;Se++){var Ne=se[Se];Ae[Ne]=!0}for(var Te=0;Te<le.length;Te++){var x=le[Te];Ae[x]=!1}for(var U=[];oe<ce&&(oe=H.indexOf("<",oe),oe!==-1);){var B=oe,F=H.indexOf("<",oe+1);oe=H.indexOf(">",oe),(oe===-1||F!==-1&&oe>F)&&A(H,B);var M=H.slice(B,oe+1),q=J(M),de=q.tag,ye=q.position,ee=Ae[de];ee!=null&&U.push({type:"tag",position:ye,text:ee,offset:B,value:M,tag:de})}return U}function W(H,se,le){var oe=[],ce=!1,Ae={offset:0},Se,Ne=H.reduce(function(x,U){var B=U.position,F=U.offset,M=Ae.offset,q=Ae.length;if(Se=se.substr(M,F-M),ce&&B==="start"){if(M+q===F&&(Se=se.substr(M,F-M+q+4),!le.allowUnclosedTag))return oe.push(b({xtag:Se,offset:M})),Ae=U,x.push(l(l({},U),{},{error:!0})),x;if(!le.allowUnclosedTag)return oe.push(g({xtag:k(Se),offset:M})),Ae=U,x.push(l(l({},U),{},{error:!0})),x;x.pop()}return!ce&&B==="end"?le.allowUnopenedTag?x:M+q===F?(Se=se.substr(M-4,F-M+q+4),oe.push(w({xtag:Se,offset:M})),Ae=U,x.push(l(l({},U),{},{error:!0})),x):(oe.push(y({xtag:Se,offset:F})),Ae=U,x.push(l(l({},U),{},{error:!0})),x):(ce=B==="start",Ae=U,x.push(U),x)},[]);if(ce){var Te=Ae.offset;Se=se.substr(Te,se.length-Te),le.allowUnclosedTag?Ne.pop():oe.push(g({xtag:k(Se),offset:Te}))}return{delimiterWithErrors:Ne,errors:oe}}function fe(H,se){return H===-1&&se===-1?R:H===se?z:H===-1||se===-1?se<H?G:O:H<se?G:O}function K(H){var se=H.split(" ");if(se.length!==2){var le=new E("New Delimiters cannot be parsed");throw le.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},le}var oe=e(se,2),ce=oe[0],Ae=oe[1];if(ce.length===0||Ae.length===0){var Se=new E("New Delimiters cannot be parsed");throw Se.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},Se}return[ce,Ae]}function be(H,se,le){var oe=[],ce=se.start,Ae=se.end,Se=-1,Ne=!1;if(ce==null&&Ae==null)return[];for(;;){var Te=H.indexOf(ce,Se+1),x=H.indexOf(Ae,Se+1),U=null,B=void 0,F=fe(Te,x);switch(F===z&&(F=Ne?O:G),F){case R:return oe;case O:Ne=!1,Se=x,U="end",B=Ae.length;break;case G:Ne=!0,Se=Te,U="start",B=ce.length;break}if(le.changeDelimiterPrefix&&F===G&&H[Se+ce.length]===le.changeDelimiterPrefix){oe.push({offset:Te,position:"start",length:ce.length,changedelimiter:!0});var M=H.indexOf(le.changeDelimiterPrefix,Se+ce.length+1),q=H.indexOf(Ae,M+1);oe.push({offset:q,position:"end",length:Ae.length,changedelimiter:!0});var de=H.substr(Se+ce.length+1,M-Se-ce.length-1),ye=K(de),ee=e(ye,2);ce=ee[0],Ae=ee[1],Se=q;continue}oe.push({offset:Se,position:U,length:B})}}function te(H,se,le){var oe=H.map(function(M){return M.value}).join(""),ce=be(oe,se,le),Ae=0,Se=H.map(function(M){return Ae+=M.value.length,{offset:Ae-M.value.length,lIndex:M.lIndex}}),Ne=W(ce,oe,le),Te=Ne.delimiterWithErrors,x=Ne.errors,U=0,B=0,F=Se.map(function(M,q){for(var de=M.offset,ye=[de,de+H[q].value.length],ee=H[q].value,Ee=[];B<Te.length&&X(ye,Te[B]);)Ee.push(Te[B]),B++;var De=[],Ce=0;U>0&&(Ce=U,U=0);for(var Me=0;Me<Ee.length;Me++){var $e=Ee[Me],Xe=ee.substr(Ce,$e.offset-de-Ce);if($e.changedelimiter){$e.position==="start"?Xe.length>0&&De.push({type:"content",value:Xe}):Ce=$e.offset-de+$e.length;continue}Xe.length>0&&(De.push({type:"content",value:Xe}),Ce+=Xe.length);var Tt={type:"delimiter",position:$e.position,offset:Ce+de};De.push(Tt),Ce=$e.offset-de+$e.length}U=Ce-ee.length;var nr=ee.substr(Ce);return nr.length>0&&De.push({type:"content",value:nr}),De},this);return{parsed:F,errors:x}}function j(H){return H.type==="content"&&H.position==="insidetag"}function ie(H){return H.filter(j)}function ae(H,se){for(var le=!1,oe=0;oe<H.length;oe++){var ce=H[oe];le=S(ce,le),ce.type==="content"&&(ce.position=le?"insidetag":"outsidetag"),se!=="text"&&j(ce)&&(ce.value=ce.value.replace(/>/g,"&gt;"))}}return Im={parseDelimiters:te,parse:function(se,le,oe,ce){ae(se,ce);for(var Ae=te(ie(se),le,oe),Se=Ae.parsed,Ne=Ae.errors,Te=[],x=0,U=0,B=0;B<se.length;B++){var F=se[B];if(j(F)){for(var M=0,q=Se[x];M<q.length;M++){var de=q[M];de.type==="content"&&(de.position="insidetag"),de.lIndex=U++}D(Te,Se[x]),x++}else F.lIndex=U++,Te.push(F)}return{errors:Ne,lexed:Te}},xmlparse:function(se,le){for(var oe=Y(se,le.text,le.other),ce=0,Ae=[],Se=0;Se<oe.length;Se++){var Ne=oe[Se];se.length>ce&&Ne.offset-ce>0&&Ae.push({type:"content",value:se.substr(ce,Ne.offset-ce)}),ce=Ne.offset+Ne.value.length,delete Ne.offset,Ae.push(Ne)}return se.length>ce&&Ae.push({type:"content",value:se.substr(ce)}),Ae}},Im}var Nm,e2;function CP(){if(e2)return Nm;e2=1;function i(l){return n(l)||r(l)||t(l)||e()}function e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
52
52
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t(l,c){if(l){if(typeof l=="string")return s(l,c);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?s(l,c):void 0}}function r(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}function n(l){if(Array.isArray(l))return s(l)}function s(l,c){(c==null||c>l.length)&&(c=l.length);for(var h=0,d=Array(c);h<c;h++)d[h]=l[h];return d}function a(l){return l.type==="placeholder"}function o(l){var c={},h=[{items:l.filter(a),parents:[],path:[]}];function d(Y,W,fe){fe.length&&h.push({items:fe,parents:[].concat(i(W.parents),[Y]),path:Y.dataBound!==!1&&!Y.attrParsed&&Y.value&&!Y.attrParsed?[].concat(i(W.path),[Y.value]):i(W.path)})}function p(Y,W){for(var fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:W.length,K=Y,be=0;be<fe;be++)K=K[W[be]];return K}function g(Y,W){for(var fe=W.length,K=0;K<W.length;K++){var be=W[K],te=typeof be.lIndex=="number"?be.lIndex:parseInt(be.lIndex.split("-")[0],10);te>Y.lIndex&&fe--}return fe}for(;h.length>0;)for(var y=h.pop(),b=p(c,y.path),w=0,v=y.items;w<v.length;w++){var A,E,_=v[w];if(_.attrParsed){for(var C in _.attrParsed)d(_,y,_.attrParsed[C].filter(a));continue}if(_.subparsed){if(_.dataBound!==!1){var I,k;(I=b)[k=_.value]||(I[k]={})}d(_,y,_.subparsed.filter(a));continue}if(_.cellParsed){for(var D=0,R=_.cellPostParsed;D<R.length;D++){var z=R[D];if(z.type==="placeholder"){if(z.module==="pro-xml-templating/xls-module-loop")continue;if(z.subparsed){var G,O;(G=b)[O=z.value]||(G[O]={}),d(z,y,z.subparsed.filter(a))}else{var X,S,J=g(_,y.parents);b=p(c,y.path,J),(X=b)[S=z.value]||(X[S]={})}}}continue}_.dataBound!==!1&&((A=b)[E=_.value]||(A[E]={}))}return c}return Nm={getTags:o,isPlaceholder:a},Nm}var Mm,t2;function SP(){if(t2)return Mm;t2=1;var i=Fr,e=i.pushArray;function t(n,s){return s instanceof Error?e(Object.getOwnPropertyNames(s),["stack"]).reduce(function(a,o){return a[o]=s[o],o==="stack"&&(a[o]=s[o].toString()),a},{}):s}function r(n,s){if(console.log(JSON.stringify({error:n},t,s==="json"?2:null)),n.properties&&n.properties.errors instanceof Array){var a=n.properties.errors.map(function(o){return o.properties.explanation}).join(`
53
53
  `);console.log("errorMessages",a)}}return Mm=r,Mm}var Lm,r2;function wA(){if(r2)return Lm;r2=1;var i=Fr,e=i.pregMatchAll;return Lm=function(r,n){var s={content:r},a=n.join("|"),o=new RegExp("(?:(<(?:".concat(a,")[^>]*>)([^<>]*)</(?:").concat(a,")>)|(<(?:").concat(a,")[^>]*/>)"),"g");return s.matches=e(o,s.content),s},Lm}var Om,n2;function TP(){if(n2)return Om;n2=1;function i(a){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},i(a)}var e=new RegExp(" ","g");function t(a){return a.replace(e," ")}function r(a,o){var l=i(a);if(l==="string")return t(o.substr(0,a.length))===a;if(a instanceof RegExp)return a.test(t(o));if(l==="function")return!!a(o)}function n(a,o){var l=i(a);if(l==="string")return t(o).substr(a.length);if(a instanceof RegExp)return t(o).match(a)[1];if(l==="function")return a(o)}function s(a,o){var l=i(a);if(l==="string")return[o,t(o).substr(a.length)];if(a instanceof RegExp)return t(o).match(a);if(l==="function")return[o,a(o)]}return Om={match:r,getValue:n,getValues:s},Om}var Fm,i2;function kP(){if(i2)return Fm;i2=1;function i(k){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},i(k)}function e(k,D){var R=Object.keys(k);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(k);D&&(z=z.filter(function(G){return Object.getOwnPropertyDescriptor(k,G).enumerable})),R.push.apply(R,z)}return R}function t(k){for(var D=1;D<arguments.length;D++){var R=arguments[D]!=null?arguments[D]:{};D%2?e(Object(R),!0).forEach(function(z){r(k,z,R[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(R)):e(Object(R)).forEach(function(z){Object.defineProperty(k,z,Object.getOwnPropertyDescriptor(R,z))})}return k}function r(k,D,R){return(D=n(D))in k?Object.defineProperty(k,D,{value:R,enumerable:!0,configurable:!0,writable:!0}):k[D]=R,k}function n(k){var D=s(k,"string");return i(D)=="symbol"?D:D+""}function s(k,D){if(i(k)!="object"||!k)return k;var R=k[Symbol.toPrimitive];if(R!==void 0){var z=R.call(k,D);if(i(z)!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(k)}function a(k,D){return d(k)||h(k,D)||l(k,D)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
54
54
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l(k,D){if(k){if(typeof k=="string")return c(k,D);var R={}.toString.call(k).slice(8,-1);return R==="Object"&&k.constructor&&(R=k.constructor.name),R==="Map"||R==="Set"?Array.from(k):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?c(k,D):void 0}}function c(k,D){(D==null||D>k.length)&&(D=k.length);for(var R=0,z=Array(D);R<D;R++)z[R]=k[R];return z}function h(k,D){var R=k==null?null:typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(R!=null){var z,G,O,X,S=[],J=!0,Y=!1;try{if(O=(R=R.call(k)).next,D!==0)for(;!(J=(z=O.call(R)).done)&&(S.push(z.value),S.length!==D);J=!0);}catch(W){Y=!0,G=W}finally{try{if(!J&&R.return!=null&&(X=R.return(),Object(X)!==X))return}finally{if(Y)throw G}}return S}}function d(k){if(Array.isArray(k))return k}var p=Fr,g=p.wordToUtf8,y=p.pushArray,b=TP(),w=b.match,v=b.getValue,A=b.getValues;function E(k,D){for(var R=[],z=0;z<k.length;z++){var G=k[z];if(G.matchers){var O=G.matchers(D);if(!(O instanceof Array))throw new Error("module matcher returns a non array");y(R,O)}}return R}function _(k,D,R){for(var z=[],G=0;G<k.length;G++){var O=k[G],X=a(O,2),S=X[0],J=X[1],Y=O[2]||{};if(R.match(S,D)){var W=R.getValues(S,D);if(typeof Y=="function"&&(Y=Y(W)),!Y.value){var fe=a(W,2);Y.value=fe[1]}z.push(t({type:"placeholder",prefix:S,module:J,onMatch:Y.onMatch,priority:Y.priority},Y))}}return z}function C(k,D){var R=D.modules,z=D.startOffset,G=D.lIndex,O;D.offset=z,D.match=w,D.getValue=v,D.getValues=A;var X=E(R,D),S=_(X,k,D);if(S.length>0){for(var J=null,Y=0;Y<S.length;Y++){var W=S[Y];W.priority||(W.priority=-W.value.length),(!J||W.priority>J.priority)&&(J=W)}return J.offset=z,delete J.priority,J.endLindex=G,J.lIndex=G,J.raw=k,J.onMatch&&J.onMatch(J),delete J.onMatch,delete J.prefix,J}for(var fe=0;fe<R.length;fe++){var K=R[fe];if(O=K.parse(k,D),O)return O.offset=z,O.endLindex=G,O.lIndex=G,O.raw=k,O}return{type:"placeholder",value:k,offset:z,endLindex:G,lIndex:G}}var I={preparse:function(D,R,z){function G(O,X){for(var S=0;S<R.length;S++){var J=R[S];O=J.preparse(O,X)||O}return O}return G(D,z)},parse:function(D,R,z){var G=!1,O="",X,S=[],J=z.fileTypeConfig.droppedTagsInsidePlaceholder||[];return D.reduce(function(Y,W){return W.type==="delimiter"?(G=W.position==="start",W.position==="end"&&(z.parse=function(fe){return C(fe,t(t(t({},z),W),{},{startOffset:X,modules:R}))},Y.push(z.parse(g(O))),y(Y,S),S=[]),W.position==="start"&&(S=[],X=W.offset),O="",Y):G?W.type!=="content"||W.position!=="insidetag"?(J.indexOf(W.tag)!==-1||S.push(W),Y):(O+=W.value,Y):(Y.push(W),Y)},[])},postparse:function(D,R,z){function G(S,J){return R.map(function(Y){return Y.getTraits(S,J)})}var O=[];function X(S,J){for(var Y=S,W=0;W<R.length;W++){var fe=R[W],K=fe.postparse(Y,t(t({},J),{},{postparse:function(te,j){return X(te,t(t({},J),j))},getTraits:G}));if(K!=null){if(K.errors){y(O,K.errors),Y=K.postparsed;continue}Y=K}}return Y}return{postparsed:X(D,z),errors:O}}};return Fm=I,Fm}var Bm,s2;function xA(){if(s2)return Bm;s2=1;function i(e,t){if(e.lIndex==null)return null;var r=t.scopeManager.scopePathItem;e.parentPart&&(r=r.slice(0,r.length-1));var n=t.filePath+"@"+e.lIndex.toString()+"-"+r.join("-");return n}return Bm=i,Bm}var zm,a2;function DP(){if(a2)return zm;a2=1;var i=Xi,e=i.throwUnimplementedTagType,t=i.XTScopeParserError,r=Fr,n=r.pushArray,s=xA();function a(l,c){for(var h=0,d=c.modules;h<d.length;h++){var p=d[h],g=p.render(l,c);if(g)return g}return!1}function o(l){var c=l.baseNullGetter,h=l.compiled,d=l.scopeManager;l.nullGetter=function(C,I){return c(C,I||d)};for(var p=[],g=[],y=0,b=h.length;y<b;y++){var w=h[y];l.index=y,l.resolvedId=s(w,l);var v=void 0;try{v=a(w,l)}catch(C){if(C instanceof t){p.push(C),g.push(w);continue}throw C}if(v){v.errors&&n(p,v.errors),g.push(v);continue}if(w.type==="content"||w.type==="tag"){g.push(w);continue}e(w,y)}for(var A=[],E=0;E<g.length;E++){var _=g[E].value;_ instanceof Array?n(A,_):_&&A.push(_)}return{errors:p,parts:A}}return zm=o,zm}var jm,o2;function PP(){if(o2)return jm;o2=1;function i(t){var r,n,s,a,o=0,l=t.length;for(s=0;s<l;s++)r=t.charCodeAt(s),(r&64512)===55296&&s+1<l&&(n=t.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),o+=r<128?1:r<2048?2:r<65536?3:4;var c=new Uint8Array(o);for(a=0,s=0;a<o;s++)r=t.charCodeAt(s),(r&64512)===55296&&s+1<l&&(n=t.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),r<128?c[a++]=r:r<2048?(c[a++]=192|r>>>6,c[a++]=128|r&63):r<65536?(c[a++]=224|r>>>12,c[a++]=128|r>>>6&63,c[a++]=128|r&63):(c[a++]=240|r>>>18,c[a++]=128|r>>>12&63,c[a++]=128|r>>>6&63,c[a++]=128|r&63);return c}function e(t,r){for(var n=0,s=r.modules;n<s.length;n++){var a=s[n];t=a.postrender(t,r)}for(var o=0,l=r.joinUncorrupt(t,r),c="",h=0,d=65536,p=[],g=0,y=l.length;g<y;g++){var b=l[g];if(b.length+h>d){var w=i(c);o+=w.length,p.push(w),c=""}c+=b,h+=b.length,delete l[g]}var v=i(c);o+=v.length,p.push(v);for(var A=new Uint8Array(o),E=0,_=0;_<p.length;_++){for(var C=p[_],I=0;I<C.length;++I)A[I+E]=C[I];E+=C.length}return A}return jm=e,jm}var Um,l2;function RP(){if(l2)return Um;l2=1;function i(d){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},i(d)}function e(d,p){var g=Object.keys(d);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(d);p&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(d,b).enumerable})),g.push.apply(g,y)}return g}function t(d){for(var p=1;p<arguments.length;p++){var g=arguments[p]!=null?arguments[p]:{};p%2?e(Object(g),!0).forEach(function(y){r(d,y,g[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(g)):e(Object(g)).forEach(function(y){Object.defineProperty(d,y,Object.getOwnPropertyDescriptor(g,y))})}return d}function r(d,p,g){return(p=n(p))in d?Object.defineProperty(d,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):d[p]=g,d}function n(d){var p=s(d,"string");return i(p)=="symbol"?p:p+""}function s(d,p){if(i(d)!="object"||!d)return d;var g=d[Symbol.toPrimitive];if(g!==void 0){var y=g.call(d,p);if(i(y)!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(d)}var a=Fr,o=a.pushArray,l=xA();function c(d,p){for(var g=0,y=p.modules;g<y.length;g++){var b=y[g],w=b.resolve(d,p);if(w)return w}return!1}function h(d){var p=[],g=d.baseNullGetter,y=d.compiled,b=d.scopeManager;d.nullGetter=function(v,A){return g(v,A||b)},d.resolved=p;var w=[];return Promise.all(y.filter(function(v){return["content","tag"].indexOf(v.type)===-1}).reduce(function(v,A){var E=c(A,t(t({},d),{},{resolvedId:l(A,d)})),_;if(E)_=E.then(function(C){p.push({tag:A.value,lIndex:A.lIndex,value:C})});else if(A.type==="placeholder")_=b.getValueAsync(A.value,{part:A}).then(function(C){return C??d.nullGetter(A)}).then(function(C){return p.push({tag:A.value,lIndex:A.lIndex,value:C}),C});else return;return v.push(_.catch(function(C){C instanceof Array?o(w,C):w.push(C)})),v},[])).then(function(){return{errors:w,resolved:p}})}return Um=h,Um}var Hm,u2;function IP(){if(u2)return Hm;u2=1;var i=Fr,e=i.startsWith,t=i.endsWith,r=i.isStarting,n=i.isEnding,s=i.isWhiteSpace,a=av();function o(c){for(var h="",d=0,p=c.length;d<p;d++){var g=c[d];s(g)||e(g,"<w:bookmarkEnd")||(t(h,"</w:tbl>")&&!e(g,"<w:p")&&!e(g,"<w:tbl")&&!e(g,"<w:sectPr")&&!e(g,"</w:ftr>")&&!e(g,"</w:hdr>")&&(g="<w:p/>".concat(g)),h=g,c[d]=g)}return c}function l(c,h){var d=h.fileTypeConfig.tagShouldContain||[],p="",g=-1;a.docx.indexOf(h.contentType)!==-1&&(c=o(c));for(var y=-1,b=0,w=d.length;b<w;b++)for(var v=d[b],A=v.tag,E=v.shouldContain,_=v.value,C=v.drop,I=v.dropParent,k=0,D=c.length;k<D;k++){var R=c[k];if(g===b){if(n(R,A))if(g=-1,I){for(var z=-1,G=y;G>0;G--)if(r(c[G],I)){z=G;break}for(var O=z;O<=c.length;O++){if(n(c[O],I)){c[O]="";break}c[O]=""}}else{for(var X=y;X<=k;X++)c[X]="";C||(c[k]=p+_+R)}p+=R;for(var S=0,J=E.length;S<J;S++){var Y=E[S];if(r(R,Y)){g=-1;break}}}g===-1&&r(R,A)&&R.substr(1).indexOf("<")===-1&&(R[R.length-2]==="/"?c[k]="":(y=k,g=b,p=R))}return c}return Hm=l,Hm}var $m,c2;function NP(){if(c2)return $m;c2=1;function i(A){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},i(A)}function e(A,E){if(!(A instanceof E))throw new TypeError("Cannot call a class as a function")}function t(A,E){for(var _=0;_<E.length;_++){var C=E[_];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(A,n(C.key),C)}}function r(A,E,_){return E&&t(A.prototype,E),Object.defineProperty(A,"prototype",{writable:!1}),A}function n(A){var E=s(A,"string");return i(E)=="symbol"?E:E+""}function s(A,E){if(i(A)!="object"||!A)return A;var _=A[Symbol.toPrimitive];if(_!==void 0){var C=_.call(A,E);if(i(C)!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}var a=Fr,o=a.pushArray,l=a.wordToUtf8,c=a.convertSpaces,h=wA(),d=yA(),p=kP(),g=DP(),y=PP(),b=RP(),w=IP();function v(A,E){var _=h(A,E),C=_.matches.map(function(I){return I.array[2]});return l(c(C.join("")))}return $m=function(){function A(E,_){e(this,A),this.cachedParsers={},this.content=E;for(var C in _)this[C]=_[C];this.setModules({inspect:{filePath:_.filePath}})}return r(A,[{key:"resolveTags",value:function(_){var C=this;this.tags=_;var I=this.getOptions(),k=this.filePath;I.scopeManager=this.scopeManager,I.resolve=b;var D=[];return Promise.all(this.modules.map(function(R){return Promise.resolve(R.preResolve(I)).catch(function(z){D.push(z)})})).then(function(){if(D.length!==0)throw D;return b(I).then(function(R){var z=R.resolved,G=R.errors;if(G=G.map(function(O){var X;return O instanceof Error||(O=new Error(O)),(X=O).properties||(X.properties={}),O.properties.file=k,O}),G.length!==0)throw G;return Promise.all(z).then(function(O){return I.scopeManager.root.finishedResolving=!0,I.scopeManager.resolved=O,C.setModules({inspect:{resolved:O,filePath:k}}),O})}).catch(function(R){throw C.errorChecker(R),R})})}},{key:"getFullText",value:function(){return v(this.content,this.fileTypeConfig.tagsXmlTextArray)}},{key:"setModules",value:function(_){for(var C=0,I=this.modules;C<I.length;C++){var k=I[C];k.set(_)}}},{key:"preparse",value:function(){this.allErrors=[],this.xmllexed=d.xmlparse(this.content,{text:this.fileTypeConfig.tagsXmlTextArray,other:this.fileTypeConfig.tagsXmlLexedArray}),this.setModules({inspect:{filePath:this.filePath,xmllexed:this.xmllexed}});var _=d.parse(this.xmllexed,this.delimiters,this.syntax,this.fileType),C=_.lexed,I=_.errors;o(this.allErrors,I),this.lexed=C,this.setModules({inspect:{filePath:this.filePath,lexed:this.lexed}});var k=this.getOptions();this.lexed=p.preparse(this.lexed,this.modules,k)}},{key:"parse",value:function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},C=_.noPostParse;this.setModules({inspect:{filePath:this.filePath}});var I=this.getOptions();return this.parsed=p.parse(this.lexed,this.modules,I),this.setModules({inspect:{filePath:this.filePath,parsed:this.parsed}}),C?this:this.postparse()}},{key:"postparse",value:function(){var _=this.getOptions(),C=p.postparse(this.parsed,this.modules,_),I=C.postparsed,k=C.errors;return this.postparsed=I,this.setModules({inspect:{filePath:this.filePath,postparsed:this.postparsed}}),o(this.allErrors,k),this.errorChecker(this.allErrors),this}},{key:"errorChecker",value:function(_){for(var C=0,I=_;C<I.length;C++){var k=I[C];k.properties||(k.properties={}),k.properties.file=this.filePath}for(var D=0,R=this.modules;D<R.length;D++){var z=R[D];_=z.errorsTransformer(_)}}},{key:"baseNullGetter",value:function(_,C){for(var I=null,k=0,D=this.modules;k<D.length;k++){var R=D[k];I==null&&(I=R.nullGetter(_,C,this))}return I??this.nullGetter(_,C)}},{key:"getOptions",value:function(){return{compiled:this.postparsed,cachedParsers:this.cachedParsers,tags:this.tags,modules:this.modules,parser:this.parser,contentType:this.contentType,relsType:this.relsType,baseNullGetter:this.baseNullGetter.bind(this),filePath:this.filePath,fileTypeConfig:this.fileTypeConfig,fileType:this.fileType,linebreaks:this.linebreaks,stripInvalidXMLChars:this.stripInvalidXMLChars}}},{key:"render",value:function(_){this.filePath=_;var C=this.getOptions();C.resolved=this.scopeManager.resolved,C.scopeManager=this.scopeManager,C.render=g,C.joinUncorrupt=w;var I=g(C),k=I.errors,D=I.parts;return k.length>0?(this.allErrors=k,this.errorChecker(k),this):(this.content=y(D,C),this.setModules({inspect:{filePath:this.filePath,content:this.content}}),this)}}])}(),$m}var Vm,h2;function MP(){if(h2)return Vm;h2=1;function i(x){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},i(x)}function e(x,U){var B=Object.keys(x);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(x);U&&(F=F.filter(function(M){return Object.getOwnPropertyDescriptor(x,M).enumerable})),B.push.apply(B,F)}return B}function t(x){for(var U=1;U<arguments.length;U++){var B=arguments[U]!=null?arguments[U]:{};U%2?e(Object(B),!0).forEach(function(F){r(x,F,B[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(B)):e(Object(B)).forEach(function(F){Object.defineProperty(x,F,Object.getOwnPropertyDescriptor(B,F))})}return x}function r(x,U,B){return(U=g(U))in x?Object.defineProperty(x,U,{value:B,enumerable:!0,configurable:!0,writable:!0}):x[U]=B,x}function n(x,U){return c(x)||l(x,U)||a(x,U)||s()}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
55
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(x,U){if(x){if(typeof x=="string")return o(x,U);var B={}.toString.call(x).slice(8,-1);return B==="Object"&&x.constructor&&(B=x.constructor.name),B==="Map"||B==="Set"?Array.from(x):B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B)?o(x,U):void 0}}function o(x,U){(U==null||U>x.length)&&(U=x.length);for(var B=0,F=Array(U);B<U;B++)F[B]=x[B];return F}function l(x,U){var B=x==null?null:typeof Symbol<"u"&&x[Symbol.iterator]||x["@@iterator"];if(B!=null){var F,M,q,de,we=[],ee=!0,Ee=!1;try{if(q=(B=B.call(x)).next,U!==0)for(;!(ee=(F=q.call(B)).done)&&(we.push(F.value),we.length!==U);ee=!0);}catch(De){Ee=!0,M=De}finally{try{if(!ee&&B.return!=null&&(de=B.return(),Object(de)!==de))return}finally{if(Ee)throw M}}return we}}function c(x){if(Array.isArray(x))return x}function h(x,U){if(!(x instanceof U))throw new TypeError("Cannot call a class as a function")}function d(x,U){for(var B=0;B<U.length;B++){var F=U[B];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(x,g(F.key),F)}}function p(x,U,B){return U&&d(x.prototype,U),Object.defineProperty(x,"prototype",{writable:!1}),x}function g(x){var U=y(x,"string");return i(U)=="symbol"?U:U+""}function y(x,U){if(i(x)!="object"||!x)return x;var B=x[Symbol.toPrimitive];if(B!==void 0){var F=B.call(x,U);if(i(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}var b=Fr,w=b.chunkBy,v=b.last,A=b.isParagraphStart,E=b.isModule,_=b.pushArray,C=b.isParagraphEnd,I=b.isContent,k=b.startsWith,D=b.isTagEnd,R=b.isTagStart,z=b.getSingleAttribute,G=b.setSingleAttribute,O=av(),X=Kl(),S="loop";function J(x){return x.some(function(U){return I(U)})}function Y(x){for(var U=0;U<x.length;U++){var B=x[U];if(B.type!=="content")return B}return null}function W(x){var U=Y(x.subparsed);return U!=null&&U.tag!=="w:t"}function fe(x){return x.hasPageBreak&&W(x)?'<w:p><w:r><w:br w:type="page"/></w:r></w:p>':""}function K(x){return x.length&&A(x[0])&&C(v(x))}function be(x){return J(x)?0:x.length}function te(x){var U=x.parts.length-1;x.parts[U]==="</w:p>"?x.parts.splice(U,0,'<w:r><w:br w:type="page"/></w:r>'):x.parts.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>')}function j(x){x.parts.unshift('<w:p><w:r><w:br w:type="page"/></w:r></w:p>')}function ie(x){return x.some(function(U){return R("w:type",U)&&U.value.indexOf("continuous")!==-1})}function ae(x){return x.some(function(U){return R("w:type",U)&&U.value.indexOf('w:val="nextPage"')!==-1})}function H(x,U){return _(["<w:p><w:pPr>".concat(U.map(function(B){var F=B.value;return F}).join(""),"</w:pPr></w:p>")],x)}function se(x){for(var U=!1,B=!1,F=[],M=0;M<x.length;M++){var q=x[M];U===!1&&k(q,"<w:sectPr")&&(B=!0),B&&(k(q,"<w:type")&&(U=!0),U===!1&&k(q,"</w:sectPr")&&F.push('<w:type w:val="continuous"/>')),F.push(q)}return F}function le(x){return x.filter(function(U){return!k(U,"<w:headerReference")&&!k(U,"<w:footerReference")})}function oe(x){return x.some(function(U){return U.tag==="w:br"&&U.value.indexOf('w:type="page"')!==-1})}function ce(x){return x.some(function(U){var B=U.tag;return B==="w:drawing"})}function Ae(x){for(var U=!1,B=[],F=0;F<x.length;F++){var M=x[F];R("w:sectPr",M)&&(B.push([]),U=!0),U&&B[B.length-1].push(M),D("w:sectPr",M)&&(U=!1)}return B}function Se(x){for(var U=!1,B=0,F=0;F<x.length;F++){var M=x[F];R("w:sectPr",M)&&(U=!0),U&&(M.tag==="w:headerReference"||M.tag==="w:footerReference")&&(B++,U=!1),D("w:sectPr",M)&&(U=!1)}return B}function Ne(x){for(var U=[],B=!1,F=x.length-1;F>=0;F--){var M=x[F];if(D("w:sectPr",M)&&(B=!0),R("w:sectPr",M)&&(U.unshift(M.value),B=!1),B&&U.unshift(M.value),A(M)){if(U.length>0)return U.join("");break}}return""}var Te=function(){function x(){h(this,x),this.name="LoopModule",this.inXfrm=!1,this.totalSectPr=0,this.prefix={start:"#",end:"/",dash:/^-([^\s]+)\s(.+)/,inverted:"^"}}return p(x,[{key:"optionsTransformer",value:function(B,F){return this.docxtemplater=F,B}},{key:"preparse",value:function(B,F){var M=F.contentType;O.main.indexOf(M)!==-1&&(this.sects=Ae(B))}},{key:"matchers",value:function(){var B=S;return[[this.prefix.start,B,{expandTo:"auto",location:"start",inverted:!1}],[this.prefix.inverted,B,{expandTo:"auto",location:"start",inverted:!0}],[this.prefix.end,B,{location:"end"}],[this.prefix.dash,B,function(F){var M=n(F,3),q=M[1],de=M[2];return{location:"start",inverted:!1,expandTo:q,value:de}}]]}},{key:"getTraits",value:function(B,F){if(B==="expandPair"){for(var M=[],q=0,de=F.length;q<de;q++){var we=F[q];E(we,S)&&we.subparsed==null&&M.push({part:we,offset:q})}return M}}},{key:"postparse",value:function(B,F){var M=F.basePart;if(M&&this.docxtemplater.fileType==="docx"&&B.length>0){M.sectPrCount=Se(B),this.totalSectPr+=M.sectPrCount;var q=this.sects;q.some(function(Me,$e){if(M.lIndex<Me[0].lIndex)return $e+1<q.length&&ie(q[$e+1])&&(M.addContinuousType=!0),!0;if(B[0].lIndex<Me[0].lIndex&&Me[0].lIndex<M.lIndex)return ae(q[$e])&&(M.addNextPage={index:$e}),!0}),M.lastParagrapSectPr=Ne(B)}if(!M||M.expandTo!=="auto"||M.module!==S||!K(B))return B;M.paragraphLoop=!0;var de=0,we=w(B,function(Me){return A(Me)&&(de++,de===1)?"start":C(Me)&&(de--,de===0)?"end":null}),ee=we[0],Ee=v(we),De=be(ee),Ce=be(Ee);return M.hasPageBreakBeginning=oe(ee),M.hasPageBreak=oe(Ee),ce(ee)&&(De=0),ce(Ee)&&(Ce=0),B.slice(De,B.length-Ce)}},{key:"resolve",value:function(B,F){if(!E(B,S))return null;var M=F.scopeManager,q=M.getValueAsync(B.value,{part:B}),de=[];function we(Ee,De,Ce){var Me=M.createSubScopeManager(Ee,B.value,De,B,Ce);de.push(F.resolve(t(t({},F),{},{compiled:B.subparsed,tags:{},scopeManager:Me})))}var ee=[];return q.then(function(Ee){return Ee??(Ee=F.nullGetter(B)),new Promise(function(De){if(Ee instanceof Promise)return Ee.then(function(Ce){Ce instanceof Array?Promise.all(Ce).then(De):De(Ce)});Ee instanceof Array?Promise.all(Ee).then(De):De(Ee)}).then(function(De){return M.loopOverValue(De,we,B.inverted),Promise.all(de).then(function(Ce){return Ce.map(function(Me){var $e=Me.resolved,Xe=Me.errors;return _(ee,Xe),$e})}).then(function(Ce){if(ee.length>0)throw ee;return Ce})})})}},{key:"render",value:function(B,F){if(B.tag==="p:xfrm"&&(this.inXfrm=B.position==="start"),B.tag==="a:ext"&&this.inXfrm)return this.lastExt=B,B;if(!E(B,S))return null;var M=[],q=[],de=0,we=this,ee=B.subparsed[0],Ee=0;(ee==null?void 0:ee.tag)==="a:tr"&&(Ee=+z(ee.value,"h")),de-=Ee;var De=0,Ce=W(B);function Me(nr,yr,rr){de+=Ee;for(var ge=F.scopeManager.createSubScopeManager(nr,B.value,yr,B,rr),ve=0,he=B.subparsed;ve<he.length;ve++){var me=he[ve];if(R("a16:rowId",me)){var Fe=+z(me.value,"val")+De;De=1,me.value=G(me.value,"val",Fe)}}var Ue=F.render(t(t({},F),{},{compiled:B.subparsed,tags:{},scopeManager:ge}));B.hasPageBreak&&yr===rr-1&&Ce&&te(Ue);var st=ge.scopePathItem.some(function(mt){return mt!==0});st?(B.sectPrCount===1&&(Ue.parts=le(Ue.parts)),B.addContinuousType&&(Ue.parts=se(Ue.parts))):B.addNextPage&&(Ue.parts=H(Ue.parts,we.sects[B.addNextPage.index])),B.addNextPage&&te(Ue),B.hasPageBreakBeginning&&Ce&&j(Ue);for(var Ye=0,ct=Ue.parts;Ye<ct.length;Ye++){var pt=ct[Ye];M.push(pt)}_(q,Ue.errors)}var $e=F.scopeManager.getValue(B.value,{part:B});$e??($e=F.nullGetter(B));var Xe=F.scopeManager.loopOverValue($e,Me,B.inverted);if(Xe===!1)return B.lastParagrapSectPr?B.paragraphLoop?{value:"<w:p><w:pPr>".concat(B.lastParagrapSectPr,"</w:pPr></w:p>")}:{value:"</w:t></w:r></w:p><w:p><w:pPr>".concat(B.lastParagrapSectPr,"</w:pPr><w:r><w:t>")}:{value:fe(B)||"",errors:q};if(de!==0){var Tt=+z(this.lastExt.value,"cy");this.lastExt.value=G(this.lastExt.value,"cy",Tt+de)}return{value:F.joinUncorrupt(M,t(t({},F),{},{basePart:B})),errors:q}}}])}();return Vm=function(){return X(new Te)},Vm}var Gm,d2;function LP(){if(d2)return Gm;d2=1;function i(C){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},i(C)}function e(C,I){if(!(C instanceof I))throw new TypeError("Cannot call a class as a function")}function t(C,I){for(var k=0;k<I.length;k++){var D=I[k];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(C,n(D.key),D)}}function r(C,I,k){return I&&t(C.prototype,I),Object.defineProperty(C,"prototype",{writable:!1}),C}function n(C){var I=s(C,"string");return i(I)=="symbol"?I:I+""}function s(C,I){if(i(C)!="object"||!C)return C;var k=C[Symbol.toPrimitive];if(k!==void 0){var D=k.call(C,I);if(i(D)!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}var a=Kl(),o=Fr,l=o.isTextStart,c=o.isTextEnd,h=o.endsWith,d=o.startsWith,p=o.pushArray,g='<w:t xml:space="preserve">',y=g.length,b="</w:t>",w=b.length;function v(C){return l(C)&&C.tag==="w:t"}function A(C,I){var k=C[I].value;return C[I+1].value==="</w:t>"||k.indexOf('xml:space="preserve"')!==-1?k:k.substr(0,k.length-1)+' xml:space="preserve">'}function E(C,I){return C&&C.basePart&&I.length>1}var _=function(){function C(){e(this,C),this.name="SpacePreserveModule"}return r(C,[{key:"postparse",value:function(k,D){var R=[],z=!1,G=0,O=0;function X(J,Y){return J.type==="placeholder"&&Y.length>1}var S=k.reduce(function(J,Y){return v(Y)&&(z=!0,O=R.length),z?(R.push(Y),E(D,R)&&(G=D.basePart.endLindex,R[0].value=A(R,0)),X(Y,R)&&(R[O].value=A(R,O),G=Y.endLindex),c(Y)&&Y.lIndex>G&&(G!==0&&(R[O].value=A(R,O)),p(J,R),R=[],z=!1,G=0,O=0),J):(J.push(Y),J)},[]);return p(S,R),S}},{key:"postrender",value:function(k){for(var D="",R=0,z=0,G=k.length;z<G;z++){var O=k[z];O!==""&&(h(D,g)&&d(O,b)&&(k[R]=D.substr(0,D.length-y)+"<w:t/>",O=O.substr(w)),D=O,R=z,k[z]=O)}return k}}])}();return Gm=function(){return a(new _)},Gm}var qm,f2;function OP(){if(f2)return qm;f2=1;function i(w){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},i(w)}function e(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function t(w,v){for(var A=0;A<v.length;A++){var E=v[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,n(E.key),E)}}function r(w,v,A){return v&&t(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),w}function n(w){var v=s(w,"string");return i(v)=="symbol"?v:v+""}function s(w,v){if(i(w)!="object"||!w)return w;var A=w[Symbol.toPrimitive];if(A!==void 0){var E=A.call(w,v);if(i(E)!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var a=sv(),o=Fr,l=o.isContent,c=Xi,h=c.throwRawTagShouldBeOnlyTextInParagraph,d=c.getInvalidRawXMLValueException,p=Kl(),g="rawxml";function y(w){for(var v=w.part,A=w.left,E=w.right,_=w.postparsed,C=w.index,I=_.slice(A+1,E),k=0,D=I.length;k<D;k++)if(k!==C-A-1){var R=I[k];l(R)&&h({paragraphParts:I,part:v})}return v}var b=function(){function w(){e(this,w),this.name="RawXmlModule",this.prefix="@"}return r(w,[{key:"optionsTransformer",value:function(A,E){return this.fileTypeConfig=E.fileTypeConfig,A}},{key:"matchers",value:function(){return[[this.prefix,g]]}},{key:"postparse",value:function(A){return a.expandToOne(A,{moduleName:g,getInner:y,expandTo:this.fileTypeConfig.tagRawXml,error:{message:"Raw tag not in paragraph",id:"raw_tag_outerxml_invalid",explanation:function(_){return'The tag "'.concat(_.value,'" is not inside a paragraph, putting raw tags inside an inline loop is disallowed.')}}})}},{key:"render",value:function(A,E){if(A.module!==g)return null;var _,C=[];try{_=E.scopeManager.getValue(A.value,{part:A}),_??(_=E.nullGetter(A))}catch(I){return C.push(I),{errors:C}}return _=_||"",typeof _=="string"?{value:_}:{errors:[d({tag:A.value,value:_,offset:A.offset})]}}}])}();return qm=function(){return p(new b)},qm}var Wm,p2;function FP(){if(p2)return Wm;p2=1;function i(e,t){for(var r=-1,n=0,s=e.length;n<s;n++)t[n]>=e[n].length||(r===-1||e[n][t[n]].offset<e[r][t[r]].offset)&&(r=n);return r}return Wm=function(e){for(var t=0,r=0,n=e;r<n.length;r++){var s=n[r];t+=s.length}e=e.filter(function(h){return h.length>0});for(var a=new Array(t),o=e.map(function(){return 0}),l=0;l<t;l++){var c=i(e,o);a[l]=e[c][o[c]],o[c]++}return a},Wm}var Xm,g2;function BP(){if(g2)return Xm;g2=1;function i(D){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},i(D)}function e(D,R){if(!(D instanceof R))throw new TypeError("Cannot call a class as a function")}function t(D,R){for(var z=0;z<R.length;z++){var G=R[z];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(D,n(G.key),G)}}function r(D,R,z){return R&&t(D.prototype,R),Object.defineProperty(D,"prototype",{writable:!1}),D}function n(D){var R=s(D,"string");return i(R)=="symbol"?R:R+""}function s(D,R){if(i(D)!="object"||!D)return D;var z=D[Symbol.toPrimitive];if(z!==void 0){var G=z.call(D,R);if(i(G)!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(D)}var a="expandPair",o=FP(),l=Fr,c=l.getLeft,h=l.getRight,d=l.pushArray,p=Kl(),g=sv(),y=g.getExpandToDefault,b=Xi,w=b.getUnmatchedLoopException,v=b.getClosingTagNotMatchOpeningTag,A=b.getUnbalancedLoopException;function E(D){switch(D.location){case"start":return 1;case"end":return-1}}function _(D,R){return D!=null&&R!=null&&(D.part.location==="start"&&R.part.location==="end"&&D.part.value===R.part.value||R.part.value==="")}function C(D){for(var R=0,z=[];R<D.length;){var G=D[R].part;if(G.location==="end"){if(R===0)return D.splice(0,1),z.push(w(G)),{traits:D,errors:z};var O=R,X=R-1,S=1;if(_(D[X],D[O]))return D.splice(O,1),D.splice(X,1),{errors:z,traits:D};for(;S<50;){var J=D[X-S],Y=D[O+S];if(_(J,D[O]))return D.splice(O,1),D.splice(X-S,1),{errors:z,traits:D};if(_(D[X],Y))return D.splice(O+S,1),D.splice(X,1),{errors:z,traits:D};S++}return z.push(v({tags:[D[X].part,D[O].part]})),D.splice(O,1),D.splice(X,1),{traits:D,errors:z}}R++}for(var W=0;W<D.length;W++){var fe=D[W].part;z.push(w(fe))}return{traits:[],errors:z}}function I(D){var R={},z=[],G=[],O=[];for(d(O,D);O.length>0;){var X=C(O);d(z,X.errors),O=X.traits}if(z.length>0)return{pairs:G,errors:z};for(var S=0,J=0;J<D.length;J++){var Y=D[J],W=Y.part,fe=E(W);if(S+=fe,fe===1)R[S]=Y;else{var K=R[S+1];S===0&&G.push([K,Y])}S=S>=0?S:0}return{pairs:G,errors:z}}var k=function(){function D(){e(this,D),this.name="ExpandPairTrait"}return r(D,[{key:"optionsTransformer",value:function(z,G){return G.options.paragraphLoop&&d(G.fileTypeConfig.expandTags,G.fileTypeConfig.onParagraphLoop),this.expandTags=G.fileTypeConfig.expandTags,z}},{key:"postparse",value:function(z,G){var O=this,X=G.getTraits,S=G.postparse,J=G.fileType,Y=X(a,z);Y=Y.map(function(se){return se||[]}),Y=o(Y);var W=I(Y),fe=W.pairs,K=W.errors,be=0,te=null,j=fe.map(function(se){var le=se[0].part.expandTo;if(le==="auto"&&J!=="text"){var oe=y(z,se,O.expandTags);oe.error&&K.push(oe.error),le=oe.value}if(!le||J==="text"){var ce=se[0].offset,Ae=se[1].offset;return ce<be&&!O.docxtemplater.options.syntax.allowUnbalancedLoops&&K.push(A(se,te)),te=se,be=Ae,[ce,Ae]}var Se,Ne;try{Se=c(z,le,se[0].offset)}catch(Te){K.push(Te)}try{Ne=h(z,le,se[1].offset)}catch(Te){K.push(Te)}return Se<be&&!O.docxtemplater.options.syntax.allowUnbalancedLoops&&K.push(A(se,te)),be=Ne,te=se,[Se,Ne]});if(K.length>0)return{postparsed:z,errors:K};var ie=0,ae,H=z.reduce(function(se,le,oe){var ce=ie<fe.length&&j[ie][0]<=oe&&oe<=j[ie][1],Ae=fe[ie],Se=j[ie];if(!ce)return se.push(le),se;if(Se[0]===oe&&(ae=[]),Ae[0].offset!==oe&&Ae[1].offset!==oe&&ae.push(le),Se[1]===oe){var Ne=z[Ae[0].offset];Ne.subparsed=S(ae,{basePart:Ne}),Ne.endLindex=Ae[1].part.lIndex,delete Ne.location,delete Ne.expandTo,se.push(Ne),ie++;for(var Te=j[ie];Te&&Te[0]<oe;)ie++,Te=j[ie]}return se},[]);return{postparsed:H,errors:K}}}])}();return Xm=function(){return p(new k)},Xm}var Ym,m2;function zP(){if(m2)return Ym;m2=1;function i(I){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},i(I)}function e(I,k){if(!(I instanceof k))throw new TypeError("Cannot call a class as a function")}function t(I,k){for(var D=0;D<k.length;D++){var R=k[D];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,n(R.key),R)}}function r(I,k,D){return k&&t(I.prototype,k),Object.defineProperty(I,"prototype",{writable:!1}),I}function n(I){var k=s(I,"string");return i(k)=="symbol"?k:k+""}function s(I,k){if(i(I)!="object"||!I)return I;var D=I[Symbol.toPrimitive];if(D!==void 0){var R=D.call(I,k);if(i(R)!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}var a=Kl(),o=Xi,l=o.getScopeCompilationError,c=o.getCorruptCharactersException,h=Fr,d=h.utf8ToWord,p=h.hasCorruptCharacters,g=h.removeCorruptCharacters,y=vA(),b=y.settingsContentType,w=y.coreContentType,v=y.appContentType,A=y.customContentType,E=[b,w,v,A],_={docx:"w",pptx:"a"},C=function(){function I(){e(this,I),this.name="Render",this.recordRun=!1,this.recordedRun=[]}return r(I,[{key:"optionsTransformer",value:function(D,R){return this.docxtemplater=R,this.brTag=R.fileType==="docx"?"<w:r><w:br/></w:r>":"<a:br/>",this.prefix=_[R.fileType],this.runStartTag="".concat(this.prefix,":r"),this.runPropsStartTag="".concat(this.prefix,":rPr"),D}},{key:"set",value:function(D){D.compiled&&(this.compiled=D.compiled),D.data!=null&&(this.data=D.data)}},{key:"getRenderedMap",value:function(D){for(var R in this.compiled)D[R]={from:R,data:this.data};return D}},{key:"postparse",value:function(D,R){for(var z=[],G=0;G<D.length;G++){var O=D[G];if(O.type==="placeholder"){var X=O.value;try{R.cachedParsers[O.lIndex]=this.docxtemplater.parser(X,{tag:O})}catch(S){z.push(l({tag:X,rootError:S,offset:O.offset}))}}}return{postparsed:D,errors:z}}},{key:"render",value:function(D,R){var z=R.contentType,G=R.scopeManager,O=R.linebreaks,X=R.nullGetter,S=R.fileType,J=R.stripInvalidXMLChars;if(E.indexOf(z)!==-1&&(O=!1),O&&this.recordRuns(D),!(D.type!=="placeholder"||D.module)){var Y;try{Y=G.getValue(D.value,{part:D})}catch(W){return{errors:[W]}}if(Y??(Y=X(D)),typeof Y=="string"){if(J)Y=g(Y);else if(["docx","pptx","xlsx"].indexOf(S)!==-1&&p(Y))return{errors:[c({tag:D.value,value:Y,offset:D.offset})]}}return S==="text"?{value:Y}:{value:O&&typeof Y=="string"?this.renderLineBreaks(Y):d(Y)}}}},{key:"recordRuns",value:function(D){D.tag===this.runStartTag?this.recordedRun="":D.tag===this.runPropsStartTag?(D.position==="start"&&(this.recordRun=!0,this.recordedRun+=D.value),(D.position==="end"||D.position==="selfclosing")&&(this.recordedRun+=D.value,this.recordRun=!1)):this.recordRun&&(this.recordedRun+=D.value)}},{key:"renderLineBreaks",value:function(D){for(var R=[],z=D.split(`
55
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(x,U){if(x){if(typeof x=="string")return o(x,U);var B={}.toString.call(x).slice(8,-1);return B==="Object"&&x.constructor&&(B=x.constructor.name),B==="Map"||B==="Set"?Array.from(x):B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B)?o(x,U):void 0}}function o(x,U){(U==null||U>x.length)&&(U=x.length);for(var B=0,F=Array(U);B<U;B++)F[B]=x[B];return F}function l(x,U){var B=x==null?null:typeof Symbol<"u"&&x[Symbol.iterator]||x["@@iterator"];if(B!=null){var F,M,q,de,ye=[],ee=!0,Ee=!1;try{if(q=(B=B.call(x)).next,U!==0)for(;!(ee=(F=q.call(B)).done)&&(ye.push(F.value),ye.length!==U);ee=!0);}catch(De){Ee=!0,M=De}finally{try{if(!ee&&B.return!=null&&(de=B.return(),Object(de)!==de))return}finally{if(Ee)throw M}}return ye}}function c(x){if(Array.isArray(x))return x}function h(x,U){if(!(x instanceof U))throw new TypeError("Cannot call a class as a function")}function d(x,U){for(var B=0;B<U.length;B++){var F=U[B];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(x,g(F.key),F)}}function p(x,U,B){return U&&d(x.prototype,U),Object.defineProperty(x,"prototype",{writable:!1}),x}function g(x){var U=y(x,"string");return i(U)=="symbol"?U:U+""}function y(x,U){if(i(x)!="object"||!x)return x;var B=x[Symbol.toPrimitive];if(B!==void 0){var F=B.call(x,U);if(i(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}var b=Fr,w=b.chunkBy,v=b.last,A=b.isParagraphStart,E=b.isModule,_=b.pushArray,C=b.isParagraphEnd,I=b.isContent,k=b.startsWith,D=b.isTagEnd,R=b.isTagStart,z=b.getSingleAttribute,G=b.setSingleAttribute,O=av(),X=Kl(),S="loop";function J(x){return x.some(function(U){return I(U)})}function Y(x){for(var U=0;U<x.length;U++){var B=x[U];if(B.type!=="content")return B}return null}function W(x){var U=Y(x.subparsed);return U!=null&&U.tag!=="w:t"}function fe(x){return x.hasPageBreak&&W(x)?'<w:p><w:r><w:br w:type="page"/></w:r></w:p>':""}function K(x){return x.length&&A(x[0])&&C(v(x))}function be(x){return J(x)?0:x.length}function te(x){var U=x.parts.length-1;x.parts[U]==="</w:p>"?x.parts.splice(U,0,'<w:r><w:br w:type="page"/></w:r>'):x.parts.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>')}function j(x){x.parts.unshift('<w:p><w:r><w:br w:type="page"/></w:r></w:p>')}function ie(x){return x.some(function(U){return R("w:type",U)&&U.value.indexOf("continuous")!==-1})}function ae(x){return x.some(function(U){return R("w:type",U)&&U.value.indexOf('w:val="nextPage"')!==-1})}function H(x,U){return _(["<w:p><w:pPr>".concat(U.map(function(B){var F=B.value;return F}).join(""),"</w:pPr></w:p>")],x)}function se(x){for(var U=!1,B=!1,F=[],M=0;M<x.length;M++){var q=x[M];U===!1&&k(q,"<w:sectPr")&&(B=!0),B&&(k(q,"<w:type")&&(U=!0),U===!1&&k(q,"</w:sectPr")&&F.push('<w:type w:val="continuous"/>')),F.push(q)}return F}function le(x){return x.filter(function(U){return!k(U,"<w:headerReference")&&!k(U,"<w:footerReference")})}function oe(x){return x.some(function(U){return U.tag==="w:br"&&U.value.indexOf('w:type="page"')!==-1})}function ce(x){return x.some(function(U){var B=U.tag;return B==="w:drawing"})}function Ae(x){for(var U=!1,B=[],F=0;F<x.length;F++){var M=x[F];R("w:sectPr",M)&&(B.push([]),U=!0),U&&B[B.length-1].push(M),D("w:sectPr",M)&&(U=!1)}return B}function Se(x){for(var U=!1,B=0,F=0;F<x.length;F++){var M=x[F];R("w:sectPr",M)&&(U=!0),U&&(M.tag==="w:headerReference"||M.tag==="w:footerReference")&&(B++,U=!1),D("w:sectPr",M)&&(U=!1)}return B}function Ne(x){for(var U=[],B=!1,F=x.length-1;F>=0;F--){var M=x[F];if(D("w:sectPr",M)&&(B=!0),R("w:sectPr",M)&&(U.unshift(M.value),B=!1),B&&U.unshift(M.value),A(M)){if(U.length>0)return U.join("");break}}return""}var Te=function(){function x(){h(this,x),this.name="LoopModule",this.inXfrm=!1,this.totalSectPr=0,this.prefix={start:"#",end:"/",dash:/^-([^\s]+)\s(.+)/,inverted:"^"}}return p(x,[{key:"optionsTransformer",value:function(B,F){return this.docxtemplater=F,B}},{key:"preparse",value:function(B,F){var M=F.contentType;O.main.indexOf(M)!==-1&&(this.sects=Ae(B))}},{key:"matchers",value:function(){var B=S;return[[this.prefix.start,B,{expandTo:"auto",location:"start",inverted:!1}],[this.prefix.inverted,B,{expandTo:"auto",location:"start",inverted:!0}],[this.prefix.end,B,{location:"end"}],[this.prefix.dash,B,function(F){var M=n(F,3),q=M[1],de=M[2];return{location:"start",inverted:!1,expandTo:q,value:de}}]]}},{key:"getTraits",value:function(B,F){if(B==="expandPair"){for(var M=[],q=0,de=F.length;q<de;q++){var ye=F[q];E(ye,S)&&ye.subparsed==null&&M.push({part:ye,offset:q})}return M}}},{key:"postparse",value:function(B,F){var M=F.basePart;if(M&&this.docxtemplater.fileType==="docx"&&B.length>0){M.sectPrCount=Se(B),this.totalSectPr+=M.sectPrCount;var q=this.sects;q.some(function(Me,$e){if(M.lIndex<Me[0].lIndex)return $e+1<q.length&&ie(q[$e+1])&&(M.addContinuousType=!0),!0;if(B[0].lIndex<Me[0].lIndex&&Me[0].lIndex<M.lIndex)return ae(q[$e])&&(M.addNextPage={index:$e}),!0}),M.lastParagrapSectPr=Ne(B)}if(!M||M.expandTo!=="auto"||M.module!==S||!K(B))return B;M.paragraphLoop=!0;var de=0,ye=w(B,function(Me){return A(Me)&&(de++,de===1)?"start":C(Me)&&(de--,de===0)?"end":null}),ee=ye[0],Ee=v(ye),De=be(ee),Ce=be(Ee);return M.hasPageBreakBeginning=oe(ee),M.hasPageBreak=oe(Ee),ce(ee)&&(De=0),ce(Ee)&&(Ce=0),B.slice(De,B.length-Ce)}},{key:"resolve",value:function(B,F){if(!E(B,S))return null;var M=F.scopeManager,q=M.getValueAsync(B.value,{part:B}),de=[];function ye(Ee,De,Ce){var Me=M.createSubScopeManager(Ee,B.value,De,B,Ce);de.push(F.resolve(t(t({},F),{},{compiled:B.subparsed,tags:{},scopeManager:Me})))}var ee=[];return q.then(function(Ee){return Ee??(Ee=F.nullGetter(B)),new Promise(function(De){if(Ee instanceof Promise)return Ee.then(function(Ce){Ce instanceof Array?Promise.all(Ce).then(De):De(Ce)});Ee instanceof Array?Promise.all(Ee).then(De):De(Ee)}).then(function(De){return M.loopOverValue(De,ye,B.inverted),Promise.all(de).then(function(Ce){return Ce.map(function(Me){var $e=Me.resolved,Xe=Me.errors;return _(ee,Xe),$e})}).then(function(Ce){if(ee.length>0)throw ee;return Ce})})})}},{key:"render",value:function(B,F){if(B.tag==="p:xfrm"&&(this.inXfrm=B.position==="start"),B.tag==="a:ext"&&this.inXfrm)return this.lastExt=B,B;if(!E(B,S))return null;var M=[],q=[],de=0,ye=this,ee=B.subparsed[0],Ee=0;(ee==null?void 0:ee.tag)==="a:tr"&&(Ee=+z(ee.value,"h")),de-=Ee;var De=0,Ce=W(B);function Me(nr,yr,rr){de+=Ee;for(var ge=F.scopeManager.createSubScopeManager(nr,B.value,yr,B,rr),ve=0,he=B.subparsed;ve<he.length;ve++){var me=he[ve];if(R("a16:rowId",me)){var Fe=+z(me.value,"val")+De;De=1,me.value=G(me.value,"val",Fe)}}var Ue=F.render(t(t({},F),{},{compiled:B.subparsed,tags:{},scopeManager:ge}));B.hasPageBreak&&yr===rr-1&&Ce&&te(Ue);var st=ge.scopePathItem.some(function(mt){return mt!==0});st?(B.sectPrCount===1&&(Ue.parts=le(Ue.parts)),B.addContinuousType&&(Ue.parts=se(Ue.parts))):B.addNextPage&&(Ue.parts=H(Ue.parts,ye.sects[B.addNextPage.index])),B.addNextPage&&te(Ue),B.hasPageBreakBeginning&&Ce&&j(Ue);for(var Ye=0,ct=Ue.parts;Ye<ct.length;Ye++){var pt=ct[Ye];M.push(pt)}_(q,Ue.errors)}var $e=F.scopeManager.getValue(B.value,{part:B});$e??($e=F.nullGetter(B));var Xe=F.scopeManager.loopOverValue($e,Me,B.inverted);if(Xe===!1)return B.lastParagrapSectPr?B.paragraphLoop?{value:"<w:p><w:pPr>".concat(B.lastParagrapSectPr,"</w:pPr></w:p>")}:{value:"</w:t></w:r></w:p><w:p><w:pPr>".concat(B.lastParagrapSectPr,"</w:pPr><w:r><w:t>")}:{value:fe(B)||"",errors:q};if(de!==0){var Tt=+z(this.lastExt.value,"cy");this.lastExt.value=G(this.lastExt.value,"cy",Tt+de)}return{value:F.joinUncorrupt(M,t(t({},F),{},{basePart:B})),errors:q}}}])}();return Vm=function(){return X(new Te)},Vm}var Gm,d2;function LP(){if(d2)return Gm;d2=1;function i(C){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},i(C)}function e(C,I){if(!(C instanceof I))throw new TypeError("Cannot call a class as a function")}function t(C,I){for(var k=0;k<I.length;k++){var D=I[k];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(C,n(D.key),D)}}function r(C,I,k){return I&&t(C.prototype,I),Object.defineProperty(C,"prototype",{writable:!1}),C}function n(C){var I=s(C,"string");return i(I)=="symbol"?I:I+""}function s(C,I){if(i(C)!="object"||!C)return C;var k=C[Symbol.toPrimitive];if(k!==void 0){var D=k.call(C,I);if(i(D)!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}var a=Kl(),o=Fr,l=o.isTextStart,c=o.isTextEnd,h=o.endsWith,d=o.startsWith,p=o.pushArray,g='<w:t xml:space="preserve">',y=g.length,b="</w:t>",w=b.length;function v(C){return l(C)&&C.tag==="w:t"}function A(C,I){var k=C[I].value;return C[I+1].value==="</w:t>"||k.indexOf('xml:space="preserve"')!==-1?k:k.substr(0,k.length-1)+' xml:space="preserve">'}function E(C,I){return C&&C.basePart&&I.length>1}var _=function(){function C(){e(this,C),this.name="SpacePreserveModule"}return r(C,[{key:"postparse",value:function(k,D){var R=[],z=!1,G=0,O=0;function X(J,Y){return J.type==="placeholder"&&Y.length>1}var S=k.reduce(function(J,Y){return v(Y)&&(z=!0,O=R.length),z?(R.push(Y),E(D,R)&&(G=D.basePart.endLindex,R[0].value=A(R,0)),X(Y,R)&&(R[O].value=A(R,O),G=Y.endLindex),c(Y)&&Y.lIndex>G&&(G!==0&&(R[O].value=A(R,O)),p(J,R),R=[],z=!1,G=0,O=0),J):(J.push(Y),J)},[]);return p(S,R),S}},{key:"postrender",value:function(k){for(var D="",R=0,z=0,G=k.length;z<G;z++){var O=k[z];O!==""&&(h(D,g)&&d(O,b)&&(k[R]=D.substr(0,D.length-y)+"<w:t/>",O=O.substr(w)),D=O,R=z,k[z]=O)}return k}}])}();return Gm=function(){return a(new _)},Gm}var qm,f2;function OP(){if(f2)return qm;f2=1;function i(w){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},i(w)}function e(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function t(w,v){for(var A=0;A<v.length;A++){var E=v[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,n(E.key),E)}}function r(w,v,A){return v&&t(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),w}function n(w){var v=s(w,"string");return i(v)=="symbol"?v:v+""}function s(w,v){if(i(w)!="object"||!w)return w;var A=w[Symbol.toPrimitive];if(A!==void 0){var E=A.call(w,v);if(i(E)!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var a=sv(),o=Fr,l=o.isContent,c=Xi,h=c.throwRawTagShouldBeOnlyTextInParagraph,d=c.getInvalidRawXMLValueException,p=Kl(),g="rawxml";function y(w){for(var v=w.part,A=w.left,E=w.right,_=w.postparsed,C=w.index,I=_.slice(A+1,E),k=0,D=I.length;k<D;k++)if(k!==C-A-1){var R=I[k];l(R)&&h({paragraphParts:I,part:v})}return v}var b=function(){function w(){e(this,w),this.name="RawXmlModule",this.prefix="@"}return r(w,[{key:"optionsTransformer",value:function(A,E){return this.fileTypeConfig=E.fileTypeConfig,A}},{key:"matchers",value:function(){return[[this.prefix,g]]}},{key:"postparse",value:function(A){return a.expandToOne(A,{moduleName:g,getInner:y,expandTo:this.fileTypeConfig.tagRawXml,error:{message:"Raw tag not in paragraph",id:"raw_tag_outerxml_invalid",explanation:function(_){return'The tag "'.concat(_.value,'" is not inside a paragraph, putting raw tags inside an inline loop is disallowed.')}}})}},{key:"render",value:function(A,E){if(A.module!==g)return null;var _,C=[];try{_=E.scopeManager.getValue(A.value,{part:A}),_??(_=E.nullGetter(A))}catch(I){return C.push(I),{errors:C}}return _=_||"",typeof _=="string"?{value:_}:{errors:[d({tag:A.value,value:_,offset:A.offset})]}}}])}();return qm=function(){return p(new b)},qm}var Wm,p2;function FP(){if(p2)return Wm;p2=1;function i(e,t){for(var r=-1,n=0,s=e.length;n<s;n++)t[n]>=e[n].length||(r===-1||e[n][t[n]].offset<e[r][t[r]].offset)&&(r=n);return r}return Wm=function(e){for(var t=0,r=0,n=e;r<n.length;r++){var s=n[r];t+=s.length}e=e.filter(function(h){return h.length>0});for(var a=new Array(t),o=e.map(function(){return 0}),l=0;l<t;l++){var c=i(e,o);a[l]=e[c][o[c]],o[c]++}return a},Wm}var Xm,g2;function BP(){if(g2)return Xm;g2=1;function i(D){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},i(D)}function e(D,R){if(!(D instanceof R))throw new TypeError("Cannot call a class as a function")}function t(D,R){for(var z=0;z<R.length;z++){var G=R[z];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(D,n(G.key),G)}}function r(D,R,z){return R&&t(D.prototype,R),Object.defineProperty(D,"prototype",{writable:!1}),D}function n(D){var R=s(D,"string");return i(R)=="symbol"?R:R+""}function s(D,R){if(i(D)!="object"||!D)return D;var z=D[Symbol.toPrimitive];if(z!==void 0){var G=z.call(D,R);if(i(G)!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(D)}var a="expandPair",o=FP(),l=Fr,c=l.getLeft,h=l.getRight,d=l.pushArray,p=Kl(),g=sv(),y=g.getExpandToDefault,b=Xi,w=b.getUnmatchedLoopException,v=b.getClosingTagNotMatchOpeningTag,A=b.getUnbalancedLoopException;function E(D){switch(D.location){case"start":return 1;case"end":return-1}}function _(D,R){return D!=null&&R!=null&&(D.part.location==="start"&&R.part.location==="end"&&D.part.value===R.part.value||R.part.value==="")}function C(D){for(var R=0,z=[];R<D.length;){var G=D[R].part;if(G.location==="end"){if(R===0)return D.splice(0,1),z.push(w(G)),{traits:D,errors:z};var O=R,X=R-1,S=1;if(_(D[X],D[O]))return D.splice(O,1),D.splice(X,1),{errors:z,traits:D};for(;S<50;){var J=D[X-S],Y=D[O+S];if(_(J,D[O]))return D.splice(O,1),D.splice(X-S,1),{errors:z,traits:D};if(_(D[X],Y))return D.splice(O+S,1),D.splice(X,1),{errors:z,traits:D};S++}return z.push(v({tags:[D[X].part,D[O].part]})),D.splice(O,1),D.splice(X,1),{traits:D,errors:z}}R++}for(var W=0;W<D.length;W++){var fe=D[W].part;z.push(w(fe))}return{traits:[],errors:z}}function I(D){var R={},z=[],G=[],O=[];for(d(O,D);O.length>0;){var X=C(O);d(z,X.errors),O=X.traits}if(z.length>0)return{pairs:G,errors:z};for(var S=0,J=0;J<D.length;J++){var Y=D[J],W=Y.part,fe=E(W);if(S+=fe,fe===1)R[S]=Y;else{var K=R[S+1];S===0&&G.push([K,Y])}S=S>=0?S:0}return{pairs:G,errors:z}}var k=function(){function D(){e(this,D),this.name="ExpandPairTrait"}return r(D,[{key:"optionsTransformer",value:function(z,G){return G.options.paragraphLoop&&d(G.fileTypeConfig.expandTags,G.fileTypeConfig.onParagraphLoop),this.expandTags=G.fileTypeConfig.expandTags,z}},{key:"postparse",value:function(z,G){var O=this,X=G.getTraits,S=G.postparse,J=G.fileType,Y=X(a,z);Y=Y.map(function(se){return se||[]}),Y=o(Y);var W=I(Y),fe=W.pairs,K=W.errors,be=0,te=null,j=fe.map(function(se){var le=se[0].part.expandTo;if(le==="auto"&&J!=="text"){var oe=y(z,se,O.expandTags);oe.error&&K.push(oe.error),le=oe.value}if(!le||J==="text"){var ce=se[0].offset,Ae=se[1].offset;return ce<be&&!O.docxtemplater.options.syntax.allowUnbalancedLoops&&K.push(A(se,te)),te=se,be=Ae,[ce,Ae]}var Se,Ne;try{Se=c(z,le,se[0].offset)}catch(Te){K.push(Te)}try{Ne=h(z,le,se[1].offset)}catch(Te){K.push(Te)}return Se<be&&!O.docxtemplater.options.syntax.allowUnbalancedLoops&&K.push(A(se,te)),be=Ne,te=se,[Se,Ne]});if(K.length>0)return{postparsed:z,errors:K};var ie=0,ae,H=z.reduce(function(se,le,oe){var ce=ie<fe.length&&j[ie][0]<=oe&&oe<=j[ie][1],Ae=fe[ie],Se=j[ie];if(!ce)return se.push(le),se;if(Se[0]===oe&&(ae=[]),Ae[0].offset!==oe&&Ae[1].offset!==oe&&ae.push(le),Se[1]===oe){var Ne=z[Ae[0].offset];Ne.subparsed=S(ae,{basePart:Ne}),Ne.endLindex=Ae[1].part.lIndex,delete Ne.location,delete Ne.expandTo,se.push(Ne),ie++;for(var Te=j[ie];Te&&Te[0]<oe;)ie++,Te=j[ie]}return se},[]);return{postparsed:H,errors:K}}}])}();return Xm=function(){return p(new k)},Xm}var Ym,m2;function zP(){if(m2)return Ym;m2=1;function i(I){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},i(I)}function e(I,k){if(!(I instanceof k))throw new TypeError("Cannot call a class as a function")}function t(I,k){for(var D=0;D<k.length;D++){var R=k[D];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,n(R.key),R)}}function r(I,k,D){return k&&t(I.prototype,k),Object.defineProperty(I,"prototype",{writable:!1}),I}function n(I){var k=s(I,"string");return i(k)=="symbol"?k:k+""}function s(I,k){if(i(I)!="object"||!I)return I;var D=I[Symbol.toPrimitive];if(D!==void 0){var R=D.call(I,k);if(i(R)!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}var a=Kl(),o=Xi,l=o.getScopeCompilationError,c=o.getCorruptCharactersException,h=Fr,d=h.utf8ToWord,p=h.hasCorruptCharacters,g=h.removeCorruptCharacters,y=vA(),b=y.settingsContentType,w=y.coreContentType,v=y.appContentType,A=y.customContentType,E=[b,w,v,A],_={docx:"w",pptx:"a"},C=function(){function I(){e(this,I),this.name="Render",this.recordRun=!1,this.recordedRun=[]}return r(I,[{key:"optionsTransformer",value:function(D,R){return this.docxtemplater=R,this.brTag=R.fileType==="docx"?"<w:r><w:br/></w:r>":"<a:br/>",this.prefix=_[R.fileType],this.runStartTag="".concat(this.prefix,":r"),this.runPropsStartTag="".concat(this.prefix,":rPr"),D}},{key:"set",value:function(D){D.compiled&&(this.compiled=D.compiled),D.data!=null&&(this.data=D.data)}},{key:"getRenderedMap",value:function(D){for(var R in this.compiled)D[R]={from:R,data:this.data};return D}},{key:"postparse",value:function(D,R){for(var z=[],G=0;G<D.length;G++){var O=D[G];if(O.type==="placeholder"){var X=O.value;try{R.cachedParsers[O.lIndex]=this.docxtemplater.parser(X,{tag:O})}catch(S){z.push(l({tag:X,rootError:S,offset:O.offset}))}}}return{postparsed:D,errors:z}}},{key:"render",value:function(D,R){var z=R.contentType,G=R.scopeManager,O=R.linebreaks,X=R.nullGetter,S=R.fileType,J=R.stripInvalidXMLChars;if(E.indexOf(z)!==-1&&(O=!1),O&&this.recordRuns(D),!(D.type!=="placeholder"||D.module)){var Y;try{Y=G.getValue(D.value,{part:D})}catch(W){return{errors:[W]}}if(Y??(Y=X(D)),typeof Y=="string"){if(J)Y=g(Y);else if(["docx","pptx","xlsx"].indexOf(S)!==-1&&p(Y))return{errors:[c({tag:D.value,value:Y,offset:D.offset})]}}return S==="text"?{value:Y}:{value:O&&typeof Y=="string"?this.renderLineBreaks(Y):d(Y)}}}},{key:"recordRuns",value:function(D){D.tag===this.runStartTag?this.recordedRun="":D.tag===this.runPropsStartTag?(D.position==="start"&&(this.recordRun=!0,this.recordedRun+=D.value),(D.position==="end"||D.position==="selfclosing")&&(this.recordedRun+=D.value,this.recordRun=!1)):this.recordRun&&(this.recordedRun+=D.value)}},{key:"renderLineBreaks",value:function(D){for(var R=[],z=D.split(`
56
56
  `),G=0,O=z.length;G<O;G++)R.push(d(z[G])),G<z.length-1&&R.push("</".concat(this.prefix,":t></").concat(this.prefix,":r>").concat(this.brTag,"<").concat(this.prefix,":r>").concat(this.recordedRun,"<").concat(this.prefix,":t").concat(this.docxtemplater.fileType==="docx"?' xml:space="preserve"':"",">"));return R}}])}();return Ym=function(){return a(new C)},Ym}var Zm,b2;function jP(){if(b2)return Zm;b2=1;var i=MP(),e=LP(),t=OP(),r=BP(),n=zP();function s(){return{getTemplatedFiles:function(){return[]},textPath:function(l){return l.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","cp:contentStatus","w:t","a:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["w:proofState","w:tc","w:tr","w:tbl","w:ftr","w:hdr","w:body","w:document","w:p","w:r","w:br","w:rPr","w:pPr","w:spacing","w:sdtContent","w:sdt","w:drawing","w:sectPr","w:type","w:headerReference","w:footerReference","w:bookmarkStart","w:bookmarkEnd","w:commentRangeStart","w:commentRangeEnd","w:commentReference"],droppedTagsInsidePlaceholder:["w:p","w:br","w:bookmarkStart","w:bookmarkEnd"],expandTags:[{contains:"w:tc",expand:"w:tr"}],onParagraphLoop:[{contains:"w:p",expand:"w:p",onlyTextInTag:!0}],tagRawXml:"w:p",baseModules:[i,e,r,t,n],tagShouldContain:[{tag:"w:sdtContent",shouldContain:["w:p","w:r","w:commentRangeStart","w:sdt"],value:"<w:p></w:p>"},{tag:"w:tc",shouldContain:["w:p"],value:"<w:p></w:p>"},{tag:"w:tr",shouldContain:["w:tc"],drop:!0},{tag:"w:tbl",shouldContain:["w:tr"],drop:!0}]}}function a(){return{getTemplatedFiles:function(){return[]},textPath:function(l){return l.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","a:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["p:sp","a:tc","a:tr","a:tbl","a:graphicData","a:p","a:r","a:rPr","p:txBody","a:txBody","a:off","a:ext","p:graphicFrame","p:xfrm","a16:rowId","a:endParaRPr"],droppedTagsInsidePlaceholder:["a:p","a:endParaRPr"],expandTags:[{contains:"a:tc",expand:"a:tr"}],onParagraphLoop:[{contains:"a:p",expand:"a:p",onlyTextInTag:!0}],tagRawXml:"p:sp",baseModules:[i,r,t,n],tagShouldContain:[{tag:"a:tbl",shouldContain:["a:tr"],dropParent:"p:graphicFrame"},{tag:"p:txBody",shouldContain:["a:p"],value:"<a:p></a:p>"},{tag:"a:txBody",shouldContain:["a:p"],value:"<a:p></a:p>"}]}}return Zm={docx:s,pptx:a},Zm}(function(i){var e=["modules"];function t(ge,ve){var he=Object.keys(ge);if(Object.getOwnPropertySymbols){var me=Object.getOwnPropertySymbols(ge);ve&&(me=me.filter(function(Fe){return Object.getOwnPropertyDescriptor(ge,Fe).enumerable})),he.push.apply(he,me)}return he}function r(ge){for(var ve=1;ve<arguments.length;ve++){var he=arguments[ve]!=null?arguments[ve]:{};ve%2?t(Object(he),!0).forEach(function(me){n(ge,me,he[me])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ge,Object.getOwnPropertyDescriptors(he)):t(Object(he)).forEach(function(me){Object.defineProperty(ge,me,Object.getOwnPropertyDescriptor(he,me))})}return ge}function n(ge,ve,he){return(ve=v(ve))in ge?Object.defineProperty(ge,ve,{value:he,enumerable:!0,configurable:!0,writable:!0}):ge[ve]=he,ge}function s(ge,ve){return h(ge)||c(ge,ve)||o(ge,ve)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
57
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(ge,ve){if(ge){if(typeof ge=="string")return l(ge,ve);var he={}.toString.call(ge).slice(8,-1);return he==="Object"&&ge.constructor&&(he=ge.constructor.name),he==="Map"||he==="Set"?Array.from(ge):he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he)?l(ge,ve):void 0}}function l(ge,ve){(ve==null||ve>ge.length)&&(ve=ge.length);for(var he=0,me=Array(ve);he<ve;he++)me[he]=ge[he];return me}function c(ge,ve){var he=ge==null?null:typeof Symbol<"u"&&ge[Symbol.iterator]||ge["@@iterator"];if(he!=null){var me,Fe,Ue,st,Ye=[],ct=!0,pt=!1;try{if(Ue=(he=he.call(ge)).next,ve===0){if(Object(he)!==he)return;ct=!1}else for(;!(ct=(me=Ue.call(he)).done)&&(Ye.push(me.value),Ye.length!==ve);ct=!0);}catch(mt){pt=!0,Fe=mt}finally{try{if(!ct&&he.return!=null&&(st=he.return(),Object(st)!==st))return}finally{if(pt)throw Fe}}return Ye}}function h(ge){if(Array.isArray(ge))return ge}function d(ge){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ve){return typeof ve}:function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},d(ge)}function p(ge,ve){if(ge==null)return{};var he,me,Fe=g(ge,ve);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(ge);for(me=0;me<Ue.length;me++)he=Ue[me],ve.indexOf(he)===-1&&{}.propertyIsEnumerable.call(ge,he)&&(Fe[he]=ge[he])}return Fe}function g(ge,ve){if(ge==null)return{};var he={};for(var me in ge)if({}.hasOwnProperty.call(ge,me)){if(ve.indexOf(me)!==-1)continue;he[me]=ge[me]}return he}function y(ge,ve){if(!(ge instanceof ve))throw new TypeError("Cannot call a class as a function")}function b(ge,ve){for(var he=0;he<ve.length;he++){var me=ve[he];me.enumerable=me.enumerable||!1,me.configurable=!0,"value"in me&&(me.writable=!0),Object.defineProperty(ge,v(me.key),me)}}function w(ge,ve,he){return ve&&b(ge.prototype,ve),Object.defineProperty(ge,"prototype",{writable:!1}),ge}function v(ge){var ve=A(ge,"string");return d(ve)=="symbol"?ve:ve+""}function A(ge,ve){if(d(ge)!="object"||!ge)return ge;var he=ge[Symbol.toPrimitive];if(he!==void 0){var me=he.call(ge,ve);if(d(me)!="object")return me;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ge)}var E=Fr,_=wP,C=_.object({allowUnopenedTag:_.boolean().optional(),allowUnclosedTag:_.boolean().optional(),allowUnbalancedLoops:_.boolean().optional(),changeDelimiterPrefix:_.string().optional().nullable()}),I=_.object({delimiters:_.object({start:_.string().nullable(),end:_.string().nullable()}).strict().optional(),fileTypeConfig:_.object({}).optional(),paragraphLoop:_.boolean().optional(),parser:_.function().optional(),errorLogging:_.union([_.boolean(),_.string()]).optional(),linebreaks:_.boolean().optional(),nullGetter:_.function().optional(),syntax:C.optional(),stripInvalidXMLChars:_.boolean().optional()}).strict(),k=xP(),D=k.getRelsTypes,R=AP(),z=R.collectContentTypes,G=R.getContentTypes,O=Kl(),X=sv(),S=EP(),J=_P(),Y=yA(),W=CP(),fe=W.getTags,K=SP(),be=Xi,te=be.throwMultiError,j=be.throwResolveBeforeCompile,ie=be.throwRenderInvalidTemplate,ae=be.throwRenderTwice,H=be.XTInternalError,se=be.XTTemplateError,le=be.throwFileTypeNotIdentified,oe=be.throwFileTypeNotHandled,ce=be.throwApiVersionError;E.getRelsTypes=D,E.traits=X,E.moduleWrapper=O,E.collectContentTypes=z,E.getContentTypes=G;var Ae=E.getDefaults,Se=E.str2xml,Ne=E.xml2str,Te=E.concatArrays,x=E.uniq,U=E.getDuplicates,B=E.stableSort,F=E.pushArray,M=E.utf8ToWord,q=E.invertMap,de="[Content_Types].xml",we="_rels/.rels",ee=[3,47,2];function Ee(ge){var ve=U(ge.map(function(he){var me=he.name;return me}));if(ve.length>0)throw new H('Detected duplicate module "'.concat(ve[0],'"'))}function De(ge){for(var ve=0,he=ge.modules;ve<he.length;ve++)for(var me=he[ve],Fe=0,Ue=me.xmlContentTypes||[];Fe<Ue.length;Fe++)for(var st=Ue[Fe],Ye=ge.invertedContentTypes[st]||[],ct=0;ct<Ye.length;ct++){var pt=Ye[ct];ge.zip.files[pt]&&ge.options.xmlFileNames.push(pt)}}function Ce(ge){return B(ge,function(ve,he){return(he.priority||0)-(ve.priority||0)})}function Me(ge){var ve=[];for(var he in ge)ve.push(he);for(var me=[de,we],Fe=["word/","xl/","ppt/"],Ue=0;Ue<ve.length;Ue++)for(var st=ve[Ue],Ye=0;Ye<Fe.length;Ye++){var ct=Fe[Ye];st.indexOf("".concat(ct))===0&&me.push(st)}for(var pt=0;pt<ve.length;pt++){var mt=ve[pt];me.indexOf(mt)===-1&&me.push(mt)}return me}function $e(ge,ve){ge.hideDeprecations!==!0&&console.warn(ve)}function Xe(ge,ve){if(ge.hideDeprecations!==!0)return $e(ge,'Deprecated method ".'.concat(ve,'", view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : ').concat(new Error().stack))}function Tt(ge){ge.modules=ge.modules.filter(function(ve){if(!ve.supportedFileTypes)return!0;if(!Array.isArray(ve.supportedFileTypes))throw new Error("The supportedFileTypes field of the module must be an array");var he=ve.supportedFileTypes.includes(ge.fileType);return he||ve.on("detached"),he})}function nr(ge){var ve=ge.compiled;ge.errors=Te(Object.keys(ve).map(function(he){return ve[he].allErrors})),ge.errors.length!==0&&(ge.options.errorLogging&&K(ge.errors,ge.options.errorLogging),te(ge.errors))}function yr(ge){return typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(ge)}var rr=function(){function ge(ve){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=he.modules,Fe=me===void 0?[]:me,Ue=p(he,e);if(y(this,ge),this.targets=[],this.rendered=!1,this.scopeManagers={},this.compiled={},this.modules=[S()],this.xmlDocuments={},arguments.length===0)$e(this,"Deprecated docxtemplater constructor with no arguments, view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : ".concat(new Error().stack)),this.hideDeprecations=!0,this.setOptions(Ue);else{if(this.hideDeprecations=!0,this.setOptions(Ue),yr(ve))throw new Error("You passed a Buffer to the Docxtemplater constructor. The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)");if(!ve||!ve.files||typeof ve.file!="function")throw new Error("The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)");if(!Array.isArray(Fe))throw new Error("The modules argument of docxtemplater's constructor must be an array");for(var st=0;st<Fe.length;st++){var Ye=Fe[st];this.attachModule(Ye)}this.loadZip(ve),this.compile(),this.v4Constructor=!0}this.hideDeprecations=!1}return w(ge,[{key:"verifyApiVersion",value:function(he){return he=he.split(".").map(function(me){return parseInt(me,10)}),he.length!==3&&ce("neededVersion is not a valid version",{neededVersion:he,explanation:"the neededVersion must be an array of length 3"}),he[0]!==ee[0]&&ce("The major api version do not match, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:he,currentModuleApiVersion:ee,explanation:"moduleAPIVersionMismatch : needed=".concat(he.join("."),", current=").concat(ee.join("."))}),he[1]>ee[1]&&ce("The minor api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:he,currentModuleApiVersion:ee,explanation:"moduleAPIVersionMismatch : needed=".concat(he.join("."),", current=").concat(ee.join("."))}),he[1]===ee[1]&&he[2]>ee[2]&&ce("The patch api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:he,currentModuleApiVersion:ee,explanation:"moduleAPIVersionMismatch : needed=".concat(he.join("."),", current=").concat(ee.join("."))}),!0}},{key:"setModules",value:function(he){for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];Ue.set(he)}}},{key:"sendEvent",value:function(he){for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];Ue.on(he)}}},{key:"attachModule",value:function(he){if(this.v4Constructor)throw new H("attachModule() should not be called manually when using the v4 constructor");Xe(this,"attachModule");var me=d(he);if(me==="function")throw new H("Cannot attach a class/function as a module. Most probably you forgot to instantiate the module by using `new` on the module.");if(!he||me!=="object")throw new H("Cannot attachModule with a falsy value");if(he.requiredAPIVersion&&this.verifyApiVersion(he.requiredAPIVersion),he.attached===!0)if(typeof he.clone=="function")he=he.clone();else throw new Error('Cannot attach a module that was already attached : "'.concat(he.name,'". The most likely cause is that you are instantiating the module at the root level, and using it for multiple instances of Docxtemplater'));he.attached=!0;var Fe=O(he);return this.modules.push(Fe),Fe.on("attached"),this.fileType&&Tt(this),this}},{key:"findModule",value:function(he){for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];if(Ue.name===he)return Ue}}},{key:"setOptions",value:function(he){var me,Fe;if(this.v4Constructor)throw new Error("setOptions() should not be called manually when using the v4 constructor");if(!he)throw new Error("setOptions should be called with an object as first parameter");var Ue=I.validate(he);if(Ue.success===!1)throw new Error(Ue.error);Xe(this,"setOptions"),this.options={};var st=Ae();for(var Ye in st){var ct=st[Ye];this.options[Ye]=he[Ye]!=null?he[Ye]:this[Ye]||ct,this[Ye]=this.options[Ye]}return(me=this.delimiters).start&&(me.start=M(this.delimiters.start)),(Fe=this.delimiters).end&&(Fe.end=M(this.delimiters.end)),this}},{key:"loadZip",value:function(he){if(this.v4Constructor)throw new Error("loadZip() should not be called manually when using the v4 constructor");if(Xe(this,"loadZip"),he.loadAsync)throw new H("Docxtemplater doesn't handle JSZip version >=3, please use pizzip");this.zip=he,this.updateFileTypeConfig(),this.modules=Te([this.fileTypeConfig.baseModules.map(function(st){return st()}),this.modules]);for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];Ue.zip=this.zip,Ue.docxtemplater=this,Ue.fileTypeConfig=this.fileTypeConfig,Ue.fileType=this.fileType,Ue.xtOptions=this.options,Ue.modules=this.modules}return Tt(this),this}},{key:"precompileFile",value:function(he){var me=this.createTemplateClass(he);me.preparse(),this.compiled[he]=me}},{key:"compileFile",value:function(he){this.compiled[he].parse()}},{key:"getScopeManager",value:function(he,me,Fe){var Ue;return(Ue=this.scopeManagers)[he]||(Ue[he]=J({tags:Fe,parser:this.parser,cachedParsers:me.cachedParsers})),this.scopeManagers[he]}},{key:"resolveData",value:function(he){var me=this;Xe(this,"resolveData");var Fe=[];return Object.keys(this.compiled).length||j(),Promise.resolve(he).then(function(Ue){return me.data=Ue,me.setModules({data:me.data,Lexer:Y}),me.mapper=me.modules.reduce(function(st,Ye){return Ye.getRenderedMap(st)},{}),Promise.all(Object.keys(me.mapper).map(function(st){var Ye=me.mapper[st],ct=Ye.from,pt=Ye.data;return Promise.resolve(pt).then(function(mt){var Ft=me.compiled[ct];return Ft.filePath=st,Ft.scopeManager=me.getScopeManager(st,Ft,mt),Ft.resolveTags(mt).then(function(at){return Ft.scopeManager.finishedResolving=!0,at},function(at){F(Fe,at)})})})).then(function(st){return Fe.length!==0&&(me.options.errorLogging&&K(Fe,me.options.errorLogging),te(Fe)),Te(st)})})}},{key:"compile",value:function(){if(Xe(this,"compile"),this.updateFileTypeConfig(),Ee(this.modules),this.modules=Ce(this.modules),Object.keys(this.compiled).length)return this;for(var he=this.options,me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];he=Ue.optionsTransformer(he,this)}this.options=he,this.options.xmlFileNames=x(this.options.xmlFileNames);for(var st=0,Ye=this.options.xmlFileNames;st<Ye.length;st++){var ct=Ye[st],pt=this.zip.files[ct].asText();this.xmlDocuments[ct]=Se(pt)}this.setModules({zip:this.zip,xmlDocuments:this.xmlDocuments});for(var mt=0,Ft=this.modules;mt<Ft.length;mt++){var at=Ft[mt];at.xmlDocuments=this.xmlDocuments}this.getTemplatedFiles(),this.sendEvent("before-preparse");for(var nn=0,jn=this.templatedFiles;nn<jn.length;nn++){var Ti=jn[nn];this.zip.files[Ti]!=null&&this.precompileFile(Ti)}this.sendEvent("after-preparse");for(var mn=0,Zi=this.templatedFiles;mn<Zi.length;mn++){var Un=Zi[mn];this.zip.files[Un]!=null&&this.compiled[Un].parse({noPostParse:!0})}this.sendEvent("after-parse");for(var sn=0,Wr=this.templatedFiles;sn<Wr.length;sn++){var ui=Wr[sn];this.zip.files[ui]!=null&&this.compiled[ui].postparse()}return this.sendEvent("after-postparse"),this.setModules({compiled:this.compiled}),nr(this),this}},{key:"updateFileTypeConfig",value:function(){this.relsTypes=D(this.zip);var he=G(this.zip),me=he.overrides,Fe=he.defaults,Ue=he.contentTypes,st=he.contentTypeXml;st&&(this.filesContentTypes=z(me,Fe,this.zip),this.invertedContentTypes=q(this.filesContentTypes),this.setModules({contentTypes:this.contentTypes,invertedContentTypes:this.invertedContentTypes}));var Ye;this.zip.files.mimetype&&(Ye="odt");for(var ct=0,pt=this.modules;ct<pt.length;ct++){var mt=pt[ct];Ye=mt.getFileType({zip:this.zip,contentTypes:Ue,contentTypeXml:st,overrides:me,defaults:Fe,doc:this})||Ye}if(this.fileType=Ye,Ye==="odt"&&oe(Ye),Ye||le(this.zip),De(this),Tt(this),this.fileTypeConfig=this.options.fileTypeConfig||this.fileTypeConfig,!this.fileTypeConfig)if(ge.FileTypeConfig[this.fileType])this.fileTypeConfig=ge.FileTypeConfig[this.fileType]();else{var Ft='Filetype "'.concat(this.fileType,'" is not supported'),at="filetype_not_supported";this.fileType==="xlsx"&&(Ft='Filetype "'.concat(this.fileType,'" is supported only with the paid XlsxModule'),at="xlsx_filetype_needs_xlsx_module");var nn=new se(Ft);throw nn.properties={id:at,explanation:Ft},nn}return this}},{key:"renderAsync",value:function(he){var me=this;this.hideDeprecations=!0;var Fe=this.resolveData(he);return this.hideDeprecations=!1,Fe.then(function(){return me.render()})}},{key:"render",value:function(he){this.rendered&&ae(),this.rendered=!0,Object.keys(this.compiled).length===0&&this.compile(),this.errors.length>0&&ie(),arguments.length>0&&(this.data=he),this.setModules({data:this.data,Lexer:Y}),this.mapper||(this.mapper=this.modules.reduce(function(Uc,Es){return Es.getRenderedMap(Uc)},{}));var me=[];for(var Fe in this.mapper){var Ue=this.mapper[Fe],st=Ue.from,Ye=Ue.data,ct=this.compiled[st];ct.scopeManager=this.getScopeManager(Fe,ct,Ye),ct.render(Fe),me.push([Fe,ct.content,ct]),delete ct.content}for(var pt=0;pt<me.length;pt++)for(var mt=me[pt],Ft=s(mt,3),at=Ft[1],nn=Ft[2],jn=0,Ti=this.modules;jn<Ti.length;jn++){var mn=Ti[jn];if(mn.preZip){var Zi=mn.preZip(at,nn);typeof Zi=="string"&&(mt[1]=Zi)}}for(var Un=0;Un<me.length;Un++){var sn=s(me[Un],2),Wr=sn[0],ui=sn[1];this.zip.file(Wr,ui,{createFolders:!0})}return nr(this),this.sendEvent("syncing-zip"),this.syncZip(),this.sendEvent("synced-zip"),this}},{key:"syncZip",value:function(){for(var he in this.xmlDocuments){this.zip.remove(he);var me=Ne(this.xmlDocuments[he]);this.zip.file(he,me,{createFolders:!0})}}},{key:"setData",value:function(he){return Xe(this,"setData"),this.data=he,this}},{key:"getZip",value:function(){return this.zip}},{key:"createTemplateClass",value:function(he){var me=this.zip.files[he].asText();return this.createTemplateClassFromContent(me,he)}},{key:"createTemplateClassFromContent",value:function(he,me){for(var Fe={filePath:me,contentType:this.filesContentTypes[me],relsType:this.relsTypes[me]},Ue=Ae(),st=F(Object.keys(Ue),["filesContentTypes","fileTypeConfig","fileType","modules"]),Ye=0;Ye<st.length;Ye++){var ct=st[Ye];Fe[ct]=this[ct]}return new ge.XmlTemplater(he,Fe)}},{key:"getFullText",value:function(he){return this.createTemplateClass(he||this.fileTypeConfig.textPath(this)).getFullText()}},{key:"getTemplatedFiles",value:function(){return this.templatedFiles=this.fileTypeConfig.getTemplatedFiles(this.zip),F(this.templatedFiles,this.targets),this.templatedFiles=x(this.templatedFiles),this.templatedFiles}},{key:"getTags",value:function(){var he={headers:[],footers:[]};for(var me in this.compiled){var Fe=this.filesContentTypes[me];Fe==="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"&&(he.document={target:me,tags:fe(this.compiled[me].postparsed)}),Fe==="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml"&&he.headers.push({target:me,tags:fe(this.compiled[me].postparsed)}),Fe==="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml"&&he.footers.push({target:me,tags:fe(this.compiled[me].postparsed)})}return he}},{key:"toBuffer",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"nodebuffer"}))}},{key:"toBlob",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"blob"}))}},{key:"toBase64",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"base64"}))}},{key:"toUint8Array",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"uint8array"}))}},{key:"toArrayBuffer",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"arraybuffer"}))}}])}();rr.DocUtils=E,rr.Errors=Xi,rr.XmlTemplater=NP(),rr.FileTypeConfig=jP(),rr.XmlMatcher=wA(),i.exports=rr,i.exports.default=rr})(Ex);var UP=Ex.exports;const v2=_g(UP);var AA={exports:{}},Bf={},io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Bf.encode=function(i){for(var e="",t,r,n,s,a,o,l,c=0;c<i.length;)t=i.charCodeAt(c++),r=i.charCodeAt(c++),n=i.charCodeAt(c++),s=t>>2,a=(t&3)<<4|r>>4,o=(r&15)<<2|n>>6,l=n&63,isNaN(r)?o=l=64:isNaN(n)&&(l=64),e=e+io.charAt(s)+io.charAt(a)+io.charAt(o)+io.charAt(l);return e};Bf.decode=function(i){var e="",t,r,n,s,a,o,l,c=0;for(i=i.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<i.length;)s=io.indexOf(i.charAt(c++)),a=io.indexOf(i.charAt(c++)),o=io.indexOf(i.charAt(c++)),l=io.indexOf(i.charAt(c++)),t=s<<2|a>>4,r=(a&15)<<4|o>>2,n=(o&3)<<6|l,e+=String.fromCharCode(t),o!==64&&(e+=String.fromCharCode(r)),l!==64&&(e+=String.fromCharCode(n));return e};var pn={},cp;pn.base64=!0;pn.array=!0;pn.string=!0;pn.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";pn.nodebuffer=typeof Buffer<"u";pn.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")cp=pn.blob=!1;else{var y2=new ArrayBuffer(0);try{cp=pn.blob=new Blob([y2],{type:"application/zip"}).size===0}catch{try{var HP=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,w2=new HP;w2.append(y2),cp=pn.blob=w2.getBlob("application/zip").size===0}catch{cp=pn.blob=!1}}}var Ci={},zf={},jc={},Ab={exports:{}};/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(i,e){(function(t,r){r(e)})(sh,function(t){function r(f){for(var P=f.length;--P>=0;)f[P]=0}var n=256,s=286,a=30,o=15,l=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),c=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),d=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=new Array(576);r(p);var g=new Array(60);r(g);var y=new Array(512);r(y);var b=new Array(256);r(b);var w=new Array(29);r(w);var v,A,E,_=new Array(a);function C(f,P,m,$,V){this.static_tree=f,this.extra_bits=P,this.extra_base=m,this.elems=$,this.max_length=V,this.has_stree=f&&f.length}function I(f,P){this.dyn_tree=f,this.max_code=0,this.stat_desc=P}r(_);var k=function(f){return f<256?y[f]:y[256+(f>>>7)]},D=function(f,P){f.pending_buf[f.pending++]=255&P,f.pending_buf[f.pending++]=P>>>8&255},R=function(f,P,m){f.bi_valid>16-m?(f.bi_buf|=P<<f.bi_valid&65535,D(f,f.bi_buf),f.bi_buf=P>>16-f.bi_valid,f.bi_valid+=m-16):(f.bi_buf|=P<<f.bi_valid&65535,f.bi_valid+=m)},z=function(f,P,m){R(f,m[2*P],m[2*P+1])},G=function(f,P){var m=0;do m|=1&f,f>>>=1,m<<=1;while(--P>0);return m>>>1},O=function(f,P,m){var $,V,Z=new Array(16),_e=0;for($=1;$<=o;$++)_e=_e+m[$-1]<<1,Z[$]=_e;for(V=0;V<=P;V++){var re=f[2*V+1];re!==0&&(f[2*V]=G(Z[re]++,re))}},X=function(f){var P;for(P=0;P<s;P++)f.dyn_ltree[2*P]=0;for(P=0;P<a;P++)f.dyn_dtree[2*P]=0;for(P=0;P<19;P++)f.bl_tree[2*P]=0;f.dyn_ltree[512]=1,f.opt_len=f.static_len=0,f.sym_next=f.matches=0},S=function(f){f.bi_valid>8?D(f,f.bi_buf):f.bi_valid>0&&(f.pending_buf[f.pending++]=f.bi_buf),f.bi_buf=0,f.bi_valid=0},J=function(f,P,m,$){var V=2*P,Z=2*m;return f[V]<f[Z]||f[V]===f[Z]&&$[P]<=$[m]},Y=function(f,P,m){for(var $=f.heap[m],V=m<<1;V<=f.heap_len&&(V<f.heap_len&&J(P,f.heap[V+1],f.heap[V],f.depth)&&V++,!J(P,$,f.heap[V],f.depth));)f.heap[m]=f.heap[V],m=V,V<<=1;f.heap[m]=$},W=function(f,P,m){var $,V,Z,_e,re=0;if(f.sym_next!==0)do $=255&f.pending_buf[f.sym_buf+re++],$+=(255&f.pending_buf[f.sym_buf+re++])<<8,V=f.pending_buf[f.sym_buf+re++],$===0?z(f,V,P):(Z=b[V],z(f,Z+n+1,P),(_e=l[Z])!==0&&(V-=w[Z],R(f,V,_e)),$--,Z=k($),z(f,Z,m),(_e=c[Z])!==0&&($-=_[Z],R(f,$,_e)));while(re<f.sym_next);z(f,256,P)},fe=function(f,P){var m,$,V,Z=P.dyn_tree,_e=P.stat_desc.static_tree,re=P.stat_desc.has_stree,Le=P.stat_desc.elems,ue=-1;for(f.heap_len=0,f.heap_max=573,m=0;m<Le;m++)Z[2*m]!==0?(f.heap[++f.heap_len]=ue=m,f.depth[m]=0):Z[2*m+1]=0;for(;f.heap_len<2;)Z[2*(V=f.heap[++f.heap_len]=ue<2?++ue:0)]=1,f.depth[V]=0,f.opt_len--,re&&(f.static_len-=_e[2*V+1]);for(P.max_code=ue,m=f.heap_len>>1;m>=1;m--)Y(f,Z,m);V=Le;do m=f.heap[1],f.heap[1]=f.heap[f.heap_len--],Y(f,Z,1),$=f.heap[1],f.heap[--f.heap_max]=m,f.heap[--f.heap_max]=$,Z[2*V]=Z[2*m]+Z[2*$],f.depth[V]=(f.depth[m]>=f.depth[$]?f.depth[m]:f.depth[$])+1,Z[2*m+1]=Z[2*$+1]=V,f.heap[1]=V++,Y(f,Z,1);while(f.heap_len>=2);f.heap[--f.heap_max]=f.heap[1],function(pe,wt){var Ve,ke,je,bt,lt,Et,Be=wt.dyn_tree,Oe=wt.max_code,rt=wt.stat_desc.static_tree,Zt=wt.stat_desc.has_stree,Ke=wt.stat_desc.extra_bits,Rt=wt.stat_desc.extra_base,Dt=wt.stat_desc.max_length,nt=0;for(bt=0;bt<=o;bt++)pe.bl_count[bt]=0;for(Be[2*pe.heap[pe.heap_max]+1]=0,Ve=pe.heap_max+1;Ve<573;Ve++)(bt=Be[2*Be[2*(ke=pe.heap[Ve])+1]+1]+1)>Dt&&(bt=Dt,nt++),Be[2*ke+1]=bt,ke>Oe||(pe.bl_count[bt]++,lt=0,ke>=Rt&&(lt=Ke[ke-Rt]),Et=Be[2*ke],pe.opt_len+=Et*(bt+lt),Zt&&(pe.static_len+=Et*(rt[2*ke+1]+lt)));if(nt!==0){do{for(bt=Dt-1;pe.bl_count[bt]===0;)bt--;pe.bl_count[bt]--,pe.bl_count[bt+1]+=2,pe.bl_count[Dt]--,nt-=2}while(nt>0);for(bt=Dt;bt!==0;bt--)for(ke=pe.bl_count[bt];ke!==0;)(je=pe.heap[--Ve])>Oe||(Be[2*je+1]!==bt&&(pe.opt_len+=(bt-Be[2*je+1])*Be[2*je],Be[2*je+1]=bt),ke--)}}(f,P),O(Z,ue,f.bl_count)},K=function(f,P,m){var $,V,Z=-1,_e=P[1],re=0,Le=7,ue=4;for(_e===0&&(Le=138,ue=3),P[2*(m+1)+1]=65535,$=0;$<=m;$++)V=_e,_e=P[2*($+1)+1],++re<Le&&V===_e||(re<ue?f.bl_tree[2*V]+=re:V!==0?(V!==Z&&f.bl_tree[2*V]++,f.bl_tree[32]++):re<=10?f.bl_tree[34]++:f.bl_tree[36]++,re=0,Z=V,_e===0?(Le=138,ue=3):V===_e?(Le=6,ue=3):(Le=7,ue=4))},be=function(f,P,m){var $,V,Z=-1,_e=P[1],re=0,Le=7,ue=4;for(_e===0&&(Le=138,ue=3),$=0;$<=m;$++)if(V=_e,_e=P[2*($+1)+1],!(++re<Le&&V===_e)){if(re<ue)do z(f,V,f.bl_tree);while(--re!=0);else V!==0?(V!==Z&&(z(f,V,f.bl_tree),re--),z(f,16,f.bl_tree),R(f,re-3,2)):re<=10?(z(f,17,f.bl_tree),R(f,re-3,3)):(z(f,18,f.bl_tree),R(f,re-11,7));re=0,Z=V,_e===0?(Le=138,ue=3):V===_e?(Le=6,ue=3):(Le=7,ue=4)}},te=!1,j=function(f,P,m,$){R(f,0+($?1:0),3),S(f),D(f,m),D(f,~m),m&&f.pending_buf.set(f.window.subarray(P,P+m),f.pending),f.pending+=m},ie=function(f,P,m,$){var V,Z,_e=0;f.level>0?(f.strm.data_type===2&&(f.strm.data_type=function(re){var Le,ue=4093624447;for(Le=0;Le<=31;Le++,ue>>>=1)if(1&ue&&re.dyn_ltree[2*Le]!==0)return 0;if(re.dyn_ltree[18]!==0||re.dyn_ltree[20]!==0||re.dyn_ltree[26]!==0)return 1;for(Le=32;Le<n;Le++)if(re.dyn_ltree[2*Le]!==0)return 1;return 0}(f)),fe(f,f.l_desc),fe(f,f.d_desc),_e=function(re){var Le;for(K(re,re.dyn_ltree,re.l_desc.max_code),K(re,re.dyn_dtree,re.d_desc.max_code),fe(re,re.bl_desc),Le=18;Le>=3&&re.bl_tree[2*d[Le]+1]===0;Le--);return re.opt_len+=3*(Le+1)+5+5+4,Le}(f),V=f.opt_len+3+7>>>3,(Z=f.static_len+3+7>>>3)<=V&&(V=Z)):V=Z=m+5,m+4<=V&&P!==-1?j(f,P,m,$):f.strategy===4||Z===V?(R(f,2+($?1:0),3),W(f,p,g)):(R(f,4+($?1:0),3),function(re,Le,ue,pe){var wt;for(R(re,Le-257,5),R(re,ue-1,5),R(re,pe-4,4),wt=0;wt<pe;wt++)R(re,re.bl_tree[2*d[wt]+1],3);be(re,re.dyn_ltree,Le-1),be(re,re.dyn_dtree,ue-1)}(f,f.l_desc.max_code+1,f.d_desc.max_code+1,_e+1),W(f,f.dyn_ltree,f.dyn_dtree)),X(f),$&&S(f)},ae={_tr_init:function(f){te||(function(){var P,m,$,V,Z,_e=new Array(16);for($=0,V=0;V<28;V++)for(w[V]=$,P=0;P<1<<l[V];P++)b[$++]=V;for(b[$-1]=V,Z=0,V=0;V<16;V++)for(_[V]=Z,P=0;P<1<<c[V];P++)y[Z++]=V;for(Z>>=7;V<a;V++)for(_[V]=Z<<7,P=0;P<1<<c[V]-7;P++)y[256+Z++]=V;for(m=0;m<=o;m++)_e[m]=0;for(P=0;P<=143;)p[2*P+1]=8,P++,_e[8]++;for(;P<=255;)p[2*P+1]=9,P++,_e[9]++;for(;P<=279;)p[2*P+1]=7,P++,_e[7]++;for(;P<=287;)p[2*P+1]=8,P++,_e[8]++;for(O(p,287,_e),P=0;P<a;P++)g[2*P+1]=5,g[2*P]=G(P,5);v=new C(p,l,257,s,o),A=new C(g,c,0,a,o),E=new C(new Array(0),h,0,19,7)}(),te=!0),f.l_desc=new I(f.dyn_ltree,v),f.d_desc=new I(f.dyn_dtree,A),f.bl_desc=new I(f.bl_tree,E),f.bi_buf=0,f.bi_valid=0,X(f)},_tr_stored_block:j,_tr_flush_block:ie,_tr_tally:function(f,P,m){return f.pending_buf[f.sym_buf+f.sym_next++]=P,f.pending_buf[f.sym_buf+f.sym_next++]=P>>8,f.pending_buf[f.sym_buf+f.sym_next++]=m,P===0?f.dyn_ltree[2*m]++:(f.matches++,P--,f.dyn_ltree[2*(b[m]+n+1)]++,f.dyn_dtree[2*k(P)]++),f.sym_next===f.sym_end},_tr_align:function(f){R(f,2,3),z(f,256,p),function(P){P.bi_valid===16?(D(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):P.bi_valid>=8&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(f)}},H=function(f,P,m,$){for(var V=65535&f|0,Z=f>>>16&65535|0,_e=0;m!==0;){m-=_e=m>2e3?2e3:m;do Z=Z+(V=V+P[$++]|0)|0;while(--_e);V%=65521,Z%=65521}return V|Z<<16|0},se=new Uint32Array(function(){for(var f,P=[],m=0;m<256;m++){f=m;for(var $=0;$<8;$++)f=1&f?3988292384^f>>>1:f>>>1;P[m]=f}return P}()),le=function(f,P,m,$){var V=se,Z=$+m;f^=-1;for(var _e=$;_e<Z;_e++)f=f>>>8^V[255&(f^P[_e])];return-1^f},oe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ce={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Ae=ae._tr_init,Se=ae._tr_stored_block,Ne=ae._tr_flush_block,Te=ae._tr_tally,x=ae._tr_align,U=ce.Z_NO_FLUSH,B=ce.Z_PARTIAL_FLUSH,F=ce.Z_FULL_FLUSH,M=ce.Z_FINISH,q=ce.Z_BLOCK,de=ce.Z_OK,we=ce.Z_STREAM_END,ee=ce.Z_STREAM_ERROR,Ee=ce.Z_DATA_ERROR,De=ce.Z_BUF_ERROR,Ce=ce.Z_DEFAULT_COMPRESSION,Me=ce.Z_FILTERED,$e=ce.Z_HUFFMAN_ONLY,Xe=ce.Z_RLE,Tt=ce.Z_FIXED,nr=ce.Z_DEFAULT_STRATEGY,yr=ce.Z_UNKNOWN,rr=ce.Z_DEFLATED,ge=258,ve=262,he=42,me=113,Fe=666,Ue=function(f,P){return f.msg=oe[P],P},st=function(f){return 2*f-(f>4?9:0)},Ye=function(f){for(var P=f.length;--P>=0;)f[P]=0},ct=function(f){var P,m,$,V=f.w_size;$=P=f.hash_size;do m=f.head[--$],f.head[$]=m>=V?m-V:0;while(--P);$=P=V;do m=f.prev[--$],f.prev[$]=m>=V?m-V:0;while(--P)},pt=function(f,P,m){return(P<<f.hash_shift^m)&f.hash_mask},mt=function(f){var P=f.state,m=P.pending;m>f.avail_out&&(m=f.avail_out),m!==0&&(f.output.set(P.pending_buf.subarray(P.pending_out,P.pending_out+m),f.next_out),f.next_out+=m,P.pending_out+=m,f.total_out+=m,f.avail_out-=m,P.pending-=m,P.pending===0&&(P.pending_out=0))},Ft=function(f,P){Ne(f,f.block_start>=0?f.block_start:-1,f.strstart-f.block_start,P),f.block_start=f.strstart,mt(f.strm)},at=function(f,P){f.pending_buf[f.pending++]=P},nn=function(f,P){f.pending_buf[f.pending++]=P>>>8&255,f.pending_buf[f.pending++]=255&P},jn=function(f,P,m,$){var V=f.avail_in;return V>$&&(V=$),V===0?0:(f.avail_in-=V,P.set(f.input.subarray(f.next_in,f.next_in+V),m),f.state.wrap===1?f.adler=H(f.adler,P,V,m):f.state.wrap===2&&(f.adler=le(f.adler,P,V,m)),f.next_in+=V,f.total_in+=V,V)},Ti=function(f,P){var m,$,V=f.max_chain_length,Z=f.strstart,_e=f.prev_length,re=f.nice_match,Le=f.strstart>f.w_size-ve?f.strstart-(f.w_size-ve):0,ue=f.window,pe=f.w_mask,wt=f.prev,Ve=f.strstart+ge,ke=ue[Z+_e-1],je=ue[Z+_e];f.prev_length>=f.good_match&&(V>>=2),re>f.lookahead&&(re=f.lookahead);do if(ue[(m=P)+_e]===je&&ue[m+_e-1]===ke&&ue[m]===ue[Z]&&ue[++m]===ue[Z+1]){Z+=2,m++;do;while(ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&Z<Ve);if($=ge-(Ve-Z),Z=Ve-ge,$>_e){if(f.match_start=P,_e=$,$>=re)break;ke=ue[Z+_e-1],je=ue[Z+_e]}}while((P=wt[P&pe])>Le&&--V!=0);return _e<=f.lookahead?_e:f.lookahead},mn=function(f){var P,m,$,V=f.w_size;do{if(m=f.window_size-f.lookahead-f.strstart,f.strstart>=V+(V-ve)&&(f.window.set(f.window.subarray(V,V+V-m),0),f.match_start-=V,f.strstart-=V,f.block_start-=V,f.insert>f.strstart&&(f.insert=f.strstart),ct(f),m+=V),f.strm.avail_in===0)break;if(P=jn(f.strm,f.window,f.strstart+f.lookahead,m),f.lookahead+=P,f.lookahead+f.insert>=3)for($=f.strstart-f.insert,f.ins_h=f.window[$],f.ins_h=pt(f,f.ins_h,f.window[$+1]);f.insert&&(f.ins_h=pt(f,f.ins_h,f.window[$+3-1]),f.prev[$&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=$,$++,f.insert--,!(f.lookahead+f.insert<3)););}while(f.lookahead<ve&&f.strm.avail_in!==0)},Zi=function(f,P){var m,$,V,Z=f.pending_buf_size-5>f.w_size?f.w_size:f.pending_buf_size-5,_e=0,re=f.strm.avail_in;do{if(m=65535,V=f.bi_valid+42>>3,f.strm.avail_out<V||(V=f.strm.avail_out-V,m>($=f.strstart-f.block_start)+f.strm.avail_in&&(m=$+f.strm.avail_in),m>V&&(m=V),m<Z&&(m===0&&P!==M||P===U||m!==$+f.strm.avail_in)))break;_e=P===M&&m===$+f.strm.avail_in?1:0,Se(f,0,0,_e),f.pending_buf[f.pending-4]=m,f.pending_buf[f.pending-3]=m>>8,f.pending_buf[f.pending-2]=~m,f.pending_buf[f.pending-1]=~m>>8,mt(f.strm),$&&($>m&&($=m),f.strm.output.set(f.window.subarray(f.block_start,f.block_start+$),f.strm.next_out),f.strm.next_out+=$,f.strm.avail_out-=$,f.strm.total_out+=$,f.block_start+=$,m-=$),m&&(jn(f.strm,f.strm.output,f.strm.next_out,m),f.strm.next_out+=m,f.strm.avail_out-=m,f.strm.total_out+=m)}while(_e===0);return(re-=f.strm.avail_in)&&(re>=f.w_size?(f.matches=2,f.window.set(f.strm.input.subarray(f.strm.next_in-f.w_size,f.strm.next_in),0),f.strstart=f.w_size,f.insert=f.strstart):(f.window_size-f.strstart<=re&&(f.strstart-=f.w_size,f.window.set(f.window.subarray(f.w_size,f.w_size+f.strstart),0),f.matches<2&&f.matches++,f.insert>f.strstart&&(f.insert=f.strstart)),f.window.set(f.strm.input.subarray(f.strm.next_in-re,f.strm.next_in),f.strstart),f.strstart+=re,f.insert+=re>f.w_size-f.insert?f.w_size-f.insert:re),f.block_start=f.strstart),f.high_water<f.strstart&&(f.high_water=f.strstart),_e?4:P!==U&&P!==M&&f.strm.avail_in===0&&f.strstart===f.block_start?2:(V=f.window_size-f.strstart,f.strm.avail_in>V&&f.block_start>=f.w_size&&(f.block_start-=f.w_size,f.strstart-=f.w_size,f.window.set(f.window.subarray(f.w_size,f.w_size+f.strstart),0),f.matches<2&&f.matches++,V+=f.w_size,f.insert>f.strstart&&(f.insert=f.strstart)),V>f.strm.avail_in&&(V=f.strm.avail_in),V&&(jn(f.strm,f.window,f.strstart,V),f.strstart+=V,f.insert+=V>f.w_size-f.insert?f.w_size-f.insert:V),f.high_water<f.strstart&&(f.high_water=f.strstart),V=f.bi_valid+42>>3,Z=(V=f.pending_buf_size-V>65535?65535:f.pending_buf_size-V)>f.w_size?f.w_size:V,(($=f.strstart-f.block_start)>=Z||($||P===M)&&P!==U&&f.strm.avail_in===0&&$<=V)&&(m=$>V?V:$,_e=P===M&&f.strm.avail_in===0&&m===$?1:0,Se(f,f.block_start,m,_e),f.block_start+=m,mt(f.strm)),_e?3:1)},Un=function(f,P){for(var m,$;;){if(f.lookahead<ve){if(mn(f),f.lookahead<ve&&P===U)return 1;if(f.lookahead===0)break}if(m=0,f.lookahead>=3&&(f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),m!==0&&f.strstart-m<=f.w_size-ve&&(f.match_length=Ti(f,m)),f.match_length>=3)if($=Te(f,f.strstart-f.match_start,f.match_length-3),f.lookahead-=f.match_length,f.match_length<=f.max_lazy_match&&f.lookahead>=3){f.match_length--;do f.strstart++,f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart;while(--f.match_length!=0);f.strstart++}else f.strstart+=f.match_length,f.match_length=0,f.ins_h=f.window[f.strstart],f.ins_h=pt(f,f.ins_h,f.window[f.strstart+1]);else $=Te(f,0,f.window[f.strstart]),f.lookahead--,f.strstart++;if($&&(Ft(f,!1),f.strm.avail_out===0))return 1}return f.insert=f.strstart<2?f.strstart:2,P===M?(Ft(f,!0),f.strm.avail_out===0?3:4):f.sym_next&&(Ft(f,!1),f.strm.avail_out===0)?1:2},sn=function(f,P){for(var m,$,V;;){if(f.lookahead<ve){if(mn(f),f.lookahead<ve&&P===U)return 1;if(f.lookahead===0)break}if(m=0,f.lookahead>=3&&(f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),f.prev_length=f.match_length,f.prev_match=f.match_start,f.match_length=2,m!==0&&f.prev_length<f.max_lazy_match&&f.strstart-m<=f.w_size-ve&&(f.match_length=Ti(f,m),f.match_length<=5&&(f.strategy===Me||f.match_length===3&&f.strstart-f.match_start>4096)&&(f.match_length=2)),f.prev_length>=3&&f.match_length<=f.prev_length){V=f.strstart+f.lookahead-3,$=Te(f,f.strstart-1-f.prev_match,f.prev_length-3),f.lookahead-=f.prev_length-1,f.prev_length-=2;do++f.strstart<=V&&(f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart);while(--f.prev_length!=0);if(f.match_available=0,f.match_length=2,f.strstart++,$&&(Ft(f,!1),f.strm.avail_out===0))return 1}else if(f.match_available){if(($=Te(f,0,f.window[f.strstart-1]))&&Ft(f,!1),f.strstart++,f.lookahead--,f.strm.avail_out===0)return 1}else f.match_available=1,f.strstart++,f.lookahead--}return f.match_available&&($=Te(f,0,f.window[f.strstart-1]),f.match_available=0),f.insert=f.strstart<2?f.strstart:2,P===M?(Ft(f,!0),f.strm.avail_out===0?3:4):f.sym_next&&(Ft(f,!1),f.strm.avail_out===0)?1:2};function Wr(f,P,m,$,V){this.good_length=f,this.max_lazy=P,this.nice_length=m,this.max_chain=$,this.func=V}var ui=[new Wr(0,0,0,0,Zi),new Wr(4,4,8,4,Un),new Wr(4,5,16,8,Un),new Wr(4,6,32,32,Un),new Wr(4,4,16,16,sn),new Wr(8,16,32,32,sn),new Wr(8,16,128,128,sn),new Wr(8,32,128,256,sn),new Wr(32,128,258,1024,sn),new Wr(32,258,258,4096,sn)];function Uc(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Ye(this.dyn_ltree),Ye(this.dyn_dtree),Ye(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Ye(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ye(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Es=function(f){if(!f)return 1;var P=f.state;return!P||P.strm!==f||P.status!==he&&P.status!==57&&P.status!==69&&P.status!==73&&P.status!==91&&P.status!==103&&P.status!==me&&P.status!==Fe?1:0},Q=function(f){if(Es(f))return Ue(f,ee);f.total_in=f.total_out=0,f.data_type=yr;var P=f.state;return P.pending=0,P.pending_out=0,P.wrap<0&&(P.wrap=-P.wrap),P.status=P.wrap===2?57:P.wrap?he:me,f.adler=P.wrap===2?0:1,P.last_flush=-2,Ae(P),de},Re=function(f){var P,m=Q(f);return m===de&&((P=f.state).window_size=2*P.w_size,Ye(P.head),P.max_lazy_match=ui[P.level].max_lazy,P.good_match=ui[P.level].good_length,P.nice_match=ui[P.level].nice_length,P.max_chain_length=ui[P.level].max_chain,P.strstart=0,P.block_start=0,P.lookahead=0,P.insert=0,P.match_length=P.prev_length=2,P.match_available=0,P.ins_h=0),m},He=function(f,P,m,$,V,Z){if(!f)return ee;var _e=1;if(P===Ce&&(P=6),$<0?(_e=0,$=-$):$>15&&(_e=2,$-=16),V<1||V>9||m!==rr||$<8||$>15||P<0||P>9||Z<0||Z>Tt||$===8&&_e!==1)return Ue(f,ee);$===8&&($=9);var re=new Uc;return f.state=re,re.strm=f,re.status=he,re.wrap=_e,re.gzhead=null,re.w_bits=$,re.w_size=1<<re.w_bits,re.w_mask=re.w_size-1,re.hash_bits=V+7,re.hash_size=1<<re.hash_bits,re.hash_mask=re.hash_size-1,re.hash_shift=~~((re.hash_bits+3-1)/3),re.window=new Uint8Array(2*re.w_size),re.head=new Uint16Array(re.hash_size),re.prev=new Uint16Array(re.w_size),re.lit_bufsize=1<<V+6,re.pending_buf_size=4*re.lit_bufsize,re.pending_buf=new Uint8Array(re.pending_buf_size),re.sym_buf=re.lit_bufsize,re.sym_end=3*(re.lit_bufsize-1),re.level=P,re.strategy=Z,re.method=m,Re(f)},Je={deflateInit:function(f,P){return He(f,P,rr,15,8,nr)},deflateInit2:He,deflateReset:Re,deflateResetKeep:Q,deflateSetHeader:function(f,P){return Es(f)||f.state.wrap!==2?ee:(f.state.gzhead=P,de)},deflate:function(f,P){if(Es(f)||P>q||P<0)return f?Ue(f,ee):ee;var m=f.state;if(!f.output||f.avail_in!==0&&!f.input||m.status===Fe&&P!==M)return Ue(f,f.avail_out===0?De:ee);var $=m.last_flush;if(m.last_flush=P,m.pending!==0){if(mt(f),f.avail_out===0)return m.last_flush=-1,de}else if(f.avail_in===0&&st(P)<=st($)&&P!==M)return Ue(f,De);if(m.status===Fe&&f.avail_in!==0)return Ue(f,De);if(m.status===he&&m.wrap===0&&(m.status=me),m.status===he){var V=rr+(m.w_bits-8<<4)<<8;if(V|=(m.strategy>=$e||m.level<2?0:m.level<6?1:m.level===6?2:3)<<6,m.strstart!==0&&(V|=32),nn(m,V+=31-V%31),m.strstart!==0&&(nn(m,f.adler>>>16),nn(m,65535&f.adler)),f.adler=1,m.status=me,mt(f),m.pending!==0)return m.last_flush=-1,de}if(m.status===57){if(f.adler=0,at(m,31),at(m,139),at(m,8),m.gzhead)at(m,(m.gzhead.text?1:0)+(m.gzhead.hcrc?2:0)+(m.gzhead.extra?4:0)+(m.gzhead.name?8:0)+(m.gzhead.comment?16:0)),at(m,255&m.gzhead.time),at(m,m.gzhead.time>>8&255),at(m,m.gzhead.time>>16&255),at(m,m.gzhead.time>>24&255),at(m,m.level===9?2:m.strategy>=$e||m.level<2?4:0),at(m,255&m.gzhead.os),m.gzhead.extra&&m.gzhead.extra.length&&(at(m,255&m.gzhead.extra.length),at(m,m.gzhead.extra.length>>8&255)),m.gzhead.hcrc&&(f.adler=le(f.adler,m.pending_buf,m.pending,0)),m.gzindex=0,m.status=69;else if(at(m,0),at(m,0),at(m,0),at(m,0),at(m,0),at(m,m.level===9?2:m.strategy>=$e||m.level<2?4:0),at(m,3),m.status=me,mt(f),m.pending!==0)return m.last_flush=-1,de}if(m.status===69){if(m.gzhead.extra){for(var Z=m.pending,_e=(65535&m.gzhead.extra.length)-m.gzindex;m.pending+_e>m.pending_buf_size;){var re=m.pending_buf_size-m.pending;if(m.pending_buf.set(m.gzhead.extra.subarray(m.gzindex,m.gzindex+re),m.pending),m.pending=m.pending_buf_size,m.gzhead.hcrc&&m.pending>Z&&(f.adler=le(f.adler,m.pending_buf,m.pending-Z,Z)),m.gzindex+=re,mt(f),m.pending!==0)return m.last_flush=-1,de;Z=0,_e-=re}var Le=new Uint8Array(m.gzhead.extra);m.pending_buf.set(Le.subarray(m.gzindex,m.gzindex+_e),m.pending),m.pending+=_e,m.gzhead.hcrc&&m.pending>Z&&(f.adler=le(f.adler,m.pending_buf,m.pending-Z,Z)),m.gzindex=0}m.status=73}if(m.status===73){if(m.gzhead.name){var ue,pe=m.pending;do{if(m.pending===m.pending_buf_size){if(m.gzhead.hcrc&&m.pending>pe&&(f.adler=le(f.adler,m.pending_buf,m.pending-pe,pe)),mt(f),m.pending!==0)return m.last_flush=-1,de;pe=0}ue=m.gzindex<m.gzhead.name.length?255&m.gzhead.name.charCodeAt(m.gzindex++):0,at(m,ue)}while(ue!==0);m.gzhead.hcrc&&m.pending>pe&&(f.adler=le(f.adler,m.pending_buf,m.pending-pe,pe)),m.gzindex=0}m.status=91}if(m.status===91){if(m.gzhead.comment){var wt,Ve=m.pending;do{if(m.pending===m.pending_buf_size){if(m.gzhead.hcrc&&m.pending>Ve&&(f.adler=le(f.adler,m.pending_buf,m.pending-Ve,Ve)),mt(f),m.pending!==0)return m.last_flush=-1,de;Ve=0}wt=m.gzindex<m.gzhead.comment.length?255&m.gzhead.comment.charCodeAt(m.gzindex++):0,at(m,wt)}while(wt!==0);m.gzhead.hcrc&&m.pending>Ve&&(f.adler=le(f.adler,m.pending_buf,m.pending-Ve,Ve))}m.status=103}if(m.status===103){if(m.gzhead.hcrc){if(m.pending+2>m.pending_buf_size&&(mt(f),m.pending!==0))return m.last_flush=-1,de;at(m,255&f.adler),at(m,f.adler>>8&255),f.adler=0}if(m.status=me,mt(f),m.pending!==0)return m.last_flush=-1,de}if(f.avail_in!==0||m.lookahead!==0||P!==U&&m.status!==Fe){var ke=m.level===0?Zi(m,P):m.strategy===$e?function(je,bt){for(var lt;;){if(je.lookahead===0&&(mn(je),je.lookahead===0)){if(bt===U)return 1;break}if(je.match_length=0,lt=Te(je,0,je.window[je.strstart]),je.lookahead--,je.strstart++,lt&&(Ft(je,!1),je.strm.avail_out===0))return 1}return je.insert=0,bt===M?(Ft(je,!0),je.strm.avail_out===0?3:4):je.sym_next&&(Ft(je,!1),je.strm.avail_out===0)?1:2}(m,P):m.strategy===Xe?function(je,bt){for(var lt,Et,Be,Oe,rt=je.window;;){if(je.lookahead<=ge){if(mn(je),je.lookahead<=ge&&bt===U)return 1;if(je.lookahead===0)break}if(je.match_length=0,je.lookahead>=3&&je.strstart>0&&(Et=rt[Be=je.strstart-1])===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]){Oe=je.strstart+ge;do;while(Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Be<Oe);je.match_length=ge-(Oe-Be),je.match_length>je.lookahead&&(je.match_length=je.lookahead)}if(je.match_length>=3?(lt=Te(je,1,je.match_length-3),je.lookahead-=je.match_length,je.strstart+=je.match_length,je.match_length=0):(lt=Te(je,0,je.window[je.strstart]),je.lookahead--,je.strstart++),lt&&(Ft(je,!1),je.strm.avail_out===0))return 1}return je.insert=0,bt===M?(Ft(je,!0),je.strm.avail_out===0?3:4):je.sym_next&&(Ft(je,!1),je.strm.avail_out===0)?1:2}(m,P):ui[m.level].func(m,P);if(ke!==3&&ke!==4||(m.status=Fe),ke===1||ke===3)return f.avail_out===0&&(m.last_flush=-1),de;if(ke===2&&(P===B?x(m):P!==q&&(Se(m,0,0,!1),P===F&&(Ye(m.head),m.lookahead===0&&(m.strstart=0,m.block_start=0,m.insert=0))),mt(f),f.avail_out===0))return m.last_flush=-1,de}return P!==M?de:m.wrap<=0?we:(m.wrap===2?(at(m,255&f.adler),at(m,f.adler>>8&255),at(m,f.adler>>16&255),at(m,f.adler>>24&255),at(m,255&f.total_in),at(m,f.total_in>>8&255),at(m,f.total_in>>16&255),at(m,f.total_in>>24&255)):(nn(m,f.adler>>>16),nn(m,65535&f.adler)),mt(f),m.wrap>0&&(m.wrap=-m.wrap),m.pending!==0?de:we)},deflateEnd:function(f){if(Es(f))return ee;var P=f.state.status;return f.state=null,P===me?Ue(f,Ee):de},deflateSetDictionary:function(f,P){var m=P.length;if(Es(f))return ee;var $=f.state,V=$.wrap;if(V===2||V===1&&$.status!==he||$.lookahead)return ee;if(V===1&&(f.adler=H(f.adler,P,m,0)),$.wrap=0,m>=$.w_size){V===0&&(Ye($.head),$.strstart=0,$.block_start=0,$.insert=0);var Z=new Uint8Array($.w_size);Z.set(P.subarray(m-$.w_size,m),0),P=Z,m=$.w_size}var _e=f.avail_in,re=f.next_in,Le=f.input;for(f.avail_in=m,f.next_in=0,f.input=P,mn($);$.lookahead>=3;){var ue=$.strstart,pe=$.lookahead-2;do $.ins_h=pt($,$.ins_h,$.window[ue+3-1]),$.prev[ue&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=ue,ue++;while(--pe);$.strstart=ue,$.lookahead=2,mn($)}return $.strstart+=$.lookahead,$.block_start=$.strstart,$.insert=$.lookahead,$.lookahead=0,$.match_length=$.prev_length=2,$.match_available=0,f.next_in=re,f.input=Le,f.avail_in=_e,$.wrap=V,de},deflateInfo:"pako deflate (from Nodeca project)"};function Pt(f){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Pt(f)}var jt=function(f,P){return Object.prototype.hasOwnProperty.call(f,P)},At=function(f){for(var P=Array.prototype.slice.call(arguments,1);P.length;){var m=P.shift();if(m){if(Pt(m)!=="object")throw new TypeError(m+"must be non-object");for(var $ in m)jt(m,$)&&(f[$]=m[$])}}return f},yt=function(f){for(var P=0,m=0,$=f.length;m<$;m++)P+=f[m].length;for(var V=new Uint8Array(P),Z=0,_e=0,re=f.length;Z<re;Z++){var Le=f[Z];V.set(Le,_e),_e+=Le.length}return V},Br=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Br=!1}for(var Yt=new Uint8Array(256),Ut=0;Ut<256;Ut++)Yt[Ut]=Ut>=252?6:Ut>=248?5:Ut>=240?4:Ut>=224?3:Ut>=192?2:1;Yt[254]=Yt[254]=1;var an=function(f){if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(f);var P,m,$,V,Z,_e=f.length,re=0;for(V=0;V<_e;V++)(64512&(m=f.charCodeAt(V)))==55296&&V+1<_e&&(64512&($=f.charCodeAt(V+1)))==56320&&(m=65536+(m-55296<<10)+($-56320),V++),re+=m<128?1:m<2048?2:m<65536?3:4;for(P=new Uint8Array(re),Z=0,V=0;Z<re;V++)(64512&(m=f.charCodeAt(V)))==55296&&V+1<_e&&(64512&($=f.charCodeAt(V+1)))==56320&&(m=65536+(m-55296<<10)+($-56320),V++),m<128?P[Z++]=m:m<2048?(P[Z++]=192|m>>>6,P[Z++]=128|63&m):m<65536?(P[Z++]=224|m>>>12,P[Z++]=128|m>>>6&63,P[Z++]=128|63&m):(P[Z++]=240|m>>>18,P[Z++]=128|m>>>12&63,P[Z++]=128|m>>>6&63,P[Z++]=128|63&m);return P},pa=function(f,P){var m,$,V=P||f.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(f.subarray(0,P));var Z=new Array(2*V);for($=0,m=0;m<V;){var _e=f[m++];if(_e<128)Z[$++]=_e;else{var re=Yt[_e];if(re>4)Z[$++]=65533,m+=re-1;else{for(_e&=re===2?31:re===3?15:7;re>1&&m<V;)_e=_e<<6|63&f[m++],re--;re>1?Z[$++]=65533:_e<65536?Z[$++]=_e:(_e-=65536,Z[$++]=55296|_e>>10&1023,Z[$++]=56320|1023&_e)}}}return function(Le,ue){if(ue<65534&&Le.subarray&&Br)return String.fromCharCode.apply(null,Le.length===ue?Le:Le.subarray(0,ue));for(var pe="",wt=0;wt<ue;wt++)pe+=String.fromCharCode(Le[wt]);return pe}(Z,$)},_s=function(f,P){(P=P||f.length)>f.length&&(P=f.length);for(var m=P-1;m>=0&&(192&f[m])==128;)m--;return m<0||m===0?P:m+Yt[f[m]]>P?m:P},Xr=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Jl=Object.prototype.toString,Kg=ce.Z_NO_FLUSH,Qg=ce.Z_SYNC_FLUSH,rE=ce.Z_FULL_FLUSH,nE=ce.Z_FINISH,Hf=ce.Z_OK,iE=ce.Z_STREAM_END,sE=ce.Z_DEFAULT_COMPRESSION,aE=ce.Z_DEFAULT_STRATEGY,oE=ce.Z_DEFLATED;function Hc(f){this.options=At({level:sE,method:oE,chunkSize:16384,windowBits:15,memLevel:8,strategy:aE},f||{});var P=this.options;P.raw&&P.windowBits>0?P.windowBits=-P.windowBits:P.gzip&&P.windowBits>0&&P.windowBits<16&&(P.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xr,this.strm.avail_out=0;var m=Je.deflateInit2(this.strm,P.level,P.method,P.windowBits,P.memLevel,P.strategy);if(m!==Hf)throw new Error(oe[m]);if(P.header&&Je.deflateSetHeader(this.strm,P.header),P.dictionary){var $;if($=typeof P.dictionary=="string"?an(P.dictionary):Jl.call(P.dictionary)==="[object ArrayBuffer]"?new Uint8Array(P.dictionary):P.dictionary,(m=Je.deflateSetDictionary(this.strm,$))!==Hf)throw new Error(oe[m]);this._dict_set=!0}}function Jg(f,P){var m=new Hc(P);if(m.push(f,!0),m.err)throw m.msg||oe[m.err];return m.result}Hc.prototype.push=function(f,P){var m,$,V=this.strm,Z=this.options.chunkSize;if(this.ended)return!1;for($=P===~~P?P:P===!0?nE:Kg,typeof f=="string"?V.input=an(f):Jl.call(f)==="[object ArrayBuffer]"?V.input=new Uint8Array(f):V.input=f,V.next_in=0,V.avail_in=V.input.length;;)if(V.avail_out===0&&(V.output=new Uint8Array(Z),V.next_out=0,V.avail_out=Z),($===Qg||$===rE)&&V.avail_out<=6)this.onData(V.output.subarray(0,V.next_out)),V.avail_out=0;else{if((m=Je.deflate(V,$))===iE)return V.next_out>0&&this.onData(V.output.subarray(0,V.next_out)),m=Je.deflateEnd(this.strm),this.onEnd(m),this.ended=!0,m===Hf;if(V.avail_out!==0){if($>0&&V.next_out>0)this.onData(V.output.subarray(0,V.next_out)),V.avail_out=0;else if(V.avail_in===0)break}else this.onData(V.output)}return!0},Hc.prototype.onData=function(f){this.chunks.push(f)},Hc.prototype.onEnd=function(f){f===Hf&&(this.result=yt(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg};var $f={Deflate:Hc,deflate:Jg,deflateRaw:function(f,P){return(P=P||{}).raw=!0,Jg(f,P)},gzip:function(f,P){return(P=P||{}).gzip=!0,Jg(f,P)}},Vf=16209,lE=function(f,P){var m,$,V,Z,_e,re,Le,ue,pe,wt,Ve,ke,je,bt,lt,Et,Be,Oe,rt,Zt,Ke,Rt,Dt,nt,ht=f.state;m=f.next_in,Dt=f.input,$=m+(f.avail_in-5),V=f.next_out,nt=f.output,Z=V-(P-f.avail_out),_e=V+(f.avail_out-257),re=ht.dmax,Le=ht.wsize,ue=ht.whave,pe=ht.wnext,wt=ht.window,Ve=ht.hold,ke=ht.bits,je=ht.lencode,bt=ht.distcode,lt=(1<<ht.lenbits)-1,Et=(1<<ht.distbits)-1;e:do{ke<15&&(Ve+=Dt[m++]<<ke,ke+=8,Ve+=Dt[m++]<<ke,ke+=8),Be=je[Ve&lt];t:for(;;){if(Ve>>>=Oe=Be>>>24,ke-=Oe,(Oe=Be>>>16&255)===0)nt[V++]=65535&Be;else{if(!(16&Oe)){if(!(64&Oe)){Be=je[(65535&Be)+(Ve&(1<<Oe)-1)];continue t}if(32&Oe){ht.mode=16191;break e}f.msg="invalid literal/length code",ht.mode=Vf;break e}rt=65535&Be,(Oe&=15)&&(ke<Oe&&(Ve+=Dt[m++]<<ke,ke+=8),rt+=Ve&(1<<Oe)-1,Ve>>>=Oe,ke-=Oe),ke<15&&(Ve+=Dt[m++]<<ke,ke+=8,Ve+=Dt[m++]<<ke,ke+=8),Be=bt[Ve&Et];r:for(;;){if(Ve>>>=Oe=Be>>>24,ke-=Oe,!(16&(Oe=Be>>>16&255))){if(!(64&Oe)){Be=bt[(65535&Be)+(Ve&(1<<Oe)-1)];continue r}f.msg="invalid distance code",ht.mode=Vf;break e}if(Zt=65535&Be,ke<(Oe&=15)&&(Ve+=Dt[m++]<<ke,(ke+=8)<Oe&&(Ve+=Dt[m++]<<ke,ke+=8)),(Zt+=Ve&(1<<Oe)-1)>re){f.msg="invalid distance too far back",ht.mode=Vf;break e}if(Ve>>>=Oe,ke-=Oe,Zt>(Oe=V-Z)){if((Oe=Zt-Oe)>ue&&ht.sane){f.msg="invalid distance too far back",ht.mode=Vf;break e}if(Ke=0,Rt=wt,pe===0){if(Ke+=Le-Oe,Oe<rt){rt-=Oe;do nt[V++]=wt[Ke++];while(--Oe);Ke=V-Zt,Rt=nt}}else if(pe<Oe){if(Ke+=Le+pe-Oe,(Oe-=pe)<rt){rt-=Oe;do nt[V++]=wt[Ke++];while(--Oe);if(Ke=0,pe<rt){rt-=Oe=pe;do nt[V++]=wt[Ke++];while(--Oe);Ke=V-Zt,Rt=nt}}}else if(Ke+=pe-Oe,Oe<rt){rt-=Oe;do nt[V++]=wt[Ke++];while(--Oe);Ke=V-Zt,Rt=nt}for(;rt>2;)nt[V++]=Rt[Ke++],nt[V++]=Rt[Ke++],nt[V++]=Rt[Ke++],rt-=3;rt&&(nt[V++]=Rt[Ke++],rt>1&&(nt[V++]=Rt[Ke++]))}else{Ke=V-Zt;do nt[V++]=nt[Ke++],nt[V++]=nt[Ke++],nt[V++]=nt[Ke++],rt-=3;while(rt>2);rt&&(nt[V++]=nt[Ke++],rt>1&&(nt[V++]=nt[Ke++]))}break}}break}}while(m<$&&V<_e);m-=rt=ke>>3,Ve&=(1<<(ke-=rt<<3))-1,f.next_in=m,f.next_out=V,f.avail_in=m<$?$-m+5:5-(m-$),f.avail_out=V<_e?_e-V+257:257-(V-_e),ht.hold=Ve,ht.bits=ke},Gf=15,uE=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),cE=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),hE=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dE=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),$c=function(f,P,m,$,V,Z,_e,re){var Le,ue,pe,wt,Ve,ke,je,bt,lt,Et=re.bits,Be=0,Oe=0,rt=0,Zt=0,Ke=0,Rt=0,Dt=0,nt=0,ht=0,Vt=0,wo=null,ga=new Uint16Array(16),Qf=new Uint16Array(16),Jf=null;for(Be=0;Be<=Gf;Be++)ga[Be]=0;for(Oe=0;Oe<$;Oe++)ga[P[m+Oe]]++;for(Ke=Et,Zt=Gf;Zt>=1&&ga[Zt]===0;Zt--);if(Ke>Zt&&(Ke=Zt),Zt===0)return V[Z++]=20971520,V[Z++]=20971520,re.bits=1,0;for(rt=1;rt<Zt&&ga[rt]===0;rt++);for(Ke<rt&&(Ke=rt),nt=1,Be=1;Be<=Gf;Be++)if(nt<<=1,(nt-=ga[Be])<0)return-1;if(nt>0&&(f===0||Zt!==1))return-1;for(Qf[1]=0,Be=1;Be<Gf;Be++)Qf[Be+1]=Qf[Be]+ga[Be];for(Oe=0;Oe<$;Oe++)P[m+Oe]!==0&&(_e[Qf[P[m+Oe]]++]=Oe);if(f===0?(wo=Jf=_e,ke=20):f===1?(wo=uE,Jf=cE,ke=257):(wo=hE,Jf=dE,ke=0),Vt=0,Oe=0,Be=rt,Ve=Z,Rt=Ke,Dt=0,pe=-1,wt=(ht=1<<Ke)-1,f===1&&ht>852||f===2&&ht>592)return 1;for(;;){je=Be-Dt,_e[Oe]+1<ke?(bt=0,lt=_e[Oe]):_e[Oe]>=ke?(bt=Jf[_e[Oe]-ke],lt=wo[_e[Oe]-ke]):(bt=96,lt=0),Le=1<<Be-Dt,rt=ue=1<<Rt;do V[Ve+(Vt>>Dt)+(ue-=Le)]=je<<24|bt<<16|lt|0;while(ue!==0);for(Le=1<<Be-1;Vt&Le;)Le>>=1;if(Le!==0?(Vt&=Le-1,Vt+=Le):Vt=0,Oe++,--ga[Be]==0){if(Be===Zt)break;Be=P[m+_e[Oe]]}if(Be>Ke&&(Vt&wt)!==pe){for(Dt===0&&(Dt=Ke),Ve+=rt,nt=1<<(Rt=Be-Dt);Rt+Dt<Zt&&!((nt-=ga[Rt+Dt])<=0);)Rt++,nt<<=1;if(ht+=1<<Rt,f===1&&ht>852||f===2&&ht>592)return 1;V[pe=Vt&wt]=Ke<<24|Rt<<16|Ve-Z|0}}return Vt!==0&&(V[Ve+Vt]=Be-Dt<<24|64<<16|0),re.bits=Ke,0},wv=ce.Z_FINISH,fE=ce.Z_BLOCK,qf=ce.Z_TREES,vo=ce.Z_OK,pE=ce.Z_STREAM_END,gE=ce.Z_NEED_DICT,ki=ce.Z_STREAM_ERROR,xv=ce.Z_DATA_ERROR,Av=ce.Z_MEM_ERROR,mE=ce.Z_BUF_ERROR,Ev=ce.Z_DEFLATED,Wf=16180,Xf=16190,Cs=16191,em=16192,tm=16194,Yf=16199,Zf=16200,rm=16206,ir=16209,_v=function(f){return(f>>>24&255)+(f>>>8&65280)+((65280&f)<<8)+((255&f)<<24)};function bE(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var nm,im,yo=function(f){if(!f)return 1;var P=f.state;return!P||P.strm!==f||P.mode<Wf||P.mode>16211?1:0},Cv=function(f){if(yo(f))return ki;var P=f.state;return f.total_in=f.total_out=P.total=0,f.msg="",P.wrap&&(f.adler=1&P.wrap),P.mode=Wf,P.last=0,P.havedict=0,P.flags=-1,P.dmax=32768,P.head=null,P.hold=0,P.bits=0,P.lencode=P.lendyn=new Int32Array(852),P.distcode=P.distdyn=new Int32Array(592),P.sane=1,P.back=-1,vo},Sv=function(f){if(yo(f))return ki;var P=f.state;return P.wsize=0,P.whave=0,P.wnext=0,Cv(f)},Tv=function(f,P){var m;if(yo(f))return ki;var $=f.state;return P<0?(m=0,P=-P):(m=5+(P>>4),P<48&&(P&=15)),P&&(P<8||P>15)?ki:($.window!==null&&$.wbits!==P&&($.window=null),$.wrap=m,$.wbits=P,Sv(f))},kv=function(f,P){if(!f)return ki;var m=new bE;f.state=m,m.strm=f,m.window=null,m.mode=Wf;var $=Tv(f,P);return $!==vo&&(f.state=null),$},Dv=!0,vE=function(f){if(Dv){nm=new Int32Array(512),im=new Int32Array(32);for(var P=0;P<144;)f.lens[P++]=8;for(;P<256;)f.lens[P++]=9;for(;P<280;)f.lens[P++]=7;for(;P<288;)f.lens[P++]=8;for($c(1,f.lens,0,288,nm,0,f.work,{bits:9}),P=0;P<32;)f.lens[P++]=5;$c(2,f.lens,0,32,im,0,f.work,{bits:5}),Dv=!1}f.lencode=nm,f.lenbits=9,f.distcode=im,f.distbits=5},Pv=function(f,P,m,$){var V,Z=f.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new Uint8Array(Z.wsize)),$>=Z.wsize?(Z.window.set(P.subarray(m-Z.wsize,m),0),Z.wnext=0,Z.whave=Z.wsize):((V=Z.wsize-Z.wnext)>$&&(V=$),Z.window.set(P.subarray(m-$,m-$+V),Z.wnext),($-=V)?(Z.window.set(P.subarray(m-$,m),0),Z.wnext=$,Z.whave=Z.wsize):(Z.wnext+=V,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=V))),0},Ss={inflateReset:Sv,inflateReset2:Tv,inflateResetKeep:Cv,inflateInit:function(f){return kv(f,15)},inflateInit2:kv,inflate:function(f,P){var m,$,V,Z,_e,re,Le,ue,pe,wt,Ve,ke,je,bt,lt,Et,Be,Oe,rt,Zt,Ke,Rt,Dt,nt,ht=0,Vt=new Uint8Array(4),wo=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(yo(f)||!f.output||!f.input&&f.avail_in!==0)return ki;(m=f.state).mode===Cs&&(m.mode=em),_e=f.next_out,V=f.output,Le=f.avail_out,Z=f.next_in,$=f.input,re=f.avail_in,ue=m.hold,pe=m.bits,wt=re,Ve=Le,Rt=vo;e:for(;;)switch(m.mode){case Wf:if(m.wrap===0){m.mode=em;break}for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(2&m.wrap&&ue===35615){m.wbits===0&&(m.wbits=15),m.check=0,Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0),ue=0,pe=0,m.mode=16181;break}if(m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&ue)<<8)+(ue>>8))%31){f.msg="incorrect header check",m.mode=ir;break}if((15&ue)!==Ev){f.msg="unknown compression method",m.mode=ir;break}if(pe-=4,Ke=8+(15&(ue>>>=4)),m.wbits===0&&(m.wbits=Ke),Ke>15||Ke>m.wbits){f.msg="invalid window size",m.mode=ir;break}m.dmax=1<<m.wbits,m.flags=0,f.adler=m.check=1,m.mode=512&ue?16189:Cs,ue=0,pe=0;break;case 16181:for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(m.flags=ue,(255&m.flags)!==Ev){f.msg="unknown compression method",m.mode=ir;break}if(57344&m.flags){f.msg="unknown header flags set",m.mode=ir;break}m.head&&(m.head.text=ue>>8&1),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0)),ue=0,pe=0,m.mode=16182;case 16182:for(;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.head&&(m.head.time=ue),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,Vt[2]=ue>>>16&255,Vt[3]=ue>>>24&255,m.check=le(m.check,Vt,4,0)),ue=0,pe=0,m.mode=16183;case 16183:for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.head&&(m.head.xflags=255&ue,m.head.os=ue>>8),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0)),ue=0,pe=0,m.mode=16184;case 16184:if(1024&m.flags){for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.length=ue,m.head&&(m.head.extra_len=ue),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0)),ue=0,pe=0}else m.head&&(m.head.extra=null);m.mode=16185;case 16185:if(1024&m.flags&&((ke=m.length)>re&&(ke=re),ke&&(m.head&&(Ke=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Uint8Array(m.head.extra_len)),m.head.extra.set($.subarray(Z,Z+ke),Ke)),512&m.flags&&4&m.wrap&&(m.check=le(m.check,$,ke,Z)),re-=ke,Z+=ke,m.length-=ke),m.length))break e;m.length=0,m.mode=16186;case 16186:if(2048&m.flags){if(re===0)break e;ke=0;do Ke=$[Z+ke++],m.head&&Ke&&m.length<65536&&(m.head.name+=String.fromCharCode(Ke));while(Ke&&ke<re);if(512&m.flags&&4&m.wrap&&(m.check=le(m.check,$,ke,Z)),re-=ke,Z+=ke,Ke)break e}else m.head&&(m.head.name=null);m.length=0,m.mode=16187;case 16187:if(4096&m.flags){if(re===0)break e;ke=0;do Ke=$[Z+ke++],m.head&&Ke&&m.length<65536&&(m.head.comment+=String.fromCharCode(Ke));while(Ke&&ke<re);if(512&m.flags&&4&m.wrap&&(m.check=le(m.check,$,ke,Z)),re-=ke,Z+=ke,Ke)break e}else m.head&&(m.head.comment=null);m.mode=16188;case 16188:if(512&m.flags){for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(4&m.wrap&&ue!==(65535&m.check)){f.msg="header crc mismatch",m.mode=ir;break}ue=0,pe=0}m.head&&(m.head.hcrc=m.flags>>9&1,m.head.done=!0),f.adler=m.check=0,m.mode=Cs;break;case 16189:for(;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}f.adler=m.check=_v(ue),ue=0,pe=0,m.mode=Xf;case Xf:if(m.havedict===0)return f.next_out=_e,f.avail_out=Le,f.next_in=Z,f.avail_in=re,m.hold=ue,m.bits=pe,gE;f.adler=m.check=1,m.mode=Cs;case Cs:if(P===fE||P===qf)break e;case em:if(m.last){ue>>>=7&pe,pe-=7&pe,m.mode=rm;break}for(;pe<3;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}switch(m.last=1&ue,pe-=1,3&(ue>>>=1)){case 0:m.mode=16193;break;case 1:if(vE(m),m.mode=Yf,P===qf){ue>>>=2,pe-=2;break e}break;case 2:m.mode=16196;break;case 3:f.msg="invalid block type",m.mode=ir}ue>>>=2,pe-=2;break;case 16193:for(ue>>>=7&pe,pe-=7&pe;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if((65535&ue)!=(ue>>>16^65535)){f.msg="invalid stored block lengths",m.mode=ir;break}if(m.length=65535&ue,ue=0,pe=0,m.mode=tm,P===qf)break e;case tm:m.mode=16195;case 16195:if(ke=m.length){if(ke>re&&(ke=re),ke>Le&&(ke=Le),ke===0)break e;V.set($.subarray(Z,Z+ke),_e),re-=ke,Z+=ke,Le-=ke,_e+=ke,m.length-=ke;break}m.mode=Cs;break;case 16196:for(;pe<14;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(m.nlen=257+(31&ue),ue>>>=5,pe-=5,m.ndist=1+(31&ue),ue>>>=5,pe-=5,m.ncode=4+(15&ue),ue>>>=4,pe-=4,m.nlen>286||m.ndist>30){f.msg="too many length or distance symbols",m.mode=ir;break}m.have=0,m.mode=16197;case 16197:for(;m.have<m.ncode;){for(;pe<3;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.lens[wo[m.have++]]=7&ue,ue>>>=3,pe-=3}for(;m.have<19;)m.lens[wo[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,Dt={bits:m.lenbits},Rt=$c(0,m.lens,0,19,m.lencode,0,m.work,Dt),m.lenbits=Dt.bits,Rt){f.msg="invalid code lengths set",m.mode=ir;break}m.have=0,m.mode=16198;case 16198:for(;m.have<m.nlen+m.ndist;){for(;Et=(ht=m.lencode[ue&(1<<m.lenbits)-1])>>>16&255,Be=65535&ht,!((lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(Be<16)ue>>>=lt,pe-=lt,m.lens[m.have++]=Be;else{if(Be===16){for(nt=lt+2;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(ue>>>=lt,pe-=lt,m.have===0){f.msg="invalid bit length repeat",m.mode=ir;break}Ke=m.lens[m.have-1],ke=3+(3&ue),ue>>>=2,pe-=2}else if(Be===17){for(nt=lt+3;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}pe-=lt,Ke=0,ke=3+(7&(ue>>>=lt)),ue>>>=3,pe-=3}else{for(nt=lt+7;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}pe-=lt,Ke=0,ke=11+(127&(ue>>>=lt)),ue>>>=7,pe-=7}if(m.have+ke>m.nlen+m.ndist){f.msg="invalid bit length repeat",m.mode=ir;break}for(;ke--;)m.lens[m.have++]=Ke}}if(m.mode===ir)break;if(m.lens[256]===0){f.msg="invalid code -- missing end-of-block",m.mode=ir;break}if(m.lenbits=9,Dt={bits:m.lenbits},Rt=$c(1,m.lens,0,m.nlen,m.lencode,0,m.work,Dt),m.lenbits=Dt.bits,Rt){f.msg="invalid literal/lengths set",m.mode=ir;break}if(m.distbits=6,m.distcode=m.distdyn,Dt={bits:m.distbits},Rt=$c(2,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,Dt),m.distbits=Dt.bits,Rt){f.msg="invalid distances set",m.mode=ir;break}if(m.mode=Yf,P===qf)break e;case Yf:m.mode=Zf;case Zf:if(re>=6&&Le>=258){f.next_out=_e,f.avail_out=Le,f.next_in=Z,f.avail_in=re,m.hold=ue,m.bits=pe,lE(f,Ve),_e=f.next_out,V=f.output,Le=f.avail_out,Z=f.next_in,$=f.input,re=f.avail_in,ue=m.hold,pe=m.bits,m.mode===Cs&&(m.back=-1);break}for(m.back=0;Et=(ht=m.lencode[ue&(1<<m.lenbits)-1])>>>16&255,Be=65535&ht,!((lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(Et&&!(240&Et)){for(Oe=lt,rt=Et,Zt=Be;Et=(ht=m.lencode[Zt+((ue&(1<<Oe+rt)-1)>>Oe)])>>>16&255,Be=65535&ht,!(Oe+(lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}ue>>>=Oe,pe-=Oe,m.back+=Oe}if(ue>>>=lt,pe-=lt,m.back+=lt,m.length=Be,Et===0){m.mode=16205;break}if(32&Et){m.back=-1,m.mode=Cs;break}if(64&Et){f.msg="invalid literal/length code",m.mode=ir;break}m.extra=15&Et,m.mode=16201;case 16201:if(m.extra){for(nt=m.extra;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.length+=ue&(1<<m.extra)-1,ue>>>=m.extra,pe-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=16202;case 16202:for(;Et=(ht=m.distcode[ue&(1<<m.distbits)-1])>>>16&255,Be=65535&ht,!((lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(!(240&Et)){for(Oe=lt,rt=Et,Zt=Be;Et=(ht=m.distcode[Zt+((ue&(1<<Oe+rt)-1)>>Oe)])>>>16&255,Be=65535&ht,!(Oe+(lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}ue>>>=Oe,pe-=Oe,m.back+=Oe}if(ue>>>=lt,pe-=lt,m.back+=lt,64&Et){f.msg="invalid distance code",m.mode=ir;break}m.offset=Be,m.extra=15&Et,m.mode=16203;case 16203:if(m.extra){for(nt=m.extra;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.offset+=ue&(1<<m.extra)-1,ue>>>=m.extra,pe-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){f.msg="invalid distance too far back",m.mode=ir;break}m.mode=16204;case 16204:if(Le===0)break e;if(ke=Ve-Le,m.offset>ke){if((ke=m.offset-ke)>m.whave&&m.sane){f.msg="invalid distance too far back",m.mode=ir;break}ke>m.wnext?(ke-=m.wnext,je=m.wsize-ke):je=m.wnext-ke,ke>m.length&&(ke=m.length),bt=m.window}else bt=V,je=_e-m.offset,ke=m.length;ke>Le&&(ke=Le),Le-=ke,m.length-=ke;do V[_e++]=bt[je++];while(--ke);m.length===0&&(m.mode=Zf);break;case 16205:if(Le===0)break e;V[_e++]=m.length,Le--,m.mode=Zf;break;case rm:if(m.wrap){for(;pe<32;){if(re===0)break e;re--,ue|=$[Z++]<<pe,pe+=8}if(Ve-=Le,f.total_out+=Ve,m.total+=Ve,4&m.wrap&&Ve&&(f.adler=m.check=m.flags?le(m.check,V,Ve,_e-Ve):H(m.check,V,Ve,_e-Ve)),Ve=Le,4&m.wrap&&(m.flags?ue:_v(ue))!==m.check){f.msg="incorrect data check",m.mode=ir;break}ue=0,pe=0}m.mode=16207;case 16207:if(m.wrap&&m.flags){for(;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(4&m.wrap&&ue!==(4294967295&m.total)){f.msg="incorrect length check",m.mode=ir;break}ue=0,pe=0}m.mode=16208;case 16208:Rt=pE;break e;case ir:Rt=xv;break e;case 16210:return Av;default:return ki}return f.next_out=_e,f.avail_out=Le,f.next_in=Z,f.avail_in=re,m.hold=ue,m.bits=pe,(m.wsize||Ve!==f.avail_out&&m.mode<ir&&(m.mode<rm||P!==wv))&&Pv(f,f.output,f.next_out,Ve-f.avail_out),wt-=f.avail_in,Ve-=f.avail_out,f.total_in+=wt,f.total_out+=Ve,m.total+=Ve,4&m.wrap&&Ve&&(f.adler=m.check=m.flags?le(m.check,V,Ve,f.next_out-Ve):H(m.check,V,Ve,f.next_out-Ve)),f.data_type=m.bits+(m.last?64:0)+(m.mode===Cs?128:0)+(m.mode===Yf||m.mode===tm?256:0),(wt===0&&Ve===0||P===wv)&&Rt===vo&&(Rt=mE),Rt},inflateEnd:function(f){if(yo(f))return ki;var P=f.state;return P.window&&(P.window=null),f.state=null,vo},inflateGetHeader:function(f,P){if(yo(f))return ki;var m=f.state;return 2&m.wrap?(m.head=P,P.done=!1,vo):ki},inflateSetDictionary:function(f,P){var m,$=P.length;return yo(f)||(m=f.state).wrap!==0&&m.mode!==Xf?ki:m.mode===Xf&&H(1,P,$,0)!==m.check?xv:Pv(f,P,$,$)?(m.mode=16210,Av):(m.havedict=1,vo)},inflateInfo:"pako inflate (from Nodeca project)"},yE=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Rv=Object.prototype.toString,wE=ce.Z_NO_FLUSH,xE=ce.Z_FINISH,Vc=ce.Z_OK,sm=ce.Z_STREAM_END,am=ce.Z_NEED_DICT,AE=ce.Z_STREAM_ERROR,Iv=ce.Z_DATA_ERROR,EE=ce.Z_MEM_ERROR;function Gc(f){this.options=At({chunkSize:65536,windowBits:15,to:""},f||{});var P=this.options;P.raw&&P.windowBits>=0&&P.windowBits<16&&(P.windowBits=-P.windowBits,P.windowBits===0&&(P.windowBits=-15)),!(P.windowBits>=0&&P.windowBits<16)||f&&f.windowBits||(P.windowBits+=32),P.windowBits>15&&P.windowBits<48&&!(15&P.windowBits)&&(P.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xr,this.strm.avail_out=0;var m=Ss.inflateInit2(this.strm,P.windowBits);if(m!==Vc)throw new Error(oe[m]);if(this.header=new yE,Ss.inflateGetHeader(this.strm,this.header),P.dictionary&&(typeof P.dictionary=="string"?P.dictionary=an(P.dictionary):Rv.call(P.dictionary)==="[object ArrayBuffer]"&&(P.dictionary=new Uint8Array(P.dictionary)),P.raw&&(m=Ss.inflateSetDictionary(this.strm,P.dictionary))!==Vc))throw new Error(oe[m])}function om(f,P){var m=new Gc(P);if(m.push(f),m.err)throw m.msg||oe[m.err];return m.result}Gc.prototype.push=function(f,P){var m,$,V,Z=this.strm,_e=this.options.chunkSize,re=this.options.dictionary;if(this.ended)return!1;for($=P===~~P?P:P===!0?xE:wE,Rv.call(f)==="[object ArrayBuffer]"?Z.input=new Uint8Array(f):Z.input=f,Z.next_in=0,Z.avail_in=Z.input.length;;){for(Z.avail_out===0&&(Z.output=new Uint8Array(_e),Z.next_out=0,Z.avail_out=_e),(m=Ss.inflate(Z,$))===am&&re&&((m=Ss.inflateSetDictionary(Z,re))===Vc?m=Ss.inflate(Z,$):m===Iv&&(m=am));Z.avail_in>0&&m===sm&&Z.state.wrap>0&&f[Z.next_in]!==0;)Ss.inflateReset(Z),m=Ss.inflate(Z,$);switch(m){case AE:case Iv:case am:case EE:return this.onEnd(m),this.ended=!0,!1}if(V=Z.avail_out,Z.next_out&&(Z.avail_out===0||m===sm))if(this.options.to==="string"){var Le=_s(Z.output,Z.next_out),ue=Z.next_out-Le,pe=pa(Z.output,Le);Z.next_out=ue,Z.avail_out=_e-ue,ue&&Z.output.set(Z.output.subarray(Le,Le+ue),0),this.onData(pe)}else this.onData(Z.output.length===Z.next_out?Z.output:Z.output.subarray(0,Z.next_out));if(m!==Vc||V!==0){if(m===sm)return m=Ss.inflateEnd(this.strm),this.onEnd(m),this.ended=!0,!0;if(Z.avail_in===0)break}}return!0},Gc.prototype.onData=function(f){this.chunks.push(f)},Gc.prototype.onEnd=function(f){f===Vc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=yt(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg};var Kf={Inflate:Gc,inflate:om,inflateRaw:function(f,P){return(P=P||{}).raw=!0,om(f,P)},ungzip:om},Nv=$f.Deflate,Mv=$f.deflate,Lv=$f.deflateRaw,Ov=$f.gzip,Fv=Kf.Inflate,Bv=Kf.inflate,zv=Kf.inflateRaw,jv=Kf.ungzip,Uv=ce,_E={Deflate:Nv,deflate:Mv,deflateRaw:Lv,gzip:Ov,Inflate:Fv,inflate:Bv,inflateRaw:zv,ungzip:jv,constants:Uv};t.Deflate=Nv,t.Inflate=Fv,t.constants=Uv,t.default=_E,t.deflate=Mv,t.deflateRaw=Lv,t.gzip=Ov,t.inflate=Bv,t.inflateRaw=zv,t.ungzip=jv,Object.defineProperty(t,"__esModule",{value:!0})})})(Ab,Ab.exports);var $P=Ab.exports,EA=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",_A=$P;jc.uncompressInputType=EA?"uint8array":"array";jc.compressInputType=EA?"uint8array":"array";jc.magic="\b\0";jc.compress=function(i,e){return _A.deflateRaw(i,{level:e.level||-1})};jc.uncompress=function(i){return _A.inflateRaw(i)};zf.STORE={magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:null,uncompressInputType:null};zf.DEFLATE=jc;var ov={exports:{}};ov.exports=function(i,e){return typeof i=="number"?Buffer.alloc(i):Buffer.from(i,e)};ov.exports.test=function(i){return Buffer.isBuffer(i)};var lv=ov.exports;(function(i){function e(h){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},e(h)}var t=pn,r=zf,n=lv;i.string2binary=function(h){for(var d="",p=0;p<h.length;p++)d+=String.fromCharCode(h.charCodeAt(p)&255);return d},i.arrayBuffer2Blob=function(h,d){i.checkSupport("blob"),d=d||"application/zip";try{return new Blob([h],{type:d})}catch{try{var p=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,g=new p;return g.append(h),g.getBlob(d)}catch{throw new Error("Bug : can't construct the Blob.")}}};function s(h){return h}function a(h,d){for(var p=0;p<h.length;++p)d[p]=h.charCodeAt(p)&255;return d}function o(h){var d=65536,p=[],g=h.length,y=i.getTypeOf(h),b=0,w=!0;try{switch(y){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,n(0));break}}catch{w=!1}if(!w){for(var v="",A=0;A<h.length;A++)v+=String.fromCharCode(h[A]);return v}for(;b<g&&d>1;)try{y==="array"||y==="nodebuffer"?p.push(String.fromCharCode.apply(null,h.slice(b,Math.min(b+d,g)))):p.push(String.fromCharCode.apply(null,h.subarray(b,Math.min(b+d,g)))),b+=d}catch{d=Math.floor(d/2)}return p.join("")}i.applyFromCharCode=o;function l(h,d){for(var p=0;p<h.length;p++)d[p]=h[p];return d}var c={};c.string={string:s,array:function(d){return a(d,new Array(d.length))},arraybuffer:function(d){return c.string.uint8array(d).buffer},uint8array:function(d){return a(d,new Uint8Array(d.length))},nodebuffer:function(d){return a(d,n(d.length))}},c.array={string:o,array:s,arraybuffer:function(d){return new Uint8Array(d).buffer},uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return n(d)}},c.arraybuffer={string:function(d){return o(new Uint8Array(d))},array:function(d){return l(new Uint8Array(d),new Array(d.byteLength))},arraybuffer:s,uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return n(new Uint8Array(d))}},c.uint8array={string:o,array:function(d){return l(d,new Array(d.length))},arraybuffer:function(d){return d.buffer},uint8array:s,nodebuffer:function(d){return n(d)}},c.nodebuffer={string:o,array:function(d){return l(d,new Array(d.length))},arraybuffer:function(d){return c.nodebuffer.uint8array(d).buffer},uint8array:function(d){return l(d,new Uint8Array(d.length))},nodebuffer:s},i.transformTo=function(h,d){if(d||(d=""),!h)return d;i.checkSupport(h);var p=i.getTypeOf(d),g=c[p][h](d);return g},i.getTypeOf=function(h){if(h!=null){if(typeof h=="string")return"string";var d=Object.prototype.toString.call(h);if(d==="[object Array]")return"array";if(t.nodebuffer&&n.test(h))return"nodebuffer";if(t.uint8array&&d==="[object Uint8Array]")return"uint8array";if(t.arraybuffer&&d==="[object ArrayBuffer]")return"arraybuffer";if(d==="[object Promise]")throw new Error("Cannot read data from a promise, you probably are running new PizZip(data) with a promise");if(e(h)==="object"&&typeof h.file=="function")throw new Error("Cannot read data from a pizzip instance, you probably are running new PizZip(zip) with a zipinstance");if(d==="[object Date]")throw new Error("Cannot read data from a Date, you probably are running new PizZip(data) with a date");if(e(h)==="object"&&h.crc32==null)throw new Error("Unsupported data given to new PizZip(data) (object given)")}},i.checkSupport=function(h){var d=t[h.toLowerCase()];if(!d)throw new Error(h+" is not supported by this browser")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(h){var d="",p,g;for(g=0;g<(h||"").length;g++)p=h.charCodeAt(g),d+="\\x"+(p<16?"0":"")+p.toString(16).toUpperCase();return d},i.findCompression=function(h){for(var d in r)if(r.hasOwnProperty(d)&&r[d].magic===h)return r[d];return null},i.isRegExp=function(h){return Object.prototype.toString.call(h)==="[object RegExp]"},i.extend=function(){var h={},d,p;for(d=0;d<arguments.length;d++)for(p in arguments[d])arguments[d].hasOwnProperty(p)&&typeof h[p]>"u"&&(h[p]=arguments[d][p]);return h}})(Ci);var VP=Ci,GP=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],qP=function(e,t){if(typeof e>"u"||!e.length)return 0;var r=VP.getTypeOf(e)!=="string";typeof t>"u"&&(t=0);var n=0,s=0,a=0;t^=-1;for(var o=0,l=e.length;o<l;o++)a=r?e[o]:e.charCodeAt(o),s=(t^a)&255,n=GP[s],t=t>>>8^n;return t^-1},bo={};bo.LOCAL_FILE_HEADER="PK";bo.CENTRAL_FILE_HEADER="PK";bo.CENTRAL_DIRECTORY_END="PK";bo.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";bo.ZIP64_CENTRAL_DIRECTORY_END="PK";bo.DATA_DESCRIPTOR="PK\x07\b";var Si={};Si.base64=!1;Si.binary=!1;Si.dir=!1;Si.createFolders=!1;Si.date=null;Si.compression=null;Si.compressionOptions=null;Si.comment=null;Si.unixPermissions=null;Si.dosPermissions=null;function CA(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}CA.prototype={getContent:function(){return null},getCompressedContent:function(){return null}};var SA=CA,Zg={},Eb=Ci,Dh=pn,WP=lv,Yh=new Array(256);for(var va=0;va<256;va++)Yh[va]=va>=252?6:va>=248?5:va>=240?4:va>=224?3:va>=192?2:1;Yh[254]=Yh[254]=1;function XP(i){var e,t,r,n,s,a=0,o=i.length;for(n=0;n<o;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<o&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),a+=t<128?1:t<2048?2:t<65536?3:4;for(Dh.uint8array?e=new Uint8Array(a):e=new Array(a),s=0,n=0;s<a;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<o&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e}function YP(i,e){var t;for(e=e||i.length,e>i.length&&(e=i.length),t=e-1;t>=0&&(i[t]&192)===128;)t--;return t<0||t===0?e:t+Yh[i[t]]>e?t:e}function x2(i){var e,t,r,n,s=i.length,a=new Array(s*2);for(t=0,e=0;e<s;){if(r=i[e++],r<128){a[t++]=r;continue}if(n=Yh[r],n>4){a[t++]=65533,e+=n-1;continue}for(r&=n===2?31:n===3?15:7;n>1&&e<s;)r=r<<6|i[e++]&63,n--;if(n>1){a[t++]=65533;continue}r<65536?a[t++]=r:(r-=65536,a[t++]=55296|r>>10&1023,a[t++]=56320|r&1023)}return a.length!==t&&(a.subarray?a=a.subarray(0,t):a.length=t),Eb.applyFromCharCode(a)}Zg.utf8encode=function(e){return Dh.nodebuffer?WP(e,"utf-8"):XP(e)};Zg.utf8decode=function(e){if(Dh.nodebuffer)return Eb.transformTo("nodebuffer",e).toString("utf-8");e=Eb.transformTo(Dh.uint8array?"uint8array":"array",e);for(var t=[],r=e.length,n=65536,s=0;s<r;){var a=YP(e,Math.min(s+n,r));Dh.uint8array?t.push(x2(e.subarray(s,a))):t.push(x2(e.slice(s,a))),s=a}return t.join("")};var ZP=Ci;function TA(){this.data=[]}TA.prototype={append:function(e){e=ZP.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}};var KP=TA,QP=Ci;function kA(i){this.data=new Uint8Array(i),this.index=0}kA.prototype={append:function(e){e.length!==0&&(e=QP.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}};var JP=kA;function eR(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=tR(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(c){throw c},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(ge,ve){if(ge){if(typeof ge=="string")return l(ge,ve);var he={}.toString.call(ge).slice(8,-1);return he==="Object"&&ge.constructor&&(he=ge.constructor.name),he==="Map"||he==="Set"?Array.from(ge):he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he)?l(ge,ve):void 0}}function l(ge,ve){(ve==null||ve>ge.length)&&(ve=ge.length);for(var he=0,me=Array(ve);he<ve;he++)me[he]=ge[he];return me}function c(ge,ve){var he=ge==null?null:typeof Symbol<"u"&&ge[Symbol.iterator]||ge["@@iterator"];if(he!=null){var me,Fe,Ue,st,Ye=[],ct=!0,pt=!1;try{if(Ue=(he=he.call(ge)).next,ve===0){if(Object(he)!==he)return;ct=!1}else for(;!(ct=(me=Ue.call(he)).done)&&(Ye.push(me.value),Ye.length!==ve);ct=!0);}catch(mt){pt=!0,Fe=mt}finally{try{if(!ct&&he.return!=null&&(st=he.return(),Object(st)!==st))return}finally{if(pt)throw Fe}}return Ye}}function h(ge){if(Array.isArray(ge))return ge}function d(ge){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ve){return typeof ve}:function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},d(ge)}function p(ge,ve){if(ge==null)return{};var he,me,Fe=g(ge,ve);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(ge);for(me=0;me<Ue.length;me++)he=Ue[me],ve.indexOf(he)===-1&&{}.propertyIsEnumerable.call(ge,he)&&(Fe[he]=ge[he])}return Fe}function g(ge,ve){if(ge==null)return{};var he={};for(var me in ge)if({}.hasOwnProperty.call(ge,me)){if(ve.indexOf(me)!==-1)continue;he[me]=ge[me]}return he}function y(ge,ve){if(!(ge instanceof ve))throw new TypeError("Cannot call a class as a function")}function b(ge,ve){for(var he=0;he<ve.length;he++){var me=ve[he];me.enumerable=me.enumerable||!1,me.configurable=!0,"value"in me&&(me.writable=!0),Object.defineProperty(ge,v(me.key),me)}}function w(ge,ve,he){return ve&&b(ge.prototype,ve),Object.defineProperty(ge,"prototype",{writable:!1}),ge}function v(ge){var ve=A(ge,"string");return d(ve)=="symbol"?ve:ve+""}function A(ge,ve){if(d(ge)!="object"||!ge)return ge;var he=ge[Symbol.toPrimitive];if(he!==void 0){var me=he.call(ge,ve);if(d(me)!="object")return me;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ge)}var E=Fr,_=wP,C=_.object({allowUnopenedTag:_.boolean().optional(),allowUnclosedTag:_.boolean().optional(),allowUnbalancedLoops:_.boolean().optional(),changeDelimiterPrefix:_.string().optional().nullable()}),I=_.object({delimiters:_.object({start:_.string().nullable(),end:_.string().nullable()}).strict().optional(),fileTypeConfig:_.object({}).optional(),paragraphLoop:_.boolean().optional(),parser:_.function().optional(),errorLogging:_.union([_.boolean(),_.string()]).optional(),linebreaks:_.boolean().optional(),nullGetter:_.function().optional(),syntax:C.optional(),stripInvalidXMLChars:_.boolean().optional()}).strict(),k=xP(),D=k.getRelsTypes,R=AP(),z=R.collectContentTypes,G=R.getContentTypes,O=Kl(),X=sv(),S=EP(),J=_P(),Y=yA(),W=CP(),fe=W.getTags,K=SP(),be=Xi,te=be.throwMultiError,j=be.throwResolveBeforeCompile,ie=be.throwRenderInvalidTemplate,ae=be.throwRenderTwice,H=be.XTInternalError,se=be.XTTemplateError,le=be.throwFileTypeNotIdentified,oe=be.throwFileTypeNotHandled,ce=be.throwApiVersionError;E.getRelsTypes=D,E.traits=X,E.moduleWrapper=O,E.collectContentTypes=z,E.getContentTypes=G;var Ae=E.getDefaults,Se=E.str2xml,Ne=E.xml2str,Te=E.concatArrays,x=E.uniq,U=E.getDuplicates,B=E.stableSort,F=E.pushArray,M=E.utf8ToWord,q=E.invertMap,de="[Content_Types].xml",ye="_rels/.rels",ee=[3,47,2];function Ee(ge){var ve=U(ge.map(function(he){var me=he.name;return me}));if(ve.length>0)throw new H('Detected duplicate module "'.concat(ve[0],'"'))}function De(ge){for(var ve=0,he=ge.modules;ve<he.length;ve++)for(var me=he[ve],Fe=0,Ue=me.xmlContentTypes||[];Fe<Ue.length;Fe++)for(var st=Ue[Fe],Ye=ge.invertedContentTypes[st]||[],ct=0;ct<Ye.length;ct++){var pt=Ye[ct];ge.zip.files[pt]&&ge.options.xmlFileNames.push(pt)}}function Ce(ge){return B(ge,function(ve,he){return(he.priority||0)-(ve.priority||0)})}function Me(ge){var ve=[];for(var he in ge)ve.push(he);for(var me=[de,ye],Fe=["word/","xl/","ppt/"],Ue=0;Ue<ve.length;Ue++)for(var st=ve[Ue],Ye=0;Ye<Fe.length;Ye++){var ct=Fe[Ye];st.indexOf("".concat(ct))===0&&me.push(st)}for(var pt=0;pt<ve.length;pt++){var mt=ve[pt];me.indexOf(mt)===-1&&me.push(mt)}return me}function $e(ge,ve){ge.hideDeprecations!==!0&&console.warn(ve)}function Xe(ge,ve){if(ge.hideDeprecations!==!0)return $e(ge,'Deprecated method ".'.concat(ve,'", view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : ').concat(new Error().stack))}function Tt(ge){ge.modules=ge.modules.filter(function(ve){if(!ve.supportedFileTypes)return!0;if(!Array.isArray(ve.supportedFileTypes))throw new Error("The supportedFileTypes field of the module must be an array");var he=ve.supportedFileTypes.includes(ge.fileType);return he||ve.on("detached"),he})}function nr(ge){var ve=ge.compiled;ge.errors=Te(Object.keys(ve).map(function(he){return ve[he].allErrors})),ge.errors.length!==0&&(ge.options.errorLogging&&K(ge.errors,ge.options.errorLogging),te(ge.errors))}function yr(ge){return typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(ge)}var rr=function(){function ge(ve){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=he.modules,Fe=me===void 0?[]:me,Ue=p(he,e);if(y(this,ge),this.targets=[],this.rendered=!1,this.scopeManagers={},this.compiled={},this.modules=[S()],this.xmlDocuments={},arguments.length===0)$e(this,"Deprecated docxtemplater constructor with no arguments, view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : ".concat(new Error().stack)),this.hideDeprecations=!0,this.setOptions(Ue);else{if(this.hideDeprecations=!0,this.setOptions(Ue),yr(ve))throw new Error("You passed a Buffer to the Docxtemplater constructor. The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)");if(!ve||!ve.files||typeof ve.file!="function")throw new Error("The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)");if(!Array.isArray(Fe))throw new Error("The modules argument of docxtemplater's constructor must be an array");for(var st=0;st<Fe.length;st++){var Ye=Fe[st];this.attachModule(Ye)}this.loadZip(ve),this.compile(),this.v4Constructor=!0}this.hideDeprecations=!1}return w(ge,[{key:"verifyApiVersion",value:function(he){return he=he.split(".").map(function(me){return parseInt(me,10)}),he.length!==3&&ce("neededVersion is not a valid version",{neededVersion:he,explanation:"the neededVersion must be an array of length 3"}),he[0]!==ee[0]&&ce("The major api version do not match, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:he,currentModuleApiVersion:ee,explanation:"moduleAPIVersionMismatch : needed=".concat(he.join("."),", current=").concat(ee.join("."))}),he[1]>ee[1]&&ce("The minor api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:he,currentModuleApiVersion:ee,explanation:"moduleAPIVersionMismatch : needed=".concat(he.join("."),", current=").concat(ee.join("."))}),he[1]===ee[1]&&he[2]>ee[2]&&ce("The patch api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:he,currentModuleApiVersion:ee,explanation:"moduleAPIVersionMismatch : needed=".concat(he.join("."),", current=").concat(ee.join("."))}),!0}},{key:"setModules",value:function(he){for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];Ue.set(he)}}},{key:"sendEvent",value:function(he){for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];Ue.on(he)}}},{key:"attachModule",value:function(he){if(this.v4Constructor)throw new H("attachModule() should not be called manually when using the v4 constructor");Xe(this,"attachModule");var me=d(he);if(me==="function")throw new H("Cannot attach a class/function as a module. Most probably you forgot to instantiate the module by using `new` on the module.");if(!he||me!=="object")throw new H("Cannot attachModule with a falsy value");if(he.requiredAPIVersion&&this.verifyApiVersion(he.requiredAPIVersion),he.attached===!0)if(typeof he.clone=="function")he=he.clone();else throw new Error('Cannot attach a module that was already attached : "'.concat(he.name,'". The most likely cause is that you are instantiating the module at the root level, and using it for multiple instances of Docxtemplater'));he.attached=!0;var Fe=O(he);return this.modules.push(Fe),Fe.on("attached"),this.fileType&&Tt(this),this}},{key:"findModule",value:function(he){for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];if(Ue.name===he)return Ue}}},{key:"setOptions",value:function(he){var me,Fe;if(this.v4Constructor)throw new Error("setOptions() should not be called manually when using the v4 constructor");if(!he)throw new Error("setOptions should be called with an object as first parameter");var Ue=I.validate(he);if(Ue.success===!1)throw new Error(Ue.error);Xe(this,"setOptions"),this.options={};var st=Ae();for(var Ye in st){var ct=st[Ye];this.options[Ye]=he[Ye]!=null?he[Ye]:this[Ye]||ct,this[Ye]=this.options[Ye]}return(me=this.delimiters).start&&(me.start=M(this.delimiters.start)),(Fe=this.delimiters).end&&(Fe.end=M(this.delimiters.end)),this}},{key:"loadZip",value:function(he){if(this.v4Constructor)throw new Error("loadZip() should not be called manually when using the v4 constructor");if(Xe(this,"loadZip"),he.loadAsync)throw new H("Docxtemplater doesn't handle JSZip version >=3, please use pizzip");this.zip=he,this.updateFileTypeConfig(),this.modules=Te([this.fileTypeConfig.baseModules.map(function(st){return st()}),this.modules]);for(var me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];Ue.zip=this.zip,Ue.docxtemplater=this,Ue.fileTypeConfig=this.fileTypeConfig,Ue.fileType=this.fileType,Ue.xtOptions=this.options,Ue.modules=this.modules}return Tt(this),this}},{key:"precompileFile",value:function(he){var me=this.createTemplateClass(he);me.preparse(),this.compiled[he]=me}},{key:"compileFile",value:function(he){this.compiled[he].parse()}},{key:"getScopeManager",value:function(he,me,Fe){var Ue;return(Ue=this.scopeManagers)[he]||(Ue[he]=J({tags:Fe,parser:this.parser,cachedParsers:me.cachedParsers})),this.scopeManagers[he]}},{key:"resolveData",value:function(he){var me=this;Xe(this,"resolveData");var Fe=[];return Object.keys(this.compiled).length||j(),Promise.resolve(he).then(function(Ue){return me.data=Ue,me.setModules({data:me.data,Lexer:Y}),me.mapper=me.modules.reduce(function(st,Ye){return Ye.getRenderedMap(st)},{}),Promise.all(Object.keys(me.mapper).map(function(st){var Ye=me.mapper[st],ct=Ye.from,pt=Ye.data;return Promise.resolve(pt).then(function(mt){var Ft=me.compiled[ct];return Ft.filePath=st,Ft.scopeManager=me.getScopeManager(st,Ft,mt),Ft.resolveTags(mt).then(function(at){return Ft.scopeManager.finishedResolving=!0,at},function(at){F(Fe,at)})})})).then(function(st){return Fe.length!==0&&(me.options.errorLogging&&K(Fe,me.options.errorLogging),te(Fe)),Te(st)})})}},{key:"compile",value:function(){if(Xe(this,"compile"),this.updateFileTypeConfig(),Ee(this.modules),this.modules=Ce(this.modules),Object.keys(this.compiled).length)return this;for(var he=this.options,me=0,Fe=this.modules;me<Fe.length;me++){var Ue=Fe[me];he=Ue.optionsTransformer(he,this)}this.options=he,this.options.xmlFileNames=x(this.options.xmlFileNames);for(var st=0,Ye=this.options.xmlFileNames;st<Ye.length;st++){var ct=Ye[st],pt=this.zip.files[ct].asText();this.xmlDocuments[ct]=Se(pt)}this.setModules({zip:this.zip,xmlDocuments:this.xmlDocuments});for(var mt=0,Ft=this.modules;mt<Ft.length;mt++){var at=Ft[mt];at.xmlDocuments=this.xmlDocuments}this.getTemplatedFiles(),this.sendEvent("before-preparse");for(var nn=0,jn=this.templatedFiles;nn<jn.length;nn++){var Ti=jn[nn];this.zip.files[Ti]!=null&&this.precompileFile(Ti)}this.sendEvent("after-preparse");for(var mn=0,Zi=this.templatedFiles;mn<Zi.length;mn++){var Un=Zi[mn];this.zip.files[Un]!=null&&this.compiled[Un].parse({noPostParse:!0})}this.sendEvent("after-parse");for(var sn=0,Wr=this.templatedFiles;sn<Wr.length;sn++){var ui=Wr[sn];this.zip.files[ui]!=null&&this.compiled[ui].postparse()}return this.sendEvent("after-postparse"),this.setModules({compiled:this.compiled}),nr(this),this}},{key:"updateFileTypeConfig",value:function(){this.relsTypes=D(this.zip);var he=G(this.zip),me=he.overrides,Fe=he.defaults,Ue=he.contentTypes,st=he.contentTypeXml;st&&(this.filesContentTypes=z(me,Fe,this.zip),this.invertedContentTypes=q(this.filesContentTypes),this.setModules({contentTypes:this.contentTypes,invertedContentTypes:this.invertedContentTypes}));var Ye;this.zip.files.mimetype&&(Ye="odt");for(var ct=0,pt=this.modules;ct<pt.length;ct++){var mt=pt[ct];Ye=mt.getFileType({zip:this.zip,contentTypes:Ue,contentTypeXml:st,overrides:me,defaults:Fe,doc:this})||Ye}if(this.fileType=Ye,Ye==="odt"&&oe(Ye),Ye||le(this.zip),De(this),Tt(this),this.fileTypeConfig=this.options.fileTypeConfig||this.fileTypeConfig,!this.fileTypeConfig)if(ge.FileTypeConfig[this.fileType])this.fileTypeConfig=ge.FileTypeConfig[this.fileType]();else{var Ft='Filetype "'.concat(this.fileType,'" is not supported'),at="filetype_not_supported";this.fileType==="xlsx"&&(Ft='Filetype "'.concat(this.fileType,'" is supported only with the paid XlsxModule'),at="xlsx_filetype_needs_xlsx_module");var nn=new se(Ft);throw nn.properties={id:at,explanation:Ft},nn}return this}},{key:"renderAsync",value:function(he){var me=this;this.hideDeprecations=!0;var Fe=this.resolveData(he);return this.hideDeprecations=!1,Fe.then(function(){return me.render()})}},{key:"render",value:function(he){this.rendered&&ae(),this.rendered=!0,Object.keys(this.compiled).length===0&&this.compile(),this.errors.length>0&&ie(),arguments.length>0&&(this.data=he),this.setModules({data:this.data,Lexer:Y}),this.mapper||(this.mapper=this.modules.reduce(function(Uc,Es){return Es.getRenderedMap(Uc)},{}));var me=[];for(var Fe in this.mapper){var Ue=this.mapper[Fe],st=Ue.from,Ye=Ue.data,ct=this.compiled[st];ct.scopeManager=this.getScopeManager(Fe,ct,Ye),ct.render(Fe),me.push([Fe,ct.content,ct]),delete ct.content}for(var pt=0;pt<me.length;pt++)for(var mt=me[pt],Ft=s(mt,3),at=Ft[1],nn=Ft[2],jn=0,Ti=this.modules;jn<Ti.length;jn++){var mn=Ti[jn];if(mn.preZip){var Zi=mn.preZip(at,nn);typeof Zi=="string"&&(mt[1]=Zi)}}for(var Un=0;Un<me.length;Un++){var sn=s(me[Un],2),Wr=sn[0],ui=sn[1];this.zip.file(Wr,ui,{createFolders:!0})}return nr(this),this.sendEvent("syncing-zip"),this.syncZip(),this.sendEvent("synced-zip"),this}},{key:"syncZip",value:function(){for(var he in this.xmlDocuments){this.zip.remove(he);var me=Ne(this.xmlDocuments[he]);this.zip.file(he,me,{createFolders:!0})}}},{key:"setData",value:function(he){return Xe(this,"setData"),this.data=he,this}},{key:"getZip",value:function(){return this.zip}},{key:"createTemplateClass",value:function(he){var me=this.zip.files[he].asText();return this.createTemplateClassFromContent(me,he)}},{key:"createTemplateClassFromContent",value:function(he,me){for(var Fe={filePath:me,contentType:this.filesContentTypes[me],relsType:this.relsTypes[me]},Ue=Ae(),st=F(Object.keys(Ue),["filesContentTypes","fileTypeConfig","fileType","modules"]),Ye=0;Ye<st.length;Ye++){var ct=st[Ye];Fe[ct]=this[ct]}return new ge.XmlTemplater(he,Fe)}},{key:"getFullText",value:function(he){return this.createTemplateClass(he||this.fileTypeConfig.textPath(this)).getFullText()}},{key:"getTemplatedFiles",value:function(){return this.templatedFiles=this.fileTypeConfig.getTemplatedFiles(this.zip),F(this.templatedFiles,this.targets),this.templatedFiles=x(this.templatedFiles),this.templatedFiles}},{key:"getTags",value:function(){var he={headers:[],footers:[]};for(var me in this.compiled){var Fe=this.filesContentTypes[me];Fe==="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"&&(he.document={target:me,tags:fe(this.compiled[me].postparsed)}),Fe==="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml"&&he.headers.push({target:me,tags:fe(this.compiled[me].postparsed)}),Fe==="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml"&&he.footers.push({target:me,tags:fe(this.compiled[me].postparsed)})}return he}},{key:"toBuffer",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"nodebuffer"}))}},{key:"toBlob",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"blob"}))}},{key:"toBase64",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"base64"}))}},{key:"toUint8Array",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"uint8array"}))}},{key:"toArrayBuffer",value:function(he){return this.zip.generate(r(r({compression:"DEFLATE",fileOrder:Me},he),{},{type:"arraybuffer"}))}}])}();rr.DocUtils=E,rr.Errors=Xi,rr.XmlTemplater=NP(),rr.FileTypeConfig=jP(),rr.XmlMatcher=wA(),i.exports=rr,i.exports.default=rr})(Ex);var UP=Ex.exports;const v2=_g(UP);var AA={exports:{}},Bf={},io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Bf.encode=function(i){for(var e="",t,r,n,s,a,o,l,c=0;c<i.length;)t=i.charCodeAt(c++),r=i.charCodeAt(c++),n=i.charCodeAt(c++),s=t>>2,a=(t&3)<<4|r>>4,o=(r&15)<<2|n>>6,l=n&63,isNaN(r)?o=l=64:isNaN(n)&&(l=64),e=e+io.charAt(s)+io.charAt(a)+io.charAt(o)+io.charAt(l);return e};Bf.decode=function(i){var e="",t,r,n,s,a,o,l,c=0;for(i=i.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<i.length;)s=io.indexOf(i.charAt(c++)),a=io.indexOf(i.charAt(c++)),o=io.indexOf(i.charAt(c++)),l=io.indexOf(i.charAt(c++)),t=s<<2|a>>4,r=(a&15)<<4|o>>2,n=(o&3)<<6|l,e+=String.fromCharCode(t),o!==64&&(e+=String.fromCharCode(r)),l!==64&&(e+=String.fromCharCode(n));return e};var pn={},cp;pn.base64=!0;pn.array=!0;pn.string=!0;pn.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";pn.nodebuffer=typeof Buffer<"u";pn.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")cp=pn.blob=!1;else{var y2=new ArrayBuffer(0);try{cp=pn.blob=new Blob([y2],{type:"application/zip"}).size===0}catch{try{var HP=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,w2=new HP;w2.append(y2),cp=pn.blob=w2.getBlob("application/zip").size===0}catch{cp=pn.blob=!1}}}var Ci={},zf={},jc={},Ab={exports:{}};/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(i,e){(function(t,r){r(e)})(sh,function(t){function r(f){for(var P=f.length;--P>=0;)f[P]=0}var n=256,s=286,a=30,o=15,l=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),c=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),d=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=new Array(576);r(p);var g=new Array(60);r(g);var y=new Array(512);r(y);var b=new Array(256);r(b);var w=new Array(29);r(w);var v,A,E,_=new Array(a);function C(f,P,m,$,V){this.static_tree=f,this.extra_bits=P,this.extra_base=m,this.elems=$,this.max_length=V,this.has_stree=f&&f.length}function I(f,P){this.dyn_tree=f,this.max_code=0,this.stat_desc=P}r(_);var k=function(f){return f<256?y[f]:y[256+(f>>>7)]},D=function(f,P){f.pending_buf[f.pending++]=255&P,f.pending_buf[f.pending++]=P>>>8&255},R=function(f,P,m){f.bi_valid>16-m?(f.bi_buf|=P<<f.bi_valid&65535,D(f,f.bi_buf),f.bi_buf=P>>16-f.bi_valid,f.bi_valid+=m-16):(f.bi_buf|=P<<f.bi_valid&65535,f.bi_valid+=m)},z=function(f,P,m){R(f,m[2*P],m[2*P+1])},G=function(f,P){var m=0;do m|=1&f,f>>>=1,m<<=1;while(--P>0);return m>>>1},O=function(f,P,m){var $,V,Z=new Array(16),_e=0;for($=1;$<=o;$++)_e=_e+m[$-1]<<1,Z[$]=_e;for(V=0;V<=P;V++){var re=f[2*V+1];re!==0&&(f[2*V]=G(Z[re]++,re))}},X=function(f){var P;for(P=0;P<s;P++)f.dyn_ltree[2*P]=0;for(P=0;P<a;P++)f.dyn_dtree[2*P]=0;for(P=0;P<19;P++)f.bl_tree[2*P]=0;f.dyn_ltree[512]=1,f.opt_len=f.static_len=0,f.sym_next=f.matches=0},S=function(f){f.bi_valid>8?D(f,f.bi_buf):f.bi_valid>0&&(f.pending_buf[f.pending++]=f.bi_buf),f.bi_buf=0,f.bi_valid=0},J=function(f,P,m,$){var V=2*P,Z=2*m;return f[V]<f[Z]||f[V]===f[Z]&&$[P]<=$[m]},Y=function(f,P,m){for(var $=f.heap[m],V=m<<1;V<=f.heap_len&&(V<f.heap_len&&J(P,f.heap[V+1],f.heap[V],f.depth)&&V++,!J(P,$,f.heap[V],f.depth));)f.heap[m]=f.heap[V],m=V,V<<=1;f.heap[m]=$},W=function(f,P,m){var $,V,Z,_e,re=0;if(f.sym_next!==0)do $=255&f.pending_buf[f.sym_buf+re++],$+=(255&f.pending_buf[f.sym_buf+re++])<<8,V=f.pending_buf[f.sym_buf+re++],$===0?z(f,V,P):(Z=b[V],z(f,Z+n+1,P),(_e=l[Z])!==0&&(V-=w[Z],R(f,V,_e)),$--,Z=k($),z(f,Z,m),(_e=c[Z])!==0&&($-=_[Z],R(f,$,_e)));while(re<f.sym_next);z(f,256,P)},fe=function(f,P){var m,$,V,Z=P.dyn_tree,_e=P.stat_desc.static_tree,re=P.stat_desc.has_stree,Le=P.stat_desc.elems,ue=-1;for(f.heap_len=0,f.heap_max=573,m=0;m<Le;m++)Z[2*m]!==0?(f.heap[++f.heap_len]=ue=m,f.depth[m]=0):Z[2*m+1]=0;for(;f.heap_len<2;)Z[2*(V=f.heap[++f.heap_len]=ue<2?++ue:0)]=1,f.depth[V]=0,f.opt_len--,re&&(f.static_len-=_e[2*V+1]);for(P.max_code=ue,m=f.heap_len>>1;m>=1;m--)Y(f,Z,m);V=Le;do m=f.heap[1],f.heap[1]=f.heap[f.heap_len--],Y(f,Z,1),$=f.heap[1],f.heap[--f.heap_max]=m,f.heap[--f.heap_max]=$,Z[2*V]=Z[2*m]+Z[2*$],f.depth[V]=(f.depth[m]>=f.depth[$]?f.depth[m]:f.depth[$])+1,Z[2*m+1]=Z[2*$+1]=V,f.heap[1]=V++,Y(f,Z,1);while(f.heap_len>=2);f.heap[--f.heap_max]=f.heap[1],function(pe,wt){var Ve,ke,je,bt,lt,Et,Be=wt.dyn_tree,Oe=wt.max_code,rt=wt.stat_desc.static_tree,Zt=wt.stat_desc.has_stree,Ke=wt.stat_desc.extra_bits,Rt=wt.stat_desc.extra_base,Dt=wt.stat_desc.max_length,nt=0;for(bt=0;bt<=o;bt++)pe.bl_count[bt]=0;for(Be[2*pe.heap[pe.heap_max]+1]=0,Ve=pe.heap_max+1;Ve<573;Ve++)(bt=Be[2*Be[2*(ke=pe.heap[Ve])+1]+1]+1)>Dt&&(bt=Dt,nt++),Be[2*ke+1]=bt,ke>Oe||(pe.bl_count[bt]++,lt=0,ke>=Rt&&(lt=Ke[ke-Rt]),Et=Be[2*ke],pe.opt_len+=Et*(bt+lt),Zt&&(pe.static_len+=Et*(rt[2*ke+1]+lt)));if(nt!==0){do{for(bt=Dt-1;pe.bl_count[bt]===0;)bt--;pe.bl_count[bt]--,pe.bl_count[bt+1]+=2,pe.bl_count[Dt]--,nt-=2}while(nt>0);for(bt=Dt;bt!==0;bt--)for(ke=pe.bl_count[bt];ke!==0;)(je=pe.heap[--Ve])>Oe||(Be[2*je+1]!==bt&&(pe.opt_len+=(bt-Be[2*je+1])*Be[2*je],Be[2*je+1]=bt),ke--)}}(f,P),O(Z,ue,f.bl_count)},K=function(f,P,m){var $,V,Z=-1,_e=P[1],re=0,Le=7,ue=4;for(_e===0&&(Le=138,ue=3),P[2*(m+1)+1]=65535,$=0;$<=m;$++)V=_e,_e=P[2*($+1)+1],++re<Le&&V===_e||(re<ue?f.bl_tree[2*V]+=re:V!==0?(V!==Z&&f.bl_tree[2*V]++,f.bl_tree[32]++):re<=10?f.bl_tree[34]++:f.bl_tree[36]++,re=0,Z=V,_e===0?(Le=138,ue=3):V===_e?(Le=6,ue=3):(Le=7,ue=4))},be=function(f,P,m){var $,V,Z=-1,_e=P[1],re=0,Le=7,ue=4;for(_e===0&&(Le=138,ue=3),$=0;$<=m;$++)if(V=_e,_e=P[2*($+1)+1],!(++re<Le&&V===_e)){if(re<ue)do z(f,V,f.bl_tree);while(--re!=0);else V!==0?(V!==Z&&(z(f,V,f.bl_tree),re--),z(f,16,f.bl_tree),R(f,re-3,2)):re<=10?(z(f,17,f.bl_tree),R(f,re-3,3)):(z(f,18,f.bl_tree),R(f,re-11,7));re=0,Z=V,_e===0?(Le=138,ue=3):V===_e?(Le=6,ue=3):(Le=7,ue=4)}},te=!1,j=function(f,P,m,$){R(f,0+($?1:0),3),S(f),D(f,m),D(f,~m),m&&f.pending_buf.set(f.window.subarray(P,P+m),f.pending),f.pending+=m},ie=function(f,P,m,$){var V,Z,_e=0;f.level>0?(f.strm.data_type===2&&(f.strm.data_type=function(re){var Le,ue=4093624447;for(Le=0;Le<=31;Le++,ue>>>=1)if(1&ue&&re.dyn_ltree[2*Le]!==0)return 0;if(re.dyn_ltree[18]!==0||re.dyn_ltree[20]!==0||re.dyn_ltree[26]!==0)return 1;for(Le=32;Le<n;Le++)if(re.dyn_ltree[2*Le]!==0)return 1;return 0}(f)),fe(f,f.l_desc),fe(f,f.d_desc),_e=function(re){var Le;for(K(re,re.dyn_ltree,re.l_desc.max_code),K(re,re.dyn_dtree,re.d_desc.max_code),fe(re,re.bl_desc),Le=18;Le>=3&&re.bl_tree[2*d[Le]+1]===0;Le--);return re.opt_len+=3*(Le+1)+5+5+4,Le}(f),V=f.opt_len+3+7>>>3,(Z=f.static_len+3+7>>>3)<=V&&(V=Z)):V=Z=m+5,m+4<=V&&P!==-1?j(f,P,m,$):f.strategy===4||Z===V?(R(f,2+($?1:0),3),W(f,p,g)):(R(f,4+($?1:0),3),function(re,Le,ue,pe){var wt;for(R(re,Le-257,5),R(re,ue-1,5),R(re,pe-4,4),wt=0;wt<pe;wt++)R(re,re.bl_tree[2*d[wt]+1],3);be(re,re.dyn_ltree,Le-1),be(re,re.dyn_dtree,ue-1)}(f,f.l_desc.max_code+1,f.d_desc.max_code+1,_e+1),W(f,f.dyn_ltree,f.dyn_dtree)),X(f),$&&S(f)},ae={_tr_init:function(f){te||(function(){var P,m,$,V,Z,_e=new Array(16);for($=0,V=0;V<28;V++)for(w[V]=$,P=0;P<1<<l[V];P++)b[$++]=V;for(b[$-1]=V,Z=0,V=0;V<16;V++)for(_[V]=Z,P=0;P<1<<c[V];P++)y[Z++]=V;for(Z>>=7;V<a;V++)for(_[V]=Z<<7,P=0;P<1<<c[V]-7;P++)y[256+Z++]=V;for(m=0;m<=o;m++)_e[m]=0;for(P=0;P<=143;)p[2*P+1]=8,P++,_e[8]++;for(;P<=255;)p[2*P+1]=9,P++,_e[9]++;for(;P<=279;)p[2*P+1]=7,P++,_e[7]++;for(;P<=287;)p[2*P+1]=8,P++,_e[8]++;for(O(p,287,_e),P=0;P<a;P++)g[2*P+1]=5,g[2*P]=G(P,5);v=new C(p,l,257,s,o),A=new C(g,c,0,a,o),E=new C(new Array(0),h,0,19,7)}(),te=!0),f.l_desc=new I(f.dyn_ltree,v),f.d_desc=new I(f.dyn_dtree,A),f.bl_desc=new I(f.bl_tree,E),f.bi_buf=0,f.bi_valid=0,X(f)},_tr_stored_block:j,_tr_flush_block:ie,_tr_tally:function(f,P,m){return f.pending_buf[f.sym_buf+f.sym_next++]=P,f.pending_buf[f.sym_buf+f.sym_next++]=P>>8,f.pending_buf[f.sym_buf+f.sym_next++]=m,P===0?f.dyn_ltree[2*m]++:(f.matches++,P--,f.dyn_ltree[2*(b[m]+n+1)]++,f.dyn_dtree[2*k(P)]++),f.sym_next===f.sym_end},_tr_align:function(f){R(f,2,3),z(f,256,p),function(P){P.bi_valid===16?(D(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):P.bi_valid>=8&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(f)}},H=function(f,P,m,$){for(var V=65535&f|0,Z=f>>>16&65535|0,_e=0;m!==0;){m-=_e=m>2e3?2e3:m;do Z=Z+(V=V+P[$++]|0)|0;while(--_e);V%=65521,Z%=65521}return V|Z<<16|0},se=new Uint32Array(function(){for(var f,P=[],m=0;m<256;m++){f=m;for(var $=0;$<8;$++)f=1&f?3988292384^f>>>1:f>>>1;P[m]=f}return P}()),le=function(f,P,m,$){var V=se,Z=$+m;f^=-1;for(var _e=$;_e<Z;_e++)f=f>>>8^V[255&(f^P[_e])];return-1^f},oe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ce={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Ae=ae._tr_init,Se=ae._tr_stored_block,Ne=ae._tr_flush_block,Te=ae._tr_tally,x=ae._tr_align,U=ce.Z_NO_FLUSH,B=ce.Z_PARTIAL_FLUSH,F=ce.Z_FULL_FLUSH,M=ce.Z_FINISH,q=ce.Z_BLOCK,de=ce.Z_OK,ye=ce.Z_STREAM_END,ee=ce.Z_STREAM_ERROR,Ee=ce.Z_DATA_ERROR,De=ce.Z_BUF_ERROR,Ce=ce.Z_DEFAULT_COMPRESSION,Me=ce.Z_FILTERED,$e=ce.Z_HUFFMAN_ONLY,Xe=ce.Z_RLE,Tt=ce.Z_FIXED,nr=ce.Z_DEFAULT_STRATEGY,yr=ce.Z_UNKNOWN,rr=ce.Z_DEFLATED,ge=258,ve=262,he=42,me=113,Fe=666,Ue=function(f,P){return f.msg=oe[P],P},st=function(f){return 2*f-(f>4?9:0)},Ye=function(f){for(var P=f.length;--P>=0;)f[P]=0},ct=function(f){var P,m,$,V=f.w_size;$=P=f.hash_size;do m=f.head[--$],f.head[$]=m>=V?m-V:0;while(--P);$=P=V;do m=f.prev[--$],f.prev[$]=m>=V?m-V:0;while(--P)},pt=function(f,P,m){return(P<<f.hash_shift^m)&f.hash_mask},mt=function(f){var P=f.state,m=P.pending;m>f.avail_out&&(m=f.avail_out),m!==0&&(f.output.set(P.pending_buf.subarray(P.pending_out,P.pending_out+m),f.next_out),f.next_out+=m,P.pending_out+=m,f.total_out+=m,f.avail_out-=m,P.pending-=m,P.pending===0&&(P.pending_out=0))},Ft=function(f,P){Ne(f,f.block_start>=0?f.block_start:-1,f.strstart-f.block_start,P),f.block_start=f.strstart,mt(f.strm)},at=function(f,P){f.pending_buf[f.pending++]=P},nn=function(f,P){f.pending_buf[f.pending++]=P>>>8&255,f.pending_buf[f.pending++]=255&P},jn=function(f,P,m,$){var V=f.avail_in;return V>$&&(V=$),V===0?0:(f.avail_in-=V,P.set(f.input.subarray(f.next_in,f.next_in+V),m),f.state.wrap===1?f.adler=H(f.adler,P,V,m):f.state.wrap===2&&(f.adler=le(f.adler,P,V,m)),f.next_in+=V,f.total_in+=V,V)},Ti=function(f,P){var m,$,V=f.max_chain_length,Z=f.strstart,_e=f.prev_length,re=f.nice_match,Le=f.strstart>f.w_size-ve?f.strstart-(f.w_size-ve):0,ue=f.window,pe=f.w_mask,wt=f.prev,Ve=f.strstart+ge,ke=ue[Z+_e-1],je=ue[Z+_e];f.prev_length>=f.good_match&&(V>>=2),re>f.lookahead&&(re=f.lookahead);do if(ue[(m=P)+_e]===je&&ue[m+_e-1]===ke&&ue[m]===ue[Z]&&ue[++m]===ue[Z+1]){Z+=2,m++;do;while(ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&ue[++Z]===ue[++m]&&Z<Ve);if($=ge-(Ve-Z),Z=Ve-ge,$>_e){if(f.match_start=P,_e=$,$>=re)break;ke=ue[Z+_e-1],je=ue[Z+_e]}}while((P=wt[P&pe])>Le&&--V!=0);return _e<=f.lookahead?_e:f.lookahead},mn=function(f){var P,m,$,V=f.w_size;do{if(m=f.window_size-f.lookahead-f.strstart,f.strstart>=V+(V-ve)&&(f.window.set(f.window.subarray(V,V+V-m),0),f.match_start-=V,f.strstart-=V,f.block_start-=V,f.insert>f.strstart&&(f.insert=f.strstart),ct(f),m+=V),f.strm.avail_in===0)break;if(P=jn(f.strm,f.window,f.strstart+f.lookahead,m),f.lookahead+=P,f.lookahead+f.insert>=3)for($=f.strstart-f.insert,f.ins_h=f.window[$],f.ins_h=pt(f,f.ins_h,f.window[$+1]);f.insert&&(f.ins_h=pt(f,f.ins_h,f.window[$+3-1]),f.prev[$&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=$,$++,f.insert--,!(f.lookahead+f.insert<3)););}while(f.lookahead<ve&&f.strm.avail_in!==0)},Zi=function(f,P){var m,$,V,Z=f.pending_buf_size-5>f.w_size?f.w_size:f.pending_buf_size-5,_e=0,re=f.strm.avail_in;do{if(m=65535,V=f.bi_valid+42>>3,f.strm.avail_out<V||(V=f.strm.avail_out-V,m>($=f.strstart-f.block_start)+f.strm.avail_in&&(m=$+f.strm.avail_in),m>V&&(m=V),m<Z&&(m===0&&P!==M||P===U||m!==$+f.strm.avail_in)))break;_e=P===M&&m===$+f.strm.avail_in?1:0,Se(f,0,0,_e),f.pending_buf[f.pending-4]=m,f.pending_buf[f.pending-3]=m>>8,f.pending_buf[f.pending-2]=~m,f.pending_buf[f.pending-1]=~m>>8,mt(f.strm),$&&($>m&&($=m),f.strm.output.set(f.window.subarray(f.block_start,f.block_start+$),f.strm.next_out),f.strm.next_out+=$,f.strm.avail_out-=$,f.strm.total_out+=$,f.block_start+=$,m-=$),m&&(jn(f.strm,f.strm.output,f.strm.next_out,m),f.strm.next_out+=m,f.strm.avail_out-=m,f.strm.total_out+=m)}while(_e===0);return(re-=f.strm.avail_in)&&(re>=f.w_size?(f.matches=2,f.window.set(f.strm.input.subarray(f.strm.next_in-f.w_size,f.strm.next_in),0),f.strstart=f.w_size,f.insert=f.strstart):(f.window_size-f.strstart<=re&&(f.strstart-=f.w_size,f.window.set(f.window.subarray(f.w_size,f.w_size+f.strstart),0),f.matches<2&&f.matches++,f.insert>f.strstart&&(f.insert=f.strstart)),f.window.set(f.strm.input.subarray(f.strm.next_in-re,f.strm.next_in),f.strstart),f.strstart+=re,f.insert+=re>f.w_size-f.insert?f.w_size-f.insert:re),f.block_start=f.strstart),f.high_water<f.strstart&&(f.high_water=f.strstart),_e?4:P!==U&&P!==M&&f.strm.avail_in===0&&f.strstart===f.block_start?2:(V=f.window_size-f.strstart,f.strm.avail_in>V&&f.block_start>=f.w_size&&(f.block_start-=f.w_size,f.strstart-=f.w_size,f.window.set(f.window.subarray(f.w_size,f.w_size+f.strstart),0),f.matches<2&&f.matches++,V+=f.w_size,f.insert>f.strstart&&(f.insert=f.strstart)),V>f.strm.avail_in&&(V=f.strm.avail_in),V&&(jn(f.strm,f.window,f.strstart,V),f.strstart+=V,f.insert+=V>f.w_size-f.insert?f.w_size-f.insert:V),f.high_water<f.strstart&&(f.high_water=f.strstart),V=f.bi_valid+42>>3,Z=(V=f.pending_buf_size-V>65535?65535:f.pending_buf_size-V)>f.w_size?f.w_size:V,(($=f.strstart-f.block_start)>=Z||($||P===M)&&P!==U&&f.strm.avail_in===0&&$<=V)&&(m=$>V?V:$,_e=P===M&&f.strm.avail_in===0&&m===$?1:0,Se(f,f.block_start,m,_e),f.block_start+=m,mt(f.strm)),_e?3:1)},Un=function(f,P){for(var m,$;;){if(f.lookahead<ve){if(mn(f),f.lookahead<ve&&P===U)return 1;if(f.lookahead===0)break}if(m=0,f.lookahead>=3&&(f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),m!==0&&f.strstart-m<=f.w_size-ve&&(f.match_length=Ti(f,m)),f.match_length>=3)if($=Te(f,f.strstart-f.match_start,f.match_length-3),f.lookahead-=f.match_length,f.match_length<=f.max_lazy_match&&f.lookahead>=3){f.match_length--;do f.strstart++,f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart;while(--f.match_length!=0);f.strstart++}else f.strstart+=f.match_length,f.match_length=0,f.ins_h=f.window[f.strstart],f.ins_h=pt(f,f.ins_h,f.window[f.strstart+1]);else $=Te(f,0,f.window[f.strstart]),f.lookahead--,f.strstart++;if($&&(Ft(f,!1),f.strm.avail_out===0))return 1}return f.insert=f.strstart<2?f.strstart:2,P===M?(Ft(f,!0),f.strm.avail_out===0?3:4):f.sym_next&&(Ft(f,!1),f.strm.avail_out===0)?1:2},sn=function(f,P){for(var m,$,V;;){if(f.lookahead<ve){if(mn(f),f.lookahead<ve&&P===U)return 1;if(f.lookahead===0)break}if(m=0,f.lookahead>=3&&(f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),f.prev_length=f.match_length,f.prev_match=f.match_start,f.match_length=2,m!==0&&f.prev_length<f.max_lazy_match&&f.strstart-m<=f.w_size-ve&&(f.match_length=Ti(f,m),f.match_length<=5&&(f.strategy===Me||f.match_length===3&&f.strstart-f.match_start>4096)&&(f.match_length=2)),f.prev_length>=3&&f.match_length<=f.prev_length){V=f.strstart+f.lookahead-3,$=Te(f,f.strstart-1-f.prev_match,f.prev_length-3),f.lookahead-=f.prev_length-1,f.prev_length-=2;do++f.strstart<=V&&(f.ins_h=pt(f,f.ins_h,f.window[f.strstart+3-1]),m=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart);while(--f.prev_length!=0);if(f.match_available=0,f.match_length=2,f.strstart++,$&&(Ft(f,!1),f.strm.avail_out===0))return 1}else if(f.match_available){if(($=Te(f,0,f.window[f.strstart-1]))&&Ft(f,!1),f.strstart++,f.lookahead--,f.strm.avail_out===0)return 1}else f.match_available=1,f.strstart++,f.lookahead--}return f.match_available&&($=Te(f,0,f.window[f.strstart-1]),f.match_available=0),f.insert=f.strstart<2?f.strstart:2,P===M?(Ft(f,!0),f.strm.avail_out===0?3:4):f.sym_next&&(Ft(f,!1),f.strm.avail_out===0)?1:2};function Wr(f,P,m,$,V){this.good_length=f,this.max_lazy=P,this.nice_length=m,this.max_chain=$,this.func=V}var ui=[new Wr(0,0,0,0,Zi),new Wr(4,4,8,4,Un),new Wr(4,5,16,8,Un),new Wr(4,6,32,32,Un),new Wr(4,4,16,16,sn),new Wr(8,16,32,32,sn),new Wr(8,16,128,128,sn),new Wr(8,32,128,256,sn),new Wr(32,128,258,1024,sn),new Wr(32,258,258,4096,sn)];function Uc(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Ye(this.dyn_ltree),Ye(this.dyn_dtree),Ye(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Ye(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ye(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Es=function(f){if(!f)return 1;var P=f.state;return!P||P.strm!==f||P.status!==he&&P.status!==57&&P.status!==69&&P.status!==73&&P.status!==91&&P.status!==103&&P.status!==me&&P.status!==Fe?1:0},Q=function(f){if(Es(f))return Ue(f,ee);f.total_in=f.total_out=0,f.data_type=yr;var P=f.state;return P.pending=0,P.pending_out=0,P.wrap<0&&(P.wrap=-P.wrap),P.status=P.wrap===2?57:P.wrap?he:me,f.adler=P.wrap===2?0:1,P.last_flush=-2,Ae(P),de},Re=function(f){var P,m=Q(f);return m===de&&((P=f.state).window_size=2*P.w_size,Ye(P.head),P.max_lazy_match=ui[P.level].max_lazy,P.good_match=ui[P.level].good_length,P.nice_match=ui[P.level].nice_length,P.max_chain_length=ui[P.level].max_chain,P.strstart=0,P.block_start=0,P.lookahead=0,P.insert=0,P.match_length=P.prev_length=2,P.match_available=0,P.ins_h=0),m},He=function(f,P,m,$,V,Z){if(!f)return ee;var _e=1;if(P===Ce&&(P=6),$<0?(_e=0,$=-$):$>15&&(_e=2,$-=16),V<1||V>9||m!==rr||$<8||$>15||P<0||P>9||Z<0||Z>Tt||$===8&&_e!==1)return Ue(f,ee);$===8&&($=9);var re=new Uc;return f.state=re,re.strm=f,re.status=he,re.wrap=_e,re.gzhead=null,re.w_bits=$,re.w_size=1<<re.w_bits,re.w_mask=re.w_size-1,re.hash_bits=V+7,re.hash_size=1<<re.hash_bits,re.hash_mask=re.hash_size-1,re.hash_shift=~~((re.hash_bits+3-1)/3),re.window=new Uint8Array(2*re.w_size),re.head=new Uint16Array(re.hash_size),re.prev=new Uint16Array(re.w_size),re.lit_bufsize=1<<V+6,re.pending_buf_size=4*re.lit_bufsize,re.pending_buf=new Uint8Array(re.pending_buf_size),re.sym_buf=re.lit_bufsize,re.sym_end=3*(re.lit_bufsize-1),re.level=P,re.strategy=Z,re.method=m,Re(f)},Je={deflateInit:function(f,P){return He(f,P,rr,15,8,nr)},deflateInit2:He,deflateReset:Re,deflateResetKeep:Q,deflateSetHeader:function(f,P){return Es(f)||f.state.wrap!==2?ee:(f.state.gzhead=P,de)},deflate:function(f,P){if(Es(f)||P>q||P<0)return f?Ue(f,ee):ee;var m=f.state;if(!f.output||f.avail_in!==0&&!f.input||m.status===Fe&&P!==M)return Ue(f,f.avail_out===0?De:ee);var $=m.last_flush;if(m.last_flush=P,m.pending!==0){if(mt(f),f.avail_out===0)return m.last_flush=-1,de}else if(f.avail_in===0&&st(P)<=st($)&&P!==M)return Ue(f,De);if(m.status===Fe&&f.avail_in!==0)return Ue(f,De);if(m.status===he&&m.wrap===0&&(m.status=me),m.status===he){var V=rr+(m.w_bits-8<<4)<<8;if(V|=(m.strategy>=$e||m.level<2?0:m.level<6?1:m.level===6?2:3)<<6,m.strstart!==0&&(V|=32),nn(m,V+=31-V%31),m.strstart!==0&&(nn(m,f.adler>>>16),nn(m,65535&f.adler)),f.adler=1,m.status=me,mt(f),m.pending!==0)return m.last_flush=-1,de}if(m.status===57){if(f.adler=0,at(m,31),at(m,139),at(m,8),m.gzhead)at(m,(m.gzhead.text?1:0)+(m.gzhead.hcrc?2:0)+(m.gzhead.extra?4:0)+(m.gzhead.name?8:0)+(m.gzhead.comment?16:0)),at(m,255&m.gzhead.time),at(m,m.gzhead.time>>8&255),at(m,m.gzhead.time>>16&255),at(m,m.gzhead.time>>24&255),at(m,m.level===9?2:m.strategy>=$e||m.level<2?4:0),at(m,255&m.gzhead.os),m.gzhead.extra&&m.gzhead.extra.length&&(at(m,255&m.gzhead.extra.length),at(m,m.gzhead.extra.length>>8&255)),m.gzhead.hcrc&&(f.adler=le(f.adler,m.pending_buf,m.pending,0)),m.gzindex=0,m.status=69;else if(at(m,0),at(m,0),at(m,0),at(m,0),at(m,0),at(m,m.level===9?2:m.strategy>=$e||m.level<2?4:0),at(m,3),m.status=me,mt(f),m.pending!==0)return m.last_flush=-1,de}if(m.status===69){if(m.gzhead.extra){for(var Z=m.pending,_e=(65535&m.gzhead.extra.length)-m.gzindex;m.pending+_e>m.pending_buf_size;){var re=m.pending_buf_size-m.pending;if(m.pending_buf.set(m.gzhead.extra.subarray(m.gzindex,m.gzindex+re),m.pending),m.pending=m.pending_buf_size,m.gzhead.hcrc&&m.pending>Z&&(f.adler=le(f.adler,m.pending_buf,m.pending-Z,Z)),m.gzindex+=re,mt(f),m.pending!==0)return m.last_flush=-1,de;Z=0,_e-=re}var Le=new Uint8Array(m.gzhead.extra);m.pending_buf.set(Le.subarray(m.gzindex,m.gzindex+_e),m.pending),m.pending+=_e,m.gzhead.hcrc&&m.pending>Z&&(f.adler=le(f.adler,m.pending_buf,m.pending-Z,Z)),m.gzindex=0}m.status=73}if(m.status===73){if(m.gzhead.name){var ue,pe=m.pending;do{if(m.pending===m.pending_buf_size){if(m.gzhead.hcrc&&m.pending>pe&&(f.adler=le(f.adler,m.pending_buf,m.pending-pe,pe)),mt(f),m.pending!==0)return m.last_flush=-1,de;pe=0}ue=m.gzindex<m.gzhead.name.length?255&m.gzhead.name.charCodeAt(m.gzindex++):0,at(m,ue)}while(ue!==0);m.gzhead.hcrc&&m.pending>pe&&(f.adler=le(f.adler,m.pending_buf,m.pending-pe,pe)),m.gzindex=0}m.status=91}if(m.status===91){if(m.gzhead.comment){var wt,Ve=m.pending;do{if(m.pending===m.pending_buf_size){if(m.gzhead.hcrc&&m.pending>Ve&&(f.adler=le(f.adler,m.pending_buf,m.pending-Ve,Ve)),mt(f),m.pending!==0)return m.last_flush=-1,de;Ve=0}wt=m.gzindex<m.gzhead.comment.length?255&m.gzhead.comment.charCodeAt(m.gzindex++):0,at(m,wt)}while(wt!==0);m.gzhead.hcrc&&m.pending>Ve&&(f.adler=le(f.adler,m.pending_buf,m.pending-Ve,Ve))}m.status=103}if(m.status===103){if(m.gzhead.hcrc){if(m.pending+2>m.pending_buf_size&&(mt(f),m.pending!==0))return m.last_flush=-1,de;at(m,255&f.adler),at(m,f.adler>>8&255),f.adler=0}if(m.status=me,mt(f),m.pending!==0)return m.last_flush=-1,de}if(f.avail_in!==0||m.lookahead!==0||P!==U&&m.status!==Fe){var ke=m.level===0?Zi(m,P):m.strategy===$e?function(je,bt){for(var lt;;){if(je.lookahead===0&&(mn(je),je.lookahead===0)){if(bt===U)return 1;break}if(je.match_length=0,lt=Te(je,0,je.window[je.strstart]),je.lookahead--,je.strstart++,lt&&(Ft(je,!1),je.strm.avail_out===0))return 1}return je.insert=0,bt===M?(Ft(je,!0),je.strm.avail_out===0?3:4):je.sym_next&&(Ft(je,!1),je.strm.avail_out===0)?1:2}(m,P):m.strategy===Xe?function(je,bt){for(var lt,Et,Be,Oe,rt=je.window;;){if(je.lookahead<=ge){if(mn(je),je.lookahead<=ge&&bt===U)return 1;if(je.lookahead===0)break}if(je.match_length=0,je.lookahead>=3&&je.strstart>0&&(Et=rt[Be=je.strstart-1])===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]){Oe=je.strstart+ge;do;while(Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Et===rt[++Be]&&Be<Oe);je.match_length=ge-(Oe-Be),je.match_length>je.lookahead&&(je.match_length=je.lookahead)}if(je.match_length>=3?(lt=Te(je,1,je.match_length-3),je.lookahead-=je.match_length,je.strstart+=je.match_length,je.match_length=0):(lt=Te(je,0,je.window[je.strstart]),je.lookahead--,je.strstart++),lt&&(Ft(je,!1),je.strm.avail_out===0))return 1}return je.insert=0,bt===M?(Ft(je,!0),je.strm.avail_out===0?3:4):je.sym_next&&(Ft(je,!1),je.strm.avail_out===0)?1:2}(m,P):ui[m.level].func(m,P);if(ke!==3&&ke!==4||(m.status=Fe),ke===1||ke===3)return f.avail_out===0&&(m.last_flush=-1),de;if(ke===2&&(P===B?x(m):P!==q&&(Se(m,0,0,!1),P===F&&(Ye(m.head),m.lookahead===0&&(m.strstart=0,m.block_start=0,m.insert=0))),mt(f),f.avail_out===0))return m.last_flush=-1,de}return P!==M?de:m.wrap<=0?ye:(m.wrap===2?(at(m,255&f.adler),at(m,f.adler>>8&255),at(m,f.adler>>16&255),at(m,f.adler>>24&255),at(m,255&f.total_in),at(m,f.total_in>>8&255),at(m,f.total_in>>16&255),at(m,f.total_in>>24&255)):(nn(m,f.adler>>>16),nn(m,65535&f.adler)),mt(f),m.wrap>0&&(m.wrap=-m.wrap),m.pending!==0?de:ye)},deflateEnd:function(f){if(Es(f))return ee;var P=f.state.status;return f.state=null,P===me?Ue(f,Ee):de},deflateSetDictionary:function(f,P){var m=P.length;if(Es(f))return ee;var $=f.state,V=$.wrap;if(V===2||V===1&&$.status!==he||$.lookahead)return ee;if(V===1&&(f.adler=H(f.adler,P,m,0)),$.wrap=0,m>=$.w_size){V===0&&(Ye($.head),$.strstart=0,$.block_start=0,$.insert=0);var Z=new Uint8Array($.w_size);Z.set(P.subarray(m-$.w_size,m),0),P=Z,m=$.w_size}var _e=f.avail_in,re=f.next_in,Le=f.input;for(f.avail_in=m,f.next_in=0,f.input=P,mn($);$.lookahead>=3;){var ue=$.strstart,pe=$.lookahead-2;do $.ins_h=pt($,$.ins_h,$.window[ue+3-1]),$.prev[ue&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=ue,ue++;while(--pe);$.strstart=ue,$.lookahead=2,mn($)}return $.strstart+=$.lookahead,$.block_start=$.strstart,$.insert=$.lookahead,$.lookahead=0,$.match_length=$.prev_length=2,$.match_available=0,f.next_in=re,f.input=Le,f.avail_in=_e,$.wrap=V,de},deflateInfo:"pako deflate (from Nodeca project)"};function Pt(f){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Pt(f)}var jt=function(f,P){return Object.prototype.hasOwnProperty.call(f,P)},At=function(f){for(var P=Array.prototype.slice.call(arguments,1);P.length;){var m=P.shift();if(m){if(Pt(m)!=="object")throw new TypeError(m+"must be non-object");for(var $ in m)jt(m,$)&&(f[$]=m[$])}}return f},yt=function(f){for(var P=0,m=0,$=f.length;m<$;m++)P+=f[m].length;for(var V=new Uint8Array(P),Z=0,_e=0,re=f.length;Z<re;Z++){var Le=f[Z];V.set(Le,_e),_e+=Le.length}return V},Br=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Br=!1}for(var Yt=new Uint8Array(256),Ut=0;Ut<256;Ut++)Yt[Ut]=Ut>=252?6:Ut>=248?5:Ut>=240?4:Ut>=224?3:Ut>=192?2:1;Yt[254]=Yt[254]=1;var an=function(f){if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(f);var P,m,$,V,Z,_e=f.length,re=0;for(V=0;V<_e;V++)(64512&(m=f.charCodeAt(V)))==55296&&V+1<_e&&(64512&($=f.charCodeAt(V+1)))==56320&&(m=65536+(m-55296<<10)+($-56320),V++),re+=m<128?1:m<2048?2:m<65536?3:4;for(P=new Uint8Array(re),Z=0,V=0;Z<re;V++)(64512&(m=f.charCodeAt(V)))==55296&&V+1<_e&&(64512&($=f.charCodeAt(V+1)))==56320&&(m=65536+(m-55296<<10)+($-56320),V++),m<128?P[Z++]=m:m<2048?(P[Z++]=192|m>>>6,P[Z++]=128|63&m):m<65536?(P[Z++]=224|m>>>12,P[Z++]=128|m>>>6&63,P[Z++]=128|63&m):(P[Z++]=240|m>>>18,P[Z++]=128|m>>>12&63,P[Z++]=128|m>>>6&63,P[Z++]=128|63&m);return P},pa=function(f,P){var m,$,V=P||f.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(f.subarray(0,P));var Z=new Array(2*V);for($=0,m=0;m<V;){var _e=f[m++];if(_e<128)Z[$++]=_e;else{var re=Yt[_e];if(re>4)Z[$++]=65533,m+=re-1;else{for(_e&=re===2?31:re===3?15:7;re>1&&m<V;)_e=_e<<6|63&f[m++],re--;re>1?Z[$++]=65533:_e<65536?Z[$++]=_e:(_e-=65536,Z[$++]=55296|_e>>10&1023,Z[$++]=56320|1023&_e)}}}return function(Le,ue){if(ue<65534&&Le.subarray&&Br)return String.fromCharCode.apply(null,Le.length===ue?Le:Le.subarray(0,ue));for(var pe="",wt=0;wt<ue;wt++)pe+=String.fromCharCode(Le[wt]);return pe}(Z,$)},_s=function(f,P){(P=P||f.length)>f.length&&(P=f.length);for(var m=P-1;m>=0&&(192&f[m])==128;)m--;return m<0||m===0?P:m+Yt[f[m]]>P?m:P},Xr=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Jl=Object.prototype.toString,Kg=ce.Z_NO_FLUSH,Qg=ce.Z_SYNC_FLUSH,rE=ce.Z_FULL_FLUSH,nE=ce.Z_FINISH,Hf=ce.Z_OK,iE=ce.Z_STREAM_END,sE=ce.Z_DEFAULT_COMPRESSION,aE=ce.Z_DEFAULT_STRATEGY,oE=ce.Z_DEFLATED;function Hc(f){this.options=At({level:sE,method:oE,chunkSize:16384,windowBits:15,memLevel:8,strategy:aE},f||{});var P=this.options;P.raw&&P.windowBits>0?P.windowBits=-P.windowBits:P.gzip&&P.windowBits>0&&P.windowBits<16&&(P.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xr,this.strm.avail_out=0;var m=Je.deflateInit2(this.strm,P.level,P.method,P.windowBits,P.memLevel,P.strategy);if(m!==Hf)throw new Error(oe[m]);if(P.header&&Je.deflateSetHeader(this.strm,P.header),P.dictionary){var $;if($=typeof P.dictionary=="string"?an(P.dictionary):Jl.call(P.dictionary)==="[object ArrayBuffer]"?new Uint8Array(P.dictionary):P.dictionary,(m=Je.deflateSetDictionary(this.strm,$))!==Hf)throw new Error(oe[m]);this._dict_set=!0}}function Jg(f,P){var m=new Hc(P);if(m.push(f,!0),m.err)throw m.msg||oe[m.err];return m.result}Hc.prototype.push=function(f,P){var m,$,V=this.strm,Z=this.options.chunkSize;if(this.ended)return!1;for($=P===~~P?P:P===!0?nE:Kg,typeof f=="string"?V.input=an(f):Jl.call(f)==="[object ArrayBuffer]"?V.input=new Uint8Array(f):V.input=f,V.next_in=0,V.avail_in=V.input.length;;)if(V.avail_out===0&&(V.output=new Uint8Array(Z),V.next_out=0,V.avail_out=Z),($===Qg||$===rE)&&V.avail_out<=6)this.onData(V.output.subarray(0,V.next_out)),V.avail_out=0;else{if((m=Je.deflate(V,$))===iE)return V.next_out>0&&this.onData(V.output.subarray(0,V.next_out)),m=Je.deflateEnd(this.strm),this.onEnd(m),this.ended=!0,m===Hf;if(V.avail_out!==0){if($>0&&V.next_out>0)this.onData(V.output.subarray(0,V.next_out)),V.avail_out=0;else if(V.avail_in===0)break}else this.onData(V.output)}return!0},Hc.prototype.onData=function(f){this.chunks.push(f)},Hc.prototype.onEnd=function(f){f===Hf&&(this.result=yt(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg};var $f={Deflate:Hc,deflate:Jg,deflateRaw:function(f,P){return(P=P||{}).raw=!0,Jg(f,P)},gzip:function(f,P){return(P=P||{}).gzip=!0,Jg(f,P)}},Vf=16209,lE=function(f,P){var m,$,V,Z,_e,re,Le,ue,pe,wt,Ve,ke,je,bt,lt,Et,Be,Oe,rt,Zt,Ke,Rt,Dt,nt,ht=f.state;m=f.next_in,Dt=f.input,$=m+(f.avail_in-5),V=f.next_out,nt=f.output,Z=V-(P-f.avail_out),_e=V+(f.avail_out-257),re=ht.dmax,Le=ht.wsize,ue=ht.whave,pe=ht.wnext,wt=ht.window,Ve=ht.hold,ke=ht.bits,je=ht.lencode,bt=ht.distcode,lt=(1<<ht.lenbits)-1,Et=(1<<ht.distbits)-1;e:do{ke<15&&(Ve+=Dt[m++]<<ke,ke+=8,Ve+=Dt[m++]<<ke,ke+=8),Be=je[Ve&lt];t:for(;;){if(Ve>>>=Oe=Be>>>24,ke-=Oe,(Oe=Be>>>16&255)===0)nt[V++]=65535&Be;else{if(!(16&Oe)){if(!(64&Oe)){Be=je[(65535&Be)+(Ve&(1<<Oe)-1)];continue t}if(32&Oe){ht.mode=16191;break e}f.msg="invalid literal/length code",ht.mode=Vf;break e}rt=65535&Be,(Oe&=15)&&(ke<Oe&&(Ve+=Dt[m++]<<ke,ke+=8),rt+=Ve&(1<<Oe)-1,Ve>>>=Oe,ke-=Oe),ke<15&&(Ve+=Dt[m++]<<ke,ke+=8,Ve+=Dt[m++]<<ke,ke+=8),Be=bt[Ve&Et];r:for(;;){if(Ve>>>=Oe=Be>>>24,ke-=Oe,!(16&(Oe=Be>>>16&255))){if(!(64&Oe)){Be=bt[(65535&Be)+(Ve&(1<<Oe)-1)];continue r}f.msg="invalid distance code",ht.mode=Vf;break e}if(Zt=65535&Be,ke<(Oe&=15)&&(Ve+=Dt[m++]<<ke,(ke+=8)<Oe&&(Ve+=Dt[m++]<<ke,ke+=8)),(Zt+=Ve&(1<<Oe)-1)>re){f.msg="invalid distance too far back",ht.mode=Vf;break e}if(Ve>>>=Oe,ke-=Oe,Zt>(Oe=V-Z)){if((Oe=Zt-Oe)>ue&&ht.sane){f.msg="invalid distance too far back",ht.mode=Vf;break e}if(Ke=0,Rt=wt,pe===0){if(Ke+=Le-Oe,Oe<rt){rt-=Oe;do nt[V++]=wt[Ke++];while(--Oe);Ke=V-Zt,Rt=nt}}else if(pe<Oe){if(Ke+=Le+pe-Oe,(Oe-=pe)<rt){rt-=Oe;do nt[V++]=wt[Ke++];while(--Oe);if(Ke=0,pe<rt){rt-=Oe=pe;do nt[V++]=wt[Ke++];while(--Oe);Ke=V-Zt,Rt=nt}}}else if(Ke+=pe-Oe,Oe<rt){rt-=Oe;do nt[V++]=wt[Ke++];while(--Oe);Ke=V-Zt,Rt=nt}for(;rt>2;)nt[V++]=Rt[Ke++],nt[V++]=Rt[Ke++],nt[V++]=Rt[Ke++],rt-=3;rt&&(nt[V++]=Rt[Ke++],rt>1&&(nt[V++]=Rt[Ke++]))}else{Ke=V-Zt;do nt[V++]=nt[Ke++],nt[V++]=nt[Ke++],nt[V++]=nt[Ke++],rt-=3;while(rt>2);rt&&(nt[V++]=nt[Ke++],rt>1&&(nt[V++]=nt[Ke++]))}break}}break}}while(m<$&&V<_e);m-=rt=ke>>3,Ve&=(1<<(ke-=rt<<3))-1,f.next_in=m,f.next_out=V,f.avail_in=m<$?$-m+5:5-(m-$),f.avail_out=V<_e?_e-V+257:257-(V-_e),ht.hold=Ve,ht.bits=ke},Gf=15,uE=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),cE=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),hE=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dE=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),$c=function(f,P,m,$,V,Z,_e,re){var Le,ue,pe,wt,Ve,ke,je,bt,lt,Et=re.bits,Be=0,Oe=0,rt=0,Zt=0,Ke=0,Rt=0,Dt=0,nt=0,ht=0,Vt=0,wo=null,ga=new Uint16Array(16),Qf=new Uint16Array(16),Jf=null;for(Be=0;Be<=Gf;Be++)ga[Be]=0;for(Oe=0;Oe<$;Oe++)ga[P[m+Oe]]++;for(Ke=Et,Zt=Gf;Zt>=1&&ga[Zt]===0;Zt--);if(Ke>Zt&&(Ke=Zt),Zt===0)return V[Z++]=20971520,V[Z++]=20971520,re.bits=1,0;for(rt=1;rt<Zt&&ga[rt]===0;rt++);for(Ke<rt&&(Ke=rt),nt=1,Be=1;Be<=Gf;Be++)if(nt<<=1,(nt-=ga[Be])<0)return-1;if(nt>0&&(f===0||Zt!==1))return-1;for(Qf[1]=0,Be=1;Be<Gf;Be++)Qf[Be+1]=Qf[Be]+ga[Be];for(Oe=0;Oe<$;Oe++)P[m+Oe]!==0&&(_e[Qf[P[m+Oe]]++]=Oe);if(f===0?(wo=Jf=_e,ke=20):f===1?(wo=uE,Jf=cE,ke=257):(wo=hE,Jf=dE,ke=0),Vt=0,Oe=0,Be=rt,Ve=Z,Rt=Ke,Dt=0,pe=-1,wt=(ht=1<<Ke)-1,f===1&&ht>852||f===2&&ht>592)return 1;for(;;){je=Be-Dt,_e[Oe]+1<ke?(bt=0,lt=_e[Oe]):_e[Oe]>=ke?(bt=Jf[_e[Oe]-ke],lt=wo[_e[Oe]-ke]):(bt=96,lt=0),Le=1<<Be-Dt,rt=ue=1<<Rt;do V[Ve+(Vt>>Dt)+(ue-=Le)]=je<<24|bt<<16|lt|0;while(ue!==0);for(Le=1<<Be-1;Vt&Le;)Le>>=1;if(Le!==0?(Vt&=Le-1,Vt+=Le):Vt=0,Oe++,--ga[Be]==0){if(Be===Zt)break;Be=P[m+_e[Oe]]}if(Be>Ke&&(Vt&wt)!==pe){for(Dt===0&&(Dt=Ke),Ve+=rt,nt=1<<(Rt=Be-Dt);Rt+Dt<Zt&&!((nt-=ga[Rt+Dt])<=0);)Rt++,nt<<=1;if(ht+=1<<Rt,f===1&&ht>852||f===2&&ht>592)return 1;V[pe=Vt&wt]=Ke<<24|Rt<<16|Ve-Z|0}}return Vt!==0&&(V[Ve+Vt]=Be-Dt<<24|64<<16|0),re.bits=Ke,0},wv=ce.Z_FINISH,fE=ce.Z_BLOCK,qf=ce.Z_TREES,vo=ce.Z_OK,pE=ce.Z_STREAM_END,gE=ce.Z_NEED_DICT,ki=ce.Z_STREAM_ERROR,xv=ce.Z_DATA_ERROR,Av=ce.Z_MEM_ERROR,mE=ce.Z_BUF_ERROR,Ev=ce.Z_DEFLATED,Wf=16180,Xf=16190,Cs=16191,em=16192,tm=16194,Yf=16199,Zf=16200,rm=16206,ir=16209,_v=function(f){return(f>>>24&255)+(f>>>8&65280)+((65280&f)<<8)+((255&f)<<24)};function bE(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var nm,im,yo=function(f){if(!f)return 1;var P=f.state;return!P||P.strm!==f||P.mode<Wf||P.mode>16211?1:0},Cv=function(f){if(yo(f))return ki;var P=f.state;return f.total_in=f.total_out=P.total=0,f.msg="",P.wrap&&(f.adler=1&P.wrap),P.mode=Wf,P.last=0,P.havedict=0,P.flags=-1,P.dmax=32768,P.head=null,P.hold=0,P.bits=0,P.lencode=P.lendyn=new Int32Array(852),P.distcode=P.distdyn=new Int32Array(592),P.sane=1,P.back=-1,vo},Sv=function(f){if(yo(f))return ki;var P=f.state;return P.wsize=0,P.whave=0,P.wnext=0,Cv(f)},Tv=function(f,P){var m;if(yo(f))return ki;var $=f.state;return P<0?(m=0,P=-P):(m=5+(P>>4),P<48&&(P&=15)),P&&(P<8||P>15)?ki:($.window!==null&&$.wbits!==P&&($.window=null),$.wrap=m,$.wbits=P,Sv(f))},kv=function(f,P){if(!f)return ki;var m=new bE;f.state=m,m.strm=f,m.window=null,m.mode=Wf;var $=Tv(f,P);return $!==vo&&(f.state=null),$},Dv=!0,vE=function(f){if(Dv){nm=new Int32Array(512),im=new Int32Array(32);for(var P=0;P<144;)f.lens[P++]=8;for(;P<256;)f.lens[P++]=9;for(;P<280;)f.lens[P++]=7;for(;P<288;)f.lens[P++]=8;for($c(1,f.lens,0,288,nm,0,f.work,{bits:9}),P=0;P<32;)f.lens[P++]=5;$c(2,f.lens,0,32,im,0,f.work,{bits:5}),Dv=!1}f.lencode=nm,f.lenbits=9,f.distcode=im,f.distbits=5},Pv=function(f,P,m,$){var V,Z=f.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new Uint8Array(Z.wsize)),$>=Z.wsize?(Z.window.set(P.subarray(m-Z.wsize,m),0),Z.wnext=0,Z.whave=Z.wsize):((V=Z.wsize-Z.wnext)>$&&(V=$),Z.window.set(P.subarray(m-$,m-$+V),Z.wnext),($-=V)?(Z.window.set(P.subarray(m-$,m),0),Z.wnext=$,Z.whave=Z.wsize):(Z.wnext+=V,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=V))),0},Ss={inflateReset:Sv,inflateReset2:Tv,inflateResetKeep:Cv,inflateInit:function(f){return kv(f,15)},inflateInit2:kv,inflate:function(f,P){var m,$,V,Z,_e,re,Le,ue,pe,wt,Ve,ke,je,bt,lt,Et,Be,Oe,rt,Zt,Ke,Rt,Dt,nt,ht=0,Vt=new Uint8Array(4),wo=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(yo(f)||!f.output||!f.input&&f.avail_in!==0)return ki;(m=f.state).mode===Cs&&(m.mode=em),_e=f.next_out,V=f.output,Le=f.avail_out,Z=f.next_in,$=f.input,re=f.avail_in,ue=m.hold,pe=m.bits,wt=re,Ve=Le,Rt=vo;e:for(;;)switch(m.mode){case Wf:if(m.wrap===0){m.mode=em;break}for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(2&m.wrap&&ue===35615){m.wbits===0&&(m.wbits=15),m.check=0,Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0),ue=0,pe=0,m.mode=16181;break}if(m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&ue)<<8)+(ue>>8))%31){f.msg="incorrect header check",m.mode=ir;break}if((15&ue)!==Ev){f.msg="unknown compression method",m.mode=ir;break}if(pe-=4,Ke=8+(15&(ue>>>=4)),m.wbits===0&&(m.wbits=Ke),Ke>15||Ke>m.wbits){f.msg="invalid window size",m.mode=ir;break}m.dmax=1<<m.wbits,m.flags=0,f.adler=m.check=1,m.mode=512&ue?16189:Cs,ue=0,pe=0;break;case 16181:for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(m.flags=ue,(255&m.flags)!==Ev){f.msg="unknown compression method",m.mode=ir;break}if(57344&m.flags){f.msg="unknown header flags set",m.mode=ir;break}m.head&&(m.head.text=ue>>8&1),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0)),ue=0,pe=0,m.mode=16182;case 16182:for(;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.head&&(m.head.time=ue),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,Vt[2]=ue>>>16&255,Vt[3]=ue>>>24&255,m.check=le(m.check,Vt,4,0)),ue=0,pe=0,m.mode=16183;case 16183:for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.head&&(m.head.xflags=255&ue,m.head.os=ue>>8),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0)),ue=0,pe=0,m.mode=16184;case 16184:if(1024&m.flags){for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.length=ue,m.head&&(m.head.extra_len=ue),512&m.flags&&4&m.wrap&&(Vt[0]=255&ue,Vt[1]=ue>>>8&255,m.check=le(m.check,Vt,2,0)),ue=0,pe=0}else m.head&&(m.head.extra=null);m.mode=16185;case 16185:if(1024&m.flags&&((ke=m.length)>re&&(ke=re),ke&&(m.head&&(Ke=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Uint8Array(m.head.extra_len)),m.head.extra.set($.subarray(Z,Z+ke),Ke)),512&m.flags&&4&m.wrap&&(m.check=le(m.check,$,ke,Z)),re-=ke,Z+=ke,m.length-=ke),m.length))break e;m.length=0,m.mode=16186;case 16186:if(2048&m.flags){if(re===0)break e;ke=0;do Ke=$[Z+ke++],m.head&&Ke&&m.length<65536&&(m.head.name+=String.fromCharCode(Ke));while(Ke&&ke<re);if(512&m.flags&&4&m.wrap&&(m.check=le(m.check,$,ke,Z)),re-=ke,Z+=ke,Ke)break e}else m.head&&(m.head.name=null);m.length=0,m.mode=16187;case 16187:if(4096&m.flags){if(re===0)break e;ke=0;do Ke=$[Z+ke++],m.head&&Ke&&m.length<65536&&(m.head.comment+=String.fromCharCode(Ke));while(Ke&&ke<re);if(512&m.flags&&4&m.wrap&&(m.check=le(m.check,$,ke,Z)),re-=ke,Z+=ke,Ke)break e}else m.head&&(m.head.comment=null);m.mode=16188;case 16188:if(512&m.flags){for(;pe<16;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(4&m.wrap&&ue!==(65535&m.check)){f.msg="header crc mismatch",m.mode=ir;break}ue=0,pe=0}m.head&&(m.head.hcrc=m.flags>>9&1,m.head.done=!0),f.adler=m.check=0,m.mode=Cs;break;case 16189:for(;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}f.adler=m.check=_v(ue),ue=0,pe=0,m.mode=Xf;case Xf:if(m.havedict===0)return f.next_out=_e,f.avail_out=Le,f.next_in=Z,f.avail_in=re,m.hold=ue,m.bits=pe,gE;f.adler=m.check=1,m.mode=Cs;case Cs:if(P===fE||P===qf)break e;case em:if(m.last){ue>>>=7&pe,pe-=7&pe,m.mode=rm;break}for(;pe<3;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}switch(m.last=1&ue,pe-=1,3&(ue>>>=1)){case 0:m.mode=16193;break;case 1:if(vE(m),m.mode=Yf,P===qf){ue>>>=2,pe-=2;break e}break;case 2:m.mode=16196;break;case 3:f.msg="invalid block type",m.mode=ir}ue>>>=2,pe-=2;break;case 16193:for(ue>>>=7&pe,pe-=7&pe;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if((65535&ue)!=(ue>>>16^65535)){f.msg="invalid stored block lengths",m.mode=ir;break}if(m.length=65535&ue,ue=0,pe=0,m.mode=tm,P===qf)break e;case tm:m.mode=16195;case 16195:if(ke=m.length){if(ke>re&&(ke=re),ke>Le&&(ke=Le),ke===0)break e;V.set($.subarray(Z,Z+ke),_e),re-=ke,Z+=ke,Le-=ke,_e+=ke,m.length-=ke;break}m.mode=Cs;break;case 16196:for(;pe<14;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(m.nlen=257+(31&ue),ue>>>=5,pe-=5,m.ndist=1+(31&ue),ue>>>=5,pe-=5,m.ncode=4+(15&ue),ue>>>=4,pe-=4,m.nlen>286||m.ndist>30){f.msg="too many length or distance symbols",m.mode=ir;break}m.have=0,m.mode=16197;case 16197:for(;m.have<m.ncode;){for(;pe<3;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.lens[wo[m.have++]]=7&ue,ue>>>=3,pe-=3}for(;m.have<19;)m.lens[wo[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,Dt={bits:m.lenbits},Rt=$c(0,m.lens,0,19,m.lencode,0,m.work,Dt),m.lenbits=Dt.bits,Rt){f.msg="invalid code lengths set",m.mode=ir;break}m.have=0,m.mode=16198;case 16198:for(;m.have<m.nlen+m.ndist;){for(;Et=(ht=m.lencode[ue&(1<<m.lenbits)-1])>>>16&255,Be=65535&ht,!((lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(Be<16)ue>>>=lt,pe-=lt,m.lens[m.have++]=Be;else{if(Be===16){for(nt=lt+2;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(ue>>>=lt,pe-=lt,m.have===0){f.msg="invalid bit length repeat",m.mode=ir;break}Ke=m.lens[m.have-1],ke=3+(3&ue),ue>>>=2,pe-=2}else if(Be===17){for(nt=lt+3;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}pe-=lt,Ke=0,ke=3+(7&(ue>>>=lt)),ue>>>=3,pe-=3}else{for(nt=lt+7;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}pe-=lt,Ke=0,ke=11+(127&(ue>>>=lt)),ue>>>=7,pe-=7}if(m.have+ke>m.nlen+m.ndist){f.msg="invalid bit length repeat",m.mode=ir;break}for(;ke--;)m.lens[m.have++]=Ke}}if(m.mode===ir)break;if(m.lens[256]===0){f.msg="invalid code -- missing end-of-block",m.mode=ir;break}if(m.lenbits=9,Dt={bits:m.lenbits},Rt=$c(1,m.lens,0,m.nlen,m.lencode,0,m.work,Dt),m.lenbits=Dt.bits,Rt){f.msg="invalid literal/lengths set",m.mode=ir;break}if(m.distbits=6,m.distcode=m.distdyn,Dt={bits:m.distbits},Rt=$c(2,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,Dt),m.distbits=Dt.bits,Rt){f.msg="invalid distances set",m.mode=ir;break}if(m.mode=Yf,P===qf)break e;case Yf:m.mode=Zf;case Zf:if(re>=6&&Le>=258){f.next_out=_e,f.avail_out=Le,f.next_in=Z,f.avail_in=re,m.hold=ue,m.bits=pe,lE(f,Ve),_e=f.next_out,V=f.output,Le=f.avail_out,Z=f.next_in,$=f.input,re=f.avail_in,ue=m.hold,pe=m.bits,m.mode===Cs&&(m.back=-1);break}for(m.back=0;Et=(ht=m.lencode[ue&(1<<m.lenbits)-1])>>>16&255,Be=65535&ht,!((lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(Et&&!(240&Et)){for(Oe=lt,rt=Et,Zt=Be;Et=(ht=m.lencode[Zt+((ue&(1<<Oe+rt)-1)>>Oe)])>>>16&255,Be=65535&ht,!(Oe+(lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}ue>>>=Oe,pe-=Oe,m.back+=Oe}if(ue>>>=lt,pe-=lt,m.back+=lt,m.length=Be,Et===0){m.mode=16205;break}if(32&Et){m.back=-1,m.mode=Cs;break}if(64&Et){f.msg="invalid literal/length code",m.mode=ir;break}m.extra=15&Et,m.mode=16201;case 16201:if(m.extra){for(nt=m.extra;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.length+=ue&(1<<m.extra)-1,ue>>>=m.extra,pe-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=16202;case 16202:for(;Et=(ht=m.distcode[ue&(1<<m.distbits)-1])>>>16&255,Be=65535&ht,!((lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(!(240&Et)){for(Oe=lt,rt=Et,Zt=Be;Et=(ht=m.distcode[Zt+((ue&(1<<Oe+rt)-1)>>Oe)])>>>16&255,Be=65535&ht,!(Oe+(lt=ht>>>24)<=pe);){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}ue>>>=Oe,pe-=Oe,m.back+=Oe}if(ue>>>=lt,pe-=lt,m.back+=lt,64&Et){f.msg="invalid distance code",m.mode=ir;break}m.offset=Be,m.extra=15&Et,m.mode=16203;case 16203:if(m.extra){for(nt=m.extra;pe<nt;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}m.offset+=ue&(1<<m.extra)-1,ue>>>=m.extra,pe-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){f.msg="invalid distance too far back",m.mode=ir;break}m.mode=16204;case 16204:if(Le===0)break e;if(ke=Ve-Le,m.offset>ke){if((ke=m.offset-ke)>m.whave&&m.sane){f.msg="invalid distance too far back",m.mode=ir;break}ke>m.wnext?(ke-=m.wnext,je=m.wsize-ke):je=m.wnext-ke,ke>m.length&&(ke=m.length),bt=m.window}else bt=V,je=_e-m.offset,ke=m.length;ke>Le&&(ke=Le),Le-=ke,m.length-=ke;do V[_e++]=bt[je++];while(--ke);m.length===0&&(m.mode=Zf);break;case 16205:if(Le===0)break e;V[_e++]=m.length,Le--,m.mode=Zf;break;case rm:if(m.wrap){for(;pe<32;){if(re===0)break e;re--,ue|=$[Z++]<<pe,pe+=8}if(Ve-=Le,f.total_out+=Ve,m.total+=Ve,4&m.wrap&&Ve&&(f.adler=m.check=m.flags?le(m.check,V,Ve,_e-Ve):H(m.check,V,Ve,_e-Ve)),Ve=Le,4&m.wrap&&(m.flags?ue:_v(ue))!==m.check){f.msg="incorrect data check",m.mode=ir;break}ue=0,pe=0}m.mode=16207;case 16207:if(m.wrap&&m.flags){for(;pe<32;){if(re===0)break e;re--,ue+=$[Z++]<<pe,pe+=8}if(4&m.wrap&&ue!==(4294967295&m.total)){f.msg="incorrect length check",m.mode=ir;break}ue=0,pe=0}m.mode=16208;case 16208:Rt=pE;break e;case ir:Rt=xv;break e;case 16210:return Av;default:return ki}return f.next_out=_e,f.avail_out=Le,f.next_in=Z,f.avail_in=re,m.hold=ue,m.bits=pe,(m.wsize||Ve!==f.avail_out&&m.mode<ir&&(m.mode<rm||P!==wv))&&Pv(f,f.output,f.next_out,Ve-f.avail_out),wt-=f.avail_in,Ve-=f.avail_out,f.total_in+=wt,f.total_out+=Ve,m.total+=Ve,4&m.wrap&&Ve&&(f.adler=m.check=m.flags?le(m.check,V,Ve,f.next_out-Ve):H(m.check,V,Ve,f.next_out-Ve)),f.data_type=m.bits+(m.last?64:0)+(m.mode===Cs?128:0)+(m.mode===Yf||m.mode===tm?256:0),(wt===0&&Ve===0||P===wv)&&Rt===vo&&(Rt=mE),Rt},inflateEnd:function(f){if(yo(f))return ki;var P=f.state;return P.window&&(P.window=null),f.state=null,vo},inflateGetHeader:function(f,P){if(yo(f))return ki;var m=f.state;return 2&m.wrap?(m.head=P,P.done=!1,vo):ki},inflateSetDictionary:function(f,P){var m,$=P.length;return yo(f)||(m=f.state).wrap!==0&&m.mode!==Xf?ki:m.mode===Xf&&H(1,P,$,0)!==m.check?xv:Pv(f,P,$,$)?(m.mode=16210,Av):(m.havedict=1,vo)},inflateInfo:"pako inflate (from Nodeca project)"},yE=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Rv=Object.prototype.toString,wE=ce.Z_NO_FLUSH,xE=ce.Z_FINISH,Vc=ce.Z_OK,sm=ce.Z_STREAM_END,am=ce.Z_NEED_DICT,AE=ce.Z_STREAM_ERROR,Iv=ce.Z_DATA_ERROR,EE=ce.Z_MEM_ERROR;function Gc(f){this.options=At({chunkSize:65536,windowBits:15,to:""},f||{});var P=this.options;P.raw&&P.windowBits>=0&&P.windowBits<16&&(P.windowBits=-P.windowBits,P.windowBits===0&&(P.windowBits=-15)),!(P.windowBits>=0&&P.windowBits<16)||f&&f.windowBits||(P.windowBits+=32),P.windowBits>15&&P.windowBits<48&&!(15&P.windowBits)&&(P.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xr,this.strm.avail_out=0;var m=Ss.inflateInit2(this.strm,P.windowBits);if(m!==Vc)throw new Error(oe[m]);if(this.header=new yE,Ss.inflateGetHeader(this.strm,this.header),P.dictionary&&(typeof P.dictionary=="string"?P.dictionary=an(P.dictionary):Rv.call(P.dictionary)==="[object ArrayBuffer]"&&(P.dictionary=new Uint8Array(P.dictionary)),P.raw&&(m=Ss.inflateSetDictionary(this.strm,P.dictionary))!==Vc))throw new Error(oe[m])}function om(f,P){var m=new Gc(P);if(m.push(f),m.err)throw m.msg||oe[m.err];return m.result}Gc.prototype.push=function(f,P){var m,$,V,Z=this.strm,_e=this.options.chunkSize,re=this.options.dictionary;if(this.ended)return!1;for($=P===~~P?P:P===!0?xE:wE,Rv.call(f)==="[object ArrayBuffer]"?Z.input=new Uint8Array(f):Z.input=f,Z.next_in=0,Z.avail_in=Z.input.length;;){for(Z.avail_out===0&&(Z.output=new Uint8Array(_e),Z.next_out=0,Z.avail_out=_e),(m=Ss.inflate(Z,$))===am&&re&&((m=Ss.inflateSetDictionary(Z,re))===Vc?m=Ss.inflate(Z,$):m===Iv&&(m=am));Z.avail_in>0&&m===sm&&Z.state.wrap>0&&f[Z.next_in]!==0;)Ss.inflateReset(Z),m=Ss.inflate(Z,$);switch(m){case AE:case Iv:case am:case EE:return this.onEnd(m),this.ended=!0,!1}if(V=Z.avail_out,Z.next_out&&(Z.avail_out===0||m===sm))if(this.options.to==="string"){var Le=_s(Z.output,Z.next_out),ue=Z.next_out-Le,pe=pa(Z.output,Le);Z.next_out=ue,Z.avail_out=_e-ue,ue&&Z.output.set(Z.output.subarray(Le,Le+ue),0),this.onData(pe)}else this.onData(Z.output.length===Z.next_out?Z.output:Z.output.subarray(0,Z.next_out));if(m!==Vc||V!==0){if(m===sm)return m=Ss.inflateEnd(this.strm),this.onEnd(m),this.ended=!0,!0;if(Z.avail_in===0)break}}return!0},Gc.prototype.onData=function(f){this.chunks.push(f)},Gc.prototype.onEnd=function(f){f===Vc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=yt(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg};var Kf={Inflate:Gc,inflate:om,inflateRaw:function(f,P){return(P=P||{}).raw=!0,om(f,P)},ungzip:om},Nv=$f.Deflate,Mv=$f.deflate,Lv=$f.deflateRaw,Ov=$f.gzip,Fv=Kf.Inflate,Bv=Kf.inflate,zv=Kf.inflateRaw,jv=Kf.ungzip,Uv=ce,_E={Deflate:Nv,deflate:Mv,deflateRaw:Lv,gzip:Ov,Inflate:Fv,inflate:Bv,inflateRaw:zv,ungzip:jv,constants:Uv};t.Deflate=Nv,t.Inflate=Fv,t.constants=Uv,t.default=_E,t.deflate=Mv,t.deflateRaw=Lv,t.gzip=Ov,t.inflate=Bv,t.inflateRaw=zv,t.ungzip=jv,Object.defineProperty(t,"__esModule",{value:!0})})})(Ab,Ab.exports);var $P=Ab.exports,EA=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",_A=$P;jc.uncompressInputType=EA?"uint8array":"array";jc.compressInputType=EA?"uint8array":"array";jc.magic="\b\0";jc.compress=function(i,e){return _A.deflateRaw(i,{level:e.level||-1})};jc.uncompress=function(i){return _A.inflateRaw(i)};zf.STORE={magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:null,uncompressInputType:null};zf.DEFLATE=jc;var ov={exports:{}};ov.exports=function(i,e){return typeof i=="number"?Buffer.alloc(i):Buffer.from(i,e)};ov.exports.test=function(i){return Buffer.isBuffer(i)};var lv=ov.exports;(function(i){function e(h){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},e(h)}var t=pn,r=zf,n=lv;i.string2binary=function(h){for(var d="",p=0;p<h.length;p++)d+=String.fromCharCode(h.charCodeAt(p)&255);return d},i.arrayBuffer2Blob=function(h,d){i.checkSupport("blob"),d=d||"application/zip";try{return new Blob([h],{type:d})}catch{try{var p=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,g=new p;return g.append(h),g.getBlob(d)}catch{throw new Error("Bug : can't construct the Blob.")}}};function s(h){return h}function a(h,d){for(var p=0;p<h.length;++p)d[p]=h.charCodeAt(p)&255;return d}function o(h){var d=65536,p=[],g=h.length,y=i.getTypeOf(h),b=0,w=!0;try{switch(y){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,n(0));break}}catch{w=!1}if(!w){for(var v="",A=0;A<h.length;A++)v+=String.fromCharCode(h[A]);return v}for(;b<g&&d>1;)try{y==="array"||y==="nodebuffer"?p.push(String.fromCharCode.apply(null,h.slice(b,Math.min(b+d,g)))):p.push(String.fromCharCode.apply(null,h.subarray(b,Math.min(b+d,g)))),b+=d}catch{d=Math.floor(d/2)}return p.join("")}i.applyFromCharCode=o;function l(h,d){for(var p=0;p<h.length;p++)d[p]=h[p];return d}var c={};c.string={string:s,array:function(d){return a(d,new Array(d.length))},arraybuffer:function(d){return c.string.uint8array(d).buffer},uint8array:function(d){return a(d,new Uint8Array(d.length))},nodebuffer:function(d){return a(d,n(d.length))}},c.array={string:o,array:s,arraybuffer:function(d){return new Uint8Array(d).buffer},uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return n(d)}},c.arraybuffer={string:function(d){return o(new Uint8Array(d))},array:function(d){return l(new Uint8Array(d),new Array(d.byteLength))},arraybuffer:s,uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return n(new Uint8Array(d))}},c.uint8array={string:o,array:function(d){return l(d,new Array(d.length))},arraybuffer:function(d){return d.buffer},uint8array:s,nodebuffer:function(d){return n(d)}},c.nodebuffer={string:o,array:function(d){return l(d,new Array(d.length))},arraybuffer:function(d){return c.nodebuffer.uint8array(d).buffer},uint8array:function(d){return l(d,new Uint8Array(d.length))},nodebuffer:s},i.transformTo=function(h,d){if(d||(d=""),!h)return d;i.checkSupport(h);var p=i.getTypeOf(d),g=c[p][h](d);return g},i.getTypeOf=function(h){if(h!=null){if(typeof h=="string")return"string";var d=Object.prototype.toString.call(h);if(d==="[object Array]")return"array";if(t.nodebuffer&&n.test(h))return"nodebuffer";if(t.uint8array&&d==="[object Uint8Array]")return"uint8array";if(t.arraybuffer&&d==="[object ArrayBuffer]")return"arraybuffer";if(d==="[object Promise]")throw new Error("Cannot read data from a promise, you probably are running new PizZip(data) with a promise");if(e(h)==="object"&&typeof h.file=="function")throw new Error("Cannot read data from a pizzip instance, you probably are running new PizZip(zip) with a zipinstance");if(d==="[object Date]")throw new Error("Cannot read data from a Date, you probably are running new PizZip(data) with a date");if(e(h)==="object"&&h.crc32==null)throw new Error("Unsupported data given to new PizZip(data) (object given)")}},i.checkSupport=function(h){var d=t[h.toLowerCase()];if(!d)throw new Error(h+" is not supported by this browser")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(h){var d="",p,g;for(g=0;g<(h||"").length;g++)p=h.charCodeAt(g),d+="\\x"+(p<16?"0":"")+p.toString(16).toUpperCase();return d},i.findCompression=function(h){for(var d in r)if(r.hasOwnProperty(d)&&r[d].magic===h)return r[d];return null},i.isRegExp=function(h){return Object.prototype.toString.call(h)==="[object RegExp]"},i.extend=function(){var h={},d,p;for(d=0;d<arguments.length;d++)for(p in arguments[d])arguments[d].hasOwnProperty(p)&&typeof h[p]>"u"&&(h[p]=arguments[d][p]);return h}})(Ci);var VP=Ci,GP=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],qP=function(e,t){if(typeof e>"u"||!e.length)return 0;var r=VP.getTypeOf(e)!=="string";typeof t>"u"&&(t=0);var n=0,s=0,a=0;t^=-1;for(var o=0,l=e.length;o<l;o++)a=r?e[o]:e.charCodeAt(o),s=(t^a)&255,n=GP[s],t=t>>>8^n;return t^-1},bo={};bo.LOCAL_FILE_HEADER="PK";bo.CENTRAL_FILE_HEADER="PK";bo.CENTRAL_DIRECTORY_END="PK";bo.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";bo.ZIP64_CENTRAL_DIRECTORY_END="PK";bo.DATA_DESCRIPTOR="PK\x07\b";var Si={};Si.base64=!1;Si.binary=!1;Si.dir=!1;Si.createFolders=!1;Si.date=null;Si.compression=null;Si.compressionOptions=null;Si.comment=null;Si.unixPermissions=null;Si.dosPermissions=null;function CA(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}CA.prototype={getContent:function(){return null},getCompressedContent:function(){return null}};var SA=CA,Zg={},Eb=Ci,Dh=pn,WP=lv,Yh=new Array(256);for(var va=0;va<256;va++)Yh[va]=va>=252?6:va>=248?5:va>=240?4:va>=224?3:va>=192?2:1;Yh[254]=Yh[254]=1;function XP(i){var e,t,r,n,s,a=0,o=i.length;for(n=0;n<o;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<o&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),a+=t<128?1:t<2048?2:t<65536?3:4;for(Dh.uint8array?e=new Uint8Array(a):e=new Array(a),s=0,n=0;s<a;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<o&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e}function YP(i,e){var t;for(e=e||i.length,e>i.length&&(e=i.length),t=e-1;t>=0&&(i[t]&192)===128;)t--;return t<0||t===0?e:t+Yh[i[t]]>e?t:e}function x2(i){var e,t,r,n,s=i.length,a=new Array(s*2);for(t=0,e=0;e<s;){if(r=i[e++],r<128){a[t++]=r;continue}if(n=Yh[r],n>4){a[t++]=65533,e+=n-1;continue}for(r&=n===2?31:n===3?15:7;n>1&&e<s;)r=r<<6|i[e++]&63,n--;if(n>1){a[t++]=65533;continue}r<65536?a[t++]=r:(r-=65536,a[t++]=55296|r>>10&1023,a[t++]=56320|r&1023)}return a.length!==t&&(a.subarray?a=a.subarray(0,t):a.length=t),Eb.applyFromCharCode(a)}Zg.utf8encode=function(e){return Dh.nodebuffer?WP(e,"utf-8"):XP(e)};Zg.utf8decode=function(e){if(Dh.nodebuffer)return Eb.transformTo("nodebuffer",e).toString("utf-8");e=Eb.transformTo(Dh.uint8array?"uint8array":"array",e);for(var t=[],r=e.length,n=65536,s=0;s<r;){var a=YP(e,Math.min(s+n,r));Dh.uint8array?t.push(x2(e.subarray(s,a))):t.push(x2(e.slice(s,a))),s=a}return t.join("")};var ZP=Ci;function TA(){this.data=[]}TA.prototype={append:function(e){e=ZP.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}};var KP=TA,QP=Ci;function kA(i){this.data=new Uint8Array(i),this.index=0}kA.prototype={append:function(e){e.length!==0&&(e=QP.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}};var JP=kA;function eR(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=tR(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(c){throw c},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
58
58
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){t=t.call(i)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,s=c},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw s}}}}function tR(i,e){if(i){if(typeof i=="string")return A2(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A2(i,e):void 0}}function A2(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}var rR=pn,er=Ci,uv=qP,_b=bo,nR=Si,DA=Bf,Cb=zf,ng=SA,iR=lv,yu=Zg,sR=KP,aR=JP;function PA(i){if(i._data instanceof ng&&(i._data=i._data.getContent(),i.options.binary=!0,i.options.base64=!1,er.getTypeOf(i._data)==="uint8array")){var e=i._data;i._data=new Uint8Array(e.length),e.length!==0&&i._data.set(e,0)}return i._data}function Sb(i){var e=PA(i),t=er.getTypeOf(e);return t==="string"?!i.options.binary&&rR.nodebuffer?iR(e,"utf-8"):i.asBinary():e}var Tb={load:function(){throw new Error("Load method is not defined. Is the file pizzip-load.js included ?")},filter:function(e){var t=[],r,n,s,a;for(r in this.files)this.files.hasOwnProperty(r)&&(s=this.files[r],a=new cv(s.name,s._data,er.extend(s.options)),n=r.slice(this.root.length,r.length),r.slice(0,this.root.length)===this.root&&e(n,a)&&t.push(a));return t},file:function(e,t,r){if(arguments.length===1){if(er.isRegExp(e)){var n=e;return this.filter(function(s,a){return!a.dir&&n.test(s)})}return this.filter(function(s,a){return!a.dir&&s===e})[0]||null}return e=this.root+e,RA.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(er.isRegExp(e))return this.filter(function(s,a){return a.dir&&e.test(s)});var t=this.root+e,r=NA.call(this,t),n=this.shallowClone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(s,a){return a.name.slice(0,e.length)===e}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){e=er.extend(e||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:yu.utf8encode}),er.checkSupport(e.type),(e.platform==="darwin"||e.platform==="freebsd"||e.platform==="linux"||e.platform==="sunos")&&(e.platform="UNIX"),e.platform==="win32"&&(e.platform="DOS");var t=[],r=er.transformTo("string",e.encodeFileName(e.comment||this.comment||"")),n=0,s=0,a,o,l=[];e.fileOrder instanceof Array&&(l=e.fileOrder);for(var c in this.files)l.indexOf(c)===-1&&l.push(c);typeof e.fileOrder=="function"&&(l=e.fileOrder(this.files));var h=eR(l),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;if(this.files.hasOwnProperty(p)){var g=this.files[p],y=g.options.compression||e.compression.toUpperCase(),b=Cb[y];if(!b)throw new Error(y+" is not a valid compression method !");var w=g.options.compressionOptions||e.compressionOptions||{},v=uR.call(this,g,b,w),A=dR.call(this,p,g,v,n,e.platform,e.encodeFileName);n+=A.fileRecord.length+v.compressedSize,s+=A.dirRecord.length,t.push(A)}}}catch(I){h.e(I)}finally{h.f()}var E="";E=_b.CENTRAL_DIRECTORY_END+"\0\0\0\0"+gr(t.length,2)+gr(t.length,2)+gr(s,4)+gr(n,4)+gr(r.length,2)+r;var _=e.type.toLowerCase();for(_==="uint8array"||_==="arraybuffer"||_==="blob"||_==="nodebuffer"?a=new aR(n+s+E.length):a=new sR(n+s+E.length),o=0;o<t.length;o++)a.append(t[o].fileRecord),a.append(t[o].compressedObject.compressedContent);for(o=0;o<t.length;o++)a.append(t[o].dirRecord);a.append(E);var C=a.finalize();switch(e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return er.transformTo(e.type.toLowerCase(),C);case"blob":return er.arrayBuffer2Blob(er.transformTo("arraybuffer",C),e.mimeType);case"base64":return e.base64?DA.encode(C):C;default:return C}},crc32:function(e,t){return uv(e,t)},utf8encode:function(e){return er.transformTo("string",yu.utf8encode(e))},utf8decode:function(e){return yu.utf8decode(e)}};function E2(i){var e=PA(this);return e===null||typeof e>"u"?"":(this.options.base64&&(e=DA.decode(e)),i&&this.options.binary?e=Tb.utf8decode(e):e=er.transformTo("string",e),!i&&!this.options.binary&&(e=er.transformTo("string",Tb.utf8encode(e))),e)}function cv(i,e,t){this.name=i,this.dir=t.dir,this.date=t.date,this.comment=t.comment,this.unixPermissions=t.unixPermissions,this.dosPermissions=t.dosPermissions,this._data=e,this.options=t,this._initialMetadata={dir:t.dir,date:t.date}}cv.prototype={asText:function(){return E2.call(this,!0)},asBinary:function(){return E2.call(this,!1)},asNodeBuffer:function(){var e=Sb(this);return er.transformTo("nodebuffer",e)},asUint8Array:function(){var e=Sb(this);return er.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};function gr(i,e){var t="",r;for(r=0;r<e;r++)t+=String.fromCharCode(i&255),i>>>=8;return t}function oR(i){return i=i||{},i.base64===!0&&(i.binary===null||i.binary===void 0)&&(i.binary=!0),i=er.extend(i,nR),i.date=i.date||new Date,i.compression!==null&&(i.compression=i.compression.toUpperCase()),i}function RA(i,e,t){var r=er.getTypeOf(e),n;if(t=oR(t),typeof t.unixPermissions=="string"&&(t.unixPermissions=parseInt(t.unixPermissions,8)),t.unixPermissions&&t.unixPermissions&16384&&(t.dir=!0),t.dosPermissions&&t.dosPermissions&16&&(t.dir=!0),t.dir&&(i=IA(i)),t.createFolders&&(n=lR(i))&&NA.call(this,n,!0),t.dir||e===null||typeof e>"u")t.base64=!1,t.binary=!1,e=null,r=null;else if(r==="string")t.binary&&!t.base64&&t.optimizedBinaryString!==!0&&(e=er.string2binary(e));else{if(t.base64=!1,t.binary=!0,!r&&!(e instanceof ng))throw new Error("The data of '"+i+"' is in an unsupported format !");r==="arraybuffer"&&(e=er.transformTo("uint8array",e))}var s=new cv(i,e,t);return this.files[i]=s,s}function lR(i){i.slice(-1)==="/"&&(i=i.substring(0,i.length-1));var e=i.lastIndexOf("/");return e>0?i.substring(0,e):""}function IA(i){return i.slice(-1)!=="/"&&(i+="/"),i}function NA(i,e){return e=typeof e<"u"?e:!1,i=IA(i),this.files[i]||RA.call(this,i,null,{dir:!0,createFolders:e}),this.files[i]}function uR(i,e,t){var r=new ng,n;return i._data instanceof ng?(r.uncompressedSize=i._data.uncompressedSize,r.crc32=i._data.crc32,r.uncompressedSize===0||i.dir?(e=Cb.STORE,r.compressedContent="",r.crc32=0):i._data.compressionMethod===e.magic?r.compressedContent=i._data.getCompressedContent():(n=i._data.getContent(),r.compressedContent=e.compress(er.transformTo(e.compressInputType,n),t))):(n=Sb(i),(!n||n.length===0||i.dir)&&(e=Cb.STORE,n=""),r.uncompressedSize=n.length,r.crc32=uv(n),r.compressedContent=e.compress(er.transformTo(e.compressInputType,n),t)),r.compressedSize=r.compressedContent.length,r.compressionMethod=e.magic,r}function cR(i,e){var t=i;return i||(t=e?16893:33204),(t&65535)<<16}function hR(i){return(i||0)&63}function dR(i,e,t,r,n,s){var a=s!==yu.utf8encode,o=er.transformTo("string",s(e.name)),l=er.transformTo("string",yu.utf8encode(e.name)),c=e.comment||"",h=er.transformTo("string",s(c)),d=er.transformTo("string",yu.utf8encode(c)),p=l.length!==e.name.length,g=d.length!==c.length,y=e.options,b,w,v="",A="",E="",_,C;e._initialMetadata.dir!==e.dir?_=e.dir:_=y.dir,e._initialMetadata.date!==e.date?C=e.date:C=y.date;var I=0,k=0;_&&(I|=16),n==="UNIX"?(k=798,I|=cR(e.unixPermissions,_)):(k=20,I|=hR(e.dosPermissions)),b=C.getHours(),b<<=6,b|=C.getMinutes(),b<<=5,b|=C.getSeconds()/2,w=C.getFullYear()-1980,w<<=4,w|=C.getMonth()+1,w<<=5,w|=C.getDate(),p&&(A=gr(1,1)+gr(uv(o),4)+l,v+="up"+gr(A.length,2)+A),g&&(E=gr(1,1)+gr(this.crc32(h),4)+d,v+="uc"+gr(E.length,2)+E);var D="";D+=`
59
59
  \0`,D+=!a&&(p||g)?"\0\b":"\0\0",D+=t.compressionMethod,D+=gr(b,2),D+=gr(w,2),D+=gr(t.crc32,4),D+=gr(t.compressedSize,4),D+=gr(t.uncompressedSize,4),D+=gr(o.length,2),D+=gr(v.length,2);var R=_b.LOCAL_FILE_HEADER+D+o+v,z=_b.CENTRAL_FILE_HEADER+gr(k,2)+D+gr(h.length,2)+"\0\0\0\0"+gr(I,4)+gr(r,4)+o+v+h;return{fileRecord:R,dirRecord:z,compressedObject:t}}var MA=Tb,fR=Ci;function LA(){this.data=null,this.length=0,this.index=0,this.zero=0}LA.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,r;for(this.checkOffset(e),r=this.index+e-1;r>=this.index;r--)t=(t<<8)+this.byteAt(r);return this.index+=e,t},readString:function(e){return fR.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)}};var OA=LA,pR=OA,gR=Ci;function jf(i,e){this.data=i,e||(this.data=gR.string2binary(this.data)),this.length=this.data.length,this.index=0,this.zero=0}jf.prototype=new pR;jf.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)};jf.prototype.lastIndexOfSignature=function(i){return this.data.lastIndexOf(i)-this.zero};jf.prototype.readData=function(i){this.checkOffset(i);var e=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,e};var FA=jf,mR=OA;function Uf(i){if(i){this.data=i,this.length=this.data.length,this.index=0,this.zero=0;for(var e=0;e<this.data.length;e++)i[e]&=i[e]}}Uf.prototype=new mR;Uf.prototype.byteAt=function(i){return this.data[this.zero+i]};Uf.prototype.lastIndexOfSignature=function(i){for(var e=i.charCodeAt(0),t=i.charCodeAt(1),r=i.charCodeAt(2),n=i.charCodeAt(3),s=this.length-4;s>=0;--s)if(this.data[s]===e&&this.data[s+1]===t&&this.data[s+2]===r&&this.data[s+3]===n)return s-this.zero;return-1};Uf.prototype.readData=function(i){if(this.checkOffset(i),i===0)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,e};var BA=Uf,bR=BA;function hv(i){i&&(this.data=i,this.length=this.data.length,this.index=0,this.zero=0)}hv.prototype=new bR;hv.prototype.readData=function(i){if(this.checkOffset(i),i===0)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+i);return this.index+=i,e};var zA=hv,vR=zA;function dv(i){this.data=i,this.length=this.data.length,this.index=0,this.zero=0}dv.prototype=new vR;dv.prototype.readData=function(i){this.checkOffset(i);var e=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,e};var yR=dv,Km=FA,Pi=Ci,wR=SA,Ao=MA,xR=pn,AR=0,ER=3;function jA(i,e){this.options=i,this.loadOptions=e}jA.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},prepareCompressedContent:function(e,t,r){return function(){var n=e.index;e.setIndex(t);var s=e.readData(r);return e.setIndex(n),s}},prepareContent:function(e,t,r,n,s){return function(){var a=Pi.transformTo(n.uncompressInputType,this.getCompressedContent()),o=n.uncompress(a);if(o.length!==s)throw new Error("Bug : uncompressed data size mismatch");return o}},readLocalPart:function(e){e.skip(22),this.fileNameLength=e.readInt(2);var t=e.readInt(2);if(this.fileName=e.readData(this.fileNameLength),e.skip(t),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");var r=Pi.findCompression(this.compressionMethod);if(r===null)throw new Error("Corrupted zip : compression "+Pi.pretty(this.compressionMethod)+" unknown (inner file : "+Pi.transformTo("string",this.fileName)+")");if(this.decompressed=new wR,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(e,e.index,this.compressedSize,r),this.decompressed.getContent=this.prepareContent(e,e.index,this.compressedSize,r,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=Pi.transformTo("string",this.decompressed.getContent()),Ao.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(e){if(this.versionMadeBy=e.readInt(2),this.versionNeeded=e.readInt(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4),this.fileNameLength=e.readInt(2),this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=e.readData(this.fileNameLength),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===AR&&(this.dosPermissions=this.externalFileAttributes&63),e===ER&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=new Km(this.extraFields[1].value);this.uncompressedSize===Pi.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Pi.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Pi.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Pi.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t=e.index,r,n,s;for(this.extraFields=this.extraFields||{};e.index<t+this.extraFieldsLength;)r=e.readInt(2),n=e.readInt(2),s=e.readString(n),this.extraFields[r]={id:r,length:n,value:s}},handleUTF8:function(){var e=xR.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Ao.utf8decode(this.fileName),this.fileCommentStr=Ao.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var r=Pi.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var s=Pi.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=new Km(e.value);return t.readInt(1)!==1||Ao.crc32(this.fileName)!==t.readInt(4)?null:Ao.utf8decode(t.readString(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=new Km(e.value);return t.readInt(1)!==1||Ao.crc32(this.fileComment)!==t.readInt(4)?null:Ao.utf8decode(t.readString(e.length-5))}return null}};var _R=jA,CR=FA,SR=yR,TR=zA,kR=BA,Hn=Ci,Ri=bo,DR=_R,hp=pn;function UA(i,e){this.files=[],this.loadOptions=e,i&&this.load(i)}UA.prototype={checkSignature:function(e){var t=this.reader.readString(4);if(t!==e)throw new Error("Corrupted zip or bug : unexpected signature ("+Hn.pretty(t)+", expected "+Hn.pretty(e)+")")},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4),s=n===t;return this.reader.setIndex(r),s},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=hp.uint8array?"uint8array":"array",r=Hn.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,r,n,s;t<e;)r=this.reader.readInt(2),n=this.reader.readInt(4),s=this.reader.readString(n),this.zip64ExtensibleData[r]={id:r,length:n,value:s}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(Ri.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===Ri.CENTRAL_FILE_HEADER;)e=new DR({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(Ri.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,Ri.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ?"):new Error("Corrupted zip : can't find end of central directory")}this.reader.setIndex(e);var r=e;if(this.checkSignature(Ri.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Hn.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Hn.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Hn.MAX_VALUE_16BITS||this.centralDirRecords===Hn.MAX_VALUE_16BITS||this.centralDirSize===Hn.MAX_VALUE_32BITS||this.centralDirOffset===Hn.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(Ri.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(Ri.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Ri.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Ri.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip : can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Ri.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var s=r-n;if(s>0)this.isSignature(r,Ri.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(e){var t=Hn.getTypeOf(e);if(Hn.checkSupport(t),t==="string"&&!hp.uint8array)this.reader=new CR(e,this.loadOptions.optimizedBinaryString);else if(t==="nodebuffer")this.reader=new SR(e);else if(hp.uint8array)this.reader=new TR(Hn.transformTo("uint8array",e));else if(hp.array)this.reader=new kR(Hn.transformTo("array",e));else throw new Error("Unexpected error: unsupported type '"+t+"'")},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var PR=UA,RR=Bf,IR=Zg,NR=Ci,MR=PR,LR=function(i,e){var t,r;e=NR.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:IR.utf8decode}),e.base64&&(i=RR.decode(i));var n=new MR(i,e),s=n.files;for(t=0;t<s.length;t++)r=s[t],this.file(r.fileNameStr,r.decompressed,{binary:!0,optimizedBinaryString:!0,date:r.date,dir:r.dir,comment:r.fileCommentStr.length?r.fileCommentStr:null,unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions,createFolders:e.createFolders});return n.zipComment.length&&(this.comment=n.zipComment),this},zn={},Ln=Ci;zn.string2binary=function(i){return Ln.string2binary(i)};zn.string2Uint8Array=function(i){return Ln.transformTo("uint8array",i)};zn.uint8Array2String=function(i){return Ln.transformTo("string",i)};zn.string2Blob=function(i){var e=Ln.transformTo("arraybuffer",i);return Ln.arrayBuffer2Blob(e)};zn.arrayBuffer2Blob=function(i){return Ln.arrayBuffer2Blob(i)};zn.transformTo=function(i,e){return Ln.transformTo(i,e)};zn.getTypeOf=function(i){return Ln.getTypeOf(i)};zn.checkSupport=function(i){return Ln.checkSupport(i)};zn.MAX_VALUE_16BITS=Ln.MAX_VALUE_16BITS;zn.MAX_VALUE_32BITS=Ln.MAX_VALUE_32BITS;zn.pretty=function(i){return Ln.pretty(i)};zn.findCompression=function(i){return Ln.findCompression(i)};zn.isRegExp=function(i){return Ln.isRegExp(i)};(function(i){var e=Bf;function t(r,n){if(!(this instanceof t))return new t(r,n);this.files={},this.comment=null,this.root="",r&&this.load(r,n),this.clone=function(){var s=this,a=new t;return Object.keys(this.files).forEach(function(o){a.file(o,s.files[o].asUint8Array())}),a},this.shallowClone=function(){var s=new t;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}t.prototype=MA,t.prototype.load=LR,t.support=pn,t.defaults=Si,t.utils=zn,t.base64={encode:function(n){return e.encode(n)},decode:function(n){return e.decode(n)}},t.compressions=zf,i.exports=t,i.exports.default=t})(AA);var OR=AA.exports;const _2=_g(OR);function dp(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var HA={exports:{}};/*!
60
60
 
@@ -67,7 +67,7 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js
67
67
  JSZip uses the library pako released under the MIT license :
68
68
  https://github.com/nodeca/pako/blob/main/LICENSE
69
69
  */(function(i,e){(function(t){i.exports=t()})(function(){return function t(r,n,s){function a(c,h){if(!n[c]){if(!r[c]){var d=typeof dp=="function"&&dp;if(!h&&d)return d(c,!0);if(o)return o(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var g=n[c]={exports:{}};r[c][0].call(g.exports,function(y){var b=r[c][1][y];return a(b||y)},g,g.exports,t,r,n,s)}return n[c].exports}for(var o=typeof dp=="function"&&dp,l=0;l<s.length;l++)a(s[l]);return a}({1:[function(t,r,n){var s=t("./utils"),a=t("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(l){for(var c,h,d,p,g,y,b,w=[],v=0,A=l.length,E=A,_=s.getTypeOf(l)!=="string";v<l.length;)E=A-v,d=_?(c=l[v++],h=v<A?l[v++]:0,v<A?l[v++]:0):(c=l.charCodeAt(v++),h=v<A?l.charCodeAt(v++):0,v<A?l.charCodeAt(v++):0),p=c>>2,g=(3&c)<<4|h>>4,y=1<E?(15&h)<<2|d>>6:64,b=2<E?63&d:64,w.push(o.charAt(p)+o.charAt(g)+o.charAt(y)+o.charAt(b));return w.join("")},n.decode=function(l){var c,h,d,p,g,y,b=0,w=0,v="data:";if(l.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var A,E=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===o.charAt(64)&&E--,l.charAt(l.length-2)===o.charAt(64)&&E--,E%1!=0)throw new Error("Invalid base64 input, bad content length.");for(A=a.uint8array?new Uint8Array(0|E):new Array(0|E);b<l.length;)c=o.indexOf(l.charAt(b++))<<2|(p=o.indexOf(l.charAt(b++)))>>4,h=(15&p)<<4|(g=o.indexOf(l.charAt(b++)))>>2,d=(3&g)<<6|(y=o.indexOf(l.charAt(b++))),A[w++]=c,g!==64&&(A[w++]=h),y!==64&&(A[w++]=d);return A}},{"./support":30,"./utils":32}],2:[function(t,r,n){var s=t("./external"),a=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function c(h,d,p,g,y){this.compressedSize=h,this.uncompressedSize=d,this.crc32=p,this.compression=g,this.compressedContent=y}c.prototype={getContentWorker:function(){var h=new a(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return h.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new a(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(h,d,p){return h.pipe(new o).pipe(new l("uncompressedSize")).pipe(d.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,r,n){var s=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,r,n){var s=t("./utils"),a=function(){for(var o,l=[],c=0;c<256;c++){o=c;for(var h=0;h<8;h++)o=1&o?3988292384^o>>>1:o>>>1;l[c]=o}return l}();r.exports=function(o,l){return o!==void 0&&o.length?s.getTypeOf(o)!=="string"?function(c,h,d,p){var g=a,y=p+d;c^=-1;for(var b=p;b<y;b++)c=c>>>8^g[255&(c^h[b])];return-1^c}(0|l,o,o.length,0):function(c,h,d,p){var g=a,y=p+d;c^=-1;for(var b=p;b<y;b++)c=c>>>8^g[255&(c^h.charCodeAt(b))];return-1^c}(0|l,o,o.length,0):0}},{"./utils":32}],5:[function(t,r,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,r,n){var s=null;s=typeof Promise<"u"?Promise:t("lie"),r.exports={Promise:s}},{lie:37}],7:[function(t,r,n){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=t("pako"),o=t("./utils"),l=t("./stream/GenericWorker"),c=s?"uint8array":"array";function h(d,p){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=p,this.meta={}}n.magic="\b\0",o.inherits(h,l),h.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(c,d.data),!1)},h.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(p){d.push({data:p,meta:d.meta})}},n.compressWorker=function(d){return new h("Deflate",d)},n.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,r,n){function s(g,y){var b,w="";for(b=0;b<y;b++)w+=String.fromCharCode(255&g),g>>>=8;return w}function a(g,y,b,w,v,A){var E,_,C=g.file,I=g.compression,k=A!==c.utf8encode,D=o.transformTo("string",A(C.name)),R=o.transformTo("string",c.utf8encode(C.name)),z=C.comment,G=o.transformTo("string",A(z)),O=o.transformTo("string",c.utf8encode(z)),X=R.length!==C.name.length,S=O.length!==z.length,J="",Y="",W="",fe=C.dir,K=C.date,be={crc32:0,compressedSize:0,uncompressedSize:0};y&&!b||(be.crc32=g.crc32,be.compressedSize=g.compressedSize,be.uncompressedSize=g.uncompressedSize);var te=0;y&&(te|=8),k||!X&&!S||(te|=2048);var j=0,ie=0;fe&&(j|=16),v==="UNIX"?(ie=798,j|=function(H,se){var le=H;return H||(le=se?16893:33204),(65535&le)<<16}(C.unixPermissions,fe)):(ie=20,j|=function(H){return 63&(H||0)}(C.dosPermissions)),E=K.getUTCHours(),E<<=6,E|=K.getUTCMinutes(),E<<=5,E|=K.getUTCSeconds()/2,_=K.getUTCFullYear()-1980,_<<=4,_|=K.getUTCMonth()+1,_<<=5,_|=K.getUTCDate(),X&&(Y=s(1,1)+s(h(D),4)+R,J+="up"+s(Y.length,2)+Y),S&&(W=s(1,1)+s(h(G),4)+O,J+="uc"+s(W.length,2)+W);var ae="";return ae+=`
70
- \0`,ae+=s(te,2),ae+=I.magic,ae+=s(E,2),ae+=s(_,2),ae+=s(be.crc32,4),ae+=s(be.compressedSize,4),ae+=s(be.uncompressedSize,4),ae+=s(D.length,2),ae+=s(J.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ae+D+J,dirRecord:d.CENTRAL_FILE_HEADER+s(ie,2)+ae+s(G.length,2)+"\0\0\0\0"+s(j,4)+s(w,4)+D+J+G}}var o=t("../utils"),l=t("../stream/GenericWorker"),c=t("../utf8"),h=t("../crc32"),d=t("../signature");function p(g,y,b,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=b,this.encodeFileName=w,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(p,l),p.prototype.push=function(g){var y=g.meta.percent||0,b=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,l.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:b?(y+100*(b-w-1))/b:100}}))},p.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var y=this.streamFiles&&!g.file.dir;if(y){var b=a(g,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:b.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(g){this.accumulate=!1;var y=this.streamFiles&&!g.file.dir,b=a(g,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(b.dirRecord),y)this.push({data:function(w){return d.DATA_DESCRIPTOR+s(w.crc32,4)+s(w.compressedSize,4)+s(w.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:b.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var g=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var b=this.bytesWritten-g,w=function(v,A,E,_,C){var I=o.transformTo("string",C(_));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(v,2)+s(v,2)+s(A,4)+s(E,4)+s(I.length,2)+I}(this.dirRecords.length,b,g,this.zipComment,this.encodeFileName);this.push({data:w,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(g){this._sources.push(g);var y=this;return g.on("data",function(b){y.processChunk(b)}),g.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),g.on("error",function(b){y.error(b)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(g){var y=this._sources;if(!l.prototype.error.call(this,g))return!1;for(var b=0;b<y.length;b++)try{y[b].error(g)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var g=this._sources,y=0;y<g.length;y++)g[y].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,r,n){var s=t("../compressions"),a=t("./ZipFileWorker");n.generateWorker=function(o,l,c){var h=new a(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{o.forEach(function(p,g){d++;var y=function(A,E){var _=A||E,C=s[_];if(!C)throw new Error(_+" is not a valid compression method !");return C}(g.options.compression,l.compression),b=g.options.compressionOptions||l.compressionOptions||{},w=g.dir,v=g.date;g._compressWorker(y,b).withStreamInfo("file",{name:p,dir:w,date:v,comment:g.comment||"",unixPermissions:g.unixPermissions,dosPermissions:g.dosPermissions}).pipe(h)}),h.entriesCount=d}catch(p){h.error(p)}return h}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,r,n){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var a=new s;for(var o in this)typeof this[o]!="function"&&(a[o]=this[o]);return a}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(a,o){return new s().loadAsync(a,o)},s.external=t("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,r,n){var s=t("./utils"),a=t("./external"),o=t("./utf8"),l=t("./zipEntries"),c=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function d(p){return new a.Promise(function(g,y){var b=p.decompressed.getContentWorker().pipe(new c);b.on("error",function(w){y(w)}).on("end",function(){b.streamInfo.crc32!==p.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}r.exports=function(p,g){var y=this;return g=s.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),h.isNode&&h.isStream(p)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,g.optimizedBinaryString,g.base64).then(function(b){var w=new l(g);return w.load(b),w}).then(function(b){var w=[a.Promise.resolve(b)],v=b.files;if(g.checkCRC32)for(var A=0;A<v.length;A++)w.push(d(v[A]));return a.Promise.all(w)}).then(function(b){for(var w=b.shift(),v=w.files,A=0;A<v.length;A++){var E=v[A],_=E.fileNameStr,C=s.resolve(E.fileNameStr);y.file(C,E.decompressed,{binary:!0,optimizedBinaryString:!0,date:E.date,dir:E.dir,comment:E.fileCommentStr.length?E.fileCommentStr:null,unixPermissions:E.unixPermissions,dosPermissions:E.dosPermissions,createFolders:g.createFolders}),E.dir||(y.file(C).unsafeOriginalName=_)}return w.zipComment.length&&(y.comment=w.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,r,n){var s=t("../utils"),a=t("../stream/GenericWorker");function o(l,c){a.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}s.inherits(o,a),o.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(h){c.push({data:h,meta:{percent:0}})}).on("error",function(h){c.isPaused?this.generatedError=h:c.error(h)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},o.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,r,n){var s=t("readable-stream").Readable;function a(o,l,c){s.call(this,l),this._helper=o;var h=this;o.on("data",function(d,p){h.push(d)||h._helper.pause(),c&&c(p)}).on("error",function(d){h.emit("error",d)}).on("end",function(){h.push(null)})}t("../utils").inherits(a,s),a.prototype._read=function(){this._helper.resume()},r.exports=a},{"../utils":32,"readable-stream":16}],14:[function(t,r,n){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,a);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,a)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var a=new Buffer(s);return a.fill(0),a},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(t,r,n){function s(C,I,k){var D,R=o.getTypeOf(I),z=o.extend(k||{},h);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(C=v(C)),z.createFolders&&(D=w(C))&&A.call(this,D,!0);var G=R==="string"&&z.binary===!1&&z.base64===!1;k&&k.binary!==void 0||(z.binary=!G),(I instanceof d&&I.uncompressedSize===0||z.dir||!I||I.length===0)&&(z.base64=!1,z.binary=!0,I="",z.compression="STORE",R="string");var O=null;O=I instanceof d||I instanceof l?I:y.isNode&&y.isStream(I)?new b(C,I):o.prepareContent(C,I,z.binary,z.optimizedBinaryString,z.base64);var X=new p(C,O,z);this.files[C]=X}var a=t("./utf8"),o=t("./utils"),l=t("./stream/GenericWorker"),c=t("./stream/StreamHelper"),h=t("./defaults"),d=t("./compressedObject"),p=t("./zipObject"),g=t("./generate"),y=t("./nodejsUtils"),b=t("./nodejs/NodejsStreamInputAdapter"),w=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var I=C.lastIndexOf("/");return 0<I?C.substring(0,I):""},v=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},A=function(C,I){return I=I!==void 0?I:h.createFolders,C=v(C),this.files[C]||s.call(this,C,null,{dir:!0,createFolders:I}),this.files[C]};function E(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var I,k,D;for(I in this.files)D=this.files[I],(k=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&C(k,D)},filter:function(C){var I=[];return this.forEach(function(k,D){C(k,D)&&I.push(D)}),I},file:function(C,I,k){if(arguments.length!==1)return C=this.root+C,s.call(this,C,I,k),this;if(E(C)){var D=C;return this.filter(function(z,G){return!G.dir&&D.test(z)})}var R=this.files[this.root+C];return R&&!R.dir?R:null},folder:function(C){if(!C)return this;if(E(C))return this.filter(function(R,z){return z.dir&&C.test(R)});var I=this.root+C,k=A.call(this,I),D=this.clone();return D.root=k.name,D},remove:function(C){C=this.root+C;var I=this.files[C];if(I||(C.slice(-1)!=="/"&&(C+="/"),I=this.files[C]),I&&!I.dir)delete this.files[C];else for(var k=this.filter(function(R,z){return z.name.slice(0,C.length)===C}),D=0;D<k.length;D++)delete this.files[k[D].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var I,k={};try{if((k=o.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=k.type.toLowerCase(),k.compression=k.compression.toUpperCase(),k.type==="binarystring"&&(k.type="string"),!k.type)throw new Error("No output type specified.");o.checkSupport(k.type),k.platform!=="darwin"&&k.platform!=="freebsd"&&k.platform!=="linux"&&k.platform!=="sunos"||(k.platform="UNIX"),k.platform==="win32"&&(k.platform="DOS");var D=k.comment||this.comment||"";I=g.generateWorker(this,k,D)}catch(R){(I=new l("error")).error(R)}return new c(I,k.type||"string",k.mimeType)},generateAsync:function(C,I){return this.generateInternalStream(C).accumulate(I)},generateNodeStream:function(C,I){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(I)}};r.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,r,n){r.exports=t("stream")},{stream:void 0}],17:[function(t,r,n){var s=t("./DataReader");function a(o){s.call(this,o);for(var l=0;l<this.data.length;l++)o[l]=255&o[l]}t("../utils").inherits(a,s),a.prototype.byteAt=function(o){return this.data[this.zero+o]},a.prototype.lastIndexOfSignature=function(o){for(var l=o.charCodeAt(0),c=o.charCodeAt(1),h=o.charCodeAt(2),d=o.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===h&&this.data[p+3]===d)return p-this.zero;return-1},a.prototype.readAndCheckSignature=function(o){var l=o.charCodeAt(0),c=o.charCodeAt(1),h=o.charCodeAt(2),d=o.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&h===p[2]&&d===p[3]},a.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./DataReader":18}],18:[function(t,r,n){var s=t("../utils");function a(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var l,c=0;for(this.checkOffset(o),l=this.index+o-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=o,c},readString:function(o){return s.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},r.exports=a},{"../utils":32}],19:[function(t,r,n){var s=t("./Uint8ArrayReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,r,n){var s=t("./DataReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},a.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},a.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},a.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./DataReader":18}],21:[function(t,r,n){var s=t("./ArrayReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(t,r,n){var s=t("../utils"),a=t("../support"),o=t("./ArrayReader"),l=t("./StringReader"),c=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");r.exports=function(d){var p=s.getTypeOf(d);return s.checkSupport(p),p!=="string"||a.uint8array?p==="nodebuffer"?new c(d):a.uint8array?new h(s.transformTo("uint8array",d)):new o(s.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,r,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,r,n){var s=t("./GenericWorker"),a=t("../utils");function o(l){s.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(o,s),o.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},r.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,r,n){var s=t("./GenericWorker"),a=t("../crc32");function o(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,s),o.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,r,n){var s=t("../utils"),a=t("./GenericWorker");function o(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(o,a),o.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},r.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,r,n){var s=t("../utils"),a=t("./GenericWorker");function o(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(h){c.dataIsReady=!0,c.data=h,c.max=h&&h.length||0,c.type=s.getTypeOf(h),c.isPaused||c._tickAndRepeat()},function(h){c.error(h)})}s.inherits(o,a),o.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,r,n){function s(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,o){return this._listeners[a].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,o){if(this._listeners[a])for(var l=0;l<this._listeners[a].length;l++)this._listeners[a][l].call(this,o)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var o=this;return a.on("data",function(l){o.processChunk(l)}),a.on("end",function(){o.end()}),a.on("error",function(l){o.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,o){return this.extraStreamInfo[a]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},r.exports=s},{}],29:[function(t,r,n){var s=t("../utils"),a=t("./ConvertWorker"),o=t("./GenericWorker"),l=t("../base64"),c=t("../support"),h=t("../external"),d=null;if(c.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,b){return new h.Promise(function(w,v){var A=[],E=y._internalType,_=y._outputType,C=y._mimeType;y.on("data",function(I,k){A.push(I),b&&b(k)}).on("error",function(I){A=[],v(I)}).on("end",function(){try{var I=function(k,D,R){switch(k){case"blob":return s.newBlob(s.transformTo("arraybuffer",D),R);case"base64":return l.encode(D);default:return s.transformTo(k,D)}}(_,function(k,D){var R,z=0,G=null,O=0;for(R=0;R<D.length;R++)O+=D[R].length;switch(k){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(G=new Uint8Array(O),R=0;R<D.length;R++)G.set(D[R],z),z+=D[R].length;return G;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+k+"'")}}(E,A),C);w(I)}catch(k){v(k)}A=[]}).resume()})}function g(y,b,w){var v=b;switch(b){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=b,this._mimeType=w,s.checkSupport(v),this._worker=y.pipe(new a(v)),y.lock()}catch(A){this._worker=new o("error"),this._worker.error(A)}}g.prototype={accumulate:function(y){return p(this,y)},on:function(y,b){var w=this;return y==="data"?this._worker.on(y,function(v){b.call(w,v.data,v.meta)}):this._worker.on(y,function(){s.delay(b,arguments,w)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},y)}},r.exports=g},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,r,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",n.nodebuffer=typeof Buffer<"u",n.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(s),n.blob=a.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(t,r,n){for(var s=t("./utils"),a=t("./support"),o=t("./nodejsUtils"),l=t("./stream/GenericWorker"),c=new Array(256),h=0;h<256;h++)c[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}n.utf8encode=function(g){return a.nodebuffer?o.newBufferFrom(g,"utf-8"):function(y){var b,w,v,A,E,_=y.length,C=0;for(A=0;A<_;A++)(64512&(w=y.charCodeAt(A)))==55296&&A+1<_&&(64512&(v=y.charCodeAt(A+1)))==56320&&(w=65536+(w-55296<<10)+(v-56320),A++),C+=w<128?1:w<2048?2:w<65536?3:4;for(b=a.uint8array?new Uint8Array(C):new Array(C),A=E=0;E<C;A++)(64512&(w=y.charCodeAt(A)))==55296&&A+1<_&&(64512&(v=y.charCodeAt(A+1)))==56320&&(w=65536+(w-55296<<10)+(v-56320),A++),w<128?b[E++]=w:(w<2048?b[E++]=192|w>>>6:(w<65536?b[E++]=224|w>>>12:(b[E++]=240|w>>>18,b[E++]=128|w>>>12&63),b[E++]=128|w>>>6&63),b[E++]=128|63&w);return b}(g)},n.utf8decode=function(g){return a.nodebuffer?s.transformTo("nodebuffer",g).toString("utf-8"):function(y){var b,w,v,A,E=y.length,_=new Array(2*E);for(b=w=0;b<E;)if((v=y[b++])<128)_[w++]=v;else if(4<(A=c[v]))_[w++]=65533,b+=A-1;else{for(v&=A===2?31:A===3?15:7;1<A&&b<E;)v=v<<6|63&y[b++],A--;1<A?_[w++]=65533:v<65536?_[w++]=v:(v-=65536,_[w++]=55296|v>>10&1023,_[w++]=56320|1023&v)}return _.length!==w&&(_.subarray?_=_.subarray(0,w):_.length=w),s.applyFromCharCode(_)}(g=s.transformTo(a.uint8array?"uint8array":"array",g))},s.inherits(d,l),d.prototype.processChunk=function(g){var y=s.transformTo(a.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var b=y;(y=new Uint8Array(b.length+this.leftOver.length)).set(this.leftOver,0),y.set(b,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var w=function(A,E){var _;for((E=E||A.length)>A.length&&(E=A.length),_=E-1;0<=_&&(192&A[_])==128;)_--;return _<0||_===0?E:_+c[A[_]]>E?_:E}(y),v=y;w!==y.length&&(a.uint8array?(v=y.subarray(0,w),this.leftOver=y.subarray(w,y.length)):(v=y.slice(0,w),this.leftOver=y.slice(w,y.length))),this.push({data:n.utf8decode(v),meta:g.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=d,s.inherits(p,l),p.prototype.processChunk=function(g){this.push({data:n.utf8encode(g.data),meta:g.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,r,n){var s=t("./support"),a=t("./base64"),o=t("./nodejsUtils"),l=t("./external");function c(b){return b}function h(b,w){for(var v=0;v<b.length;++v)w[v]=255&b.charCodeAt(v);return w}t("setimmediate"),n.newBlob=function(b,w){n.checkSupport("blob");try{return new Blob([b],{type:w})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(b),v.getBlob(w)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(b,w,v){var A=[],E=0,_=b.length;if(_<=v)return String.fromCharCode.apply(null,b);for(;E<_;)w==="array"||w==="nodebuffer"?A.push(String.fromCharCode.apply(null,b.slice(E,Math.min(E+v,_)))):A.push(String.fromCharCode.apply(null,b.subarray(E,Math.min(E+v,_)))),E+=v;return A.join("")},stringifyByChar:function(b){for(var w="",v=0;v<b.length;v++)w+=String.fromCharCode(b[v]);return w},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}}()}};function p(b){var w=65536,v=n.getTypeOf(b),A=!0;if(v==="uint8array"?A=d.applyCanBeUsed.uint8array:v==="nodebuffer"&&(A=d.applyCanBeUsed.nodebuffer),A)for(;1<w;)try{return d.stringifyByChunk(b,v,w)}catch{w=Math.floor(w/2)}return d.stringifyByChar(b)}function g(b,w){for(var v=0;v<b.length;v++)w[v]=b[v];return w}n.applyFromCharCode=p;var y={};y.string={string:c,array:function(b){return h(b,new Array(b.length))},arraybuffer:function(b){return y.string.uint8array(b).buffer},uint8array:function(b){return h(b,new Uint8Array(b.length))},nodebuffer:function(b){return h(b,o.allocBuffer(b.length))}},y.array={string:p,array:c,arraybuffer:function(b){return new Uint8Array(b).buffer},uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return o.newBufferFrom(b)}},y.arraybuffer={string:function(b){return p(new Uint8Array(b))},array:function(b){return g(new Uint8Array(b),new Array(b.byteLength))},arraybuffer:c,uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return o.newBufferFrom(new Uint8Array(b))}},y.uint8array={string:p,array:function(b){return g(b,new Array(b.length))},arraybuffer:function(b){return b.buffer},uint8array:c,nodebuffer:function(b){return o.newBufferFrom(b)}},y.nodebuffer={string:p,array:function(b){return g(b,new Array(b.length))},arraybuffer:function(b){return y.nodebuffer.uint8array(b).buffer},uint8array:function(b){return g(b,new Uint8Array(b.length))},nodebuffer:c},n.transformTo=function(b,w){if(w=w||"",!b)return w;n.checkSupport(b);var v=n.getTypeOf(w);return y[v][b](w)},n.resolve=function(b){for(var w=b.split("/"),v=[],A=0;A<w.length;A++){var E=w[A];E==="."||E===""&&A!==0&&A!==w.length-1||(E===".."?v.pop():v.push(E))}return v.join("/")},n.getTypeOf=function(b){return typeof b=="string"?"string":Object.prototype.toString.call(b)==="[object Array]"?"array":s.nodebuffer&&o.isBuffer(b)?"nodebuffer":s.uint8array&&b instanceof Uint8Array?"uint8array":s.arraybuffer&&b instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(b){if(!s[b.toLowerCase()])throw new Error(b+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(b){var w,v,A="";for(v=0;v<(b||"").length;v++)A+="\\x"+((w=b.charCodeAt(v))<16?"0":"")+w.toString(16).toUpperCase();return A},n.delay=function(b,w,v){setImmediate(function(){b.apply(v||null,w||[])})},n.inherits=function(b,w){function v(){}v.prototype=w.prototype,b.prototype=new v},n.extend=function(){var b,w,v={};for(b=0;b<arguments.length;b++)for(w in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],w)&&v[w]===void 0&&(v[w]=arguments[b][w]);return v},n.prepareContent=function(b,w,v,A,E){return l.Promise.resolve(w).then(function(_){return s.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,I){var k=new FileReader;k.onload=function(D){C(D.target.result)},k.onerror=function(D){I(D.target.error)},k.readAsArrayBuffer(_)}):_}).then(function(_){var C=n.getTypeOf(_);return C?(C==="arraybuffer"?_=n.transformTo("uint8array",_):C==="string"&&(E?_=a.decode(_):v&&A!==!0&&(_=function(I){return h(I,s.uint8array?new Uint8Array(I.length):new Array(I.length))}(_))),_):l.Promise.reject(new Error("Can't read the data of '"+b+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,r,n){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./signature"),l=t("./zipEntry"),c=t("./support");function h(d){this.files=[],this.loadOptions=d}h.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(p)+", expected "+a.pretty(d)+")")}},isSignature:function(d,p){var g=this.reader.index;this.reader.setIndex(d);var y=this.reader.readString(4)===p;return this.reader.setIndex(g),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",g=a.transformTo(p,d);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,p,g,y=this.zip64EndOfCentralSize-44;0<y;)d=this.reader.readInt(2),p=this.reader.readInt(4),g=this.reader.readData(p),this.zip64ExtensibleData[d]={id:d,length:p,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,p;for(d=0;d<this.files.length;d++)p=this.files[d],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var p=d;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var g=this.centralDirOffset+this.centralDirSize;this.zip64&&(g+=20,g+=12+this.zip64EndOfCentralSize);var y=p-g;if(0<y)this.isSignature(p,o.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,r,n){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./compressedObject"),l=t("./crc32"),c=t("./utf8"),h=t("./compressions"),d=t("./support");function p(g,y){this.options=g,this.loadOptions=y}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(g){var y,b;if(g.skip(22),this.fileNameLength=g.readInt(2),b=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(b),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((y=function(w){for(var v in h)if(Object.prototype.hasOwnProperty.call(h,v)&&h[v].magic===w)return h[v];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,y,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var y=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(y),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=s(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var y,b,w,v=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4<v;)y=g.readInt(2),b=g.readInt(2),w=g.readData(b),this.extraFields[y]={id:y,length:b,value:w};g.setIndex(v)},handleUTF8:function(){var g=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var b=a.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(b)}var w=this.findExtraFieldUnicodeComment();if(w!==null)this.fileCommentStr=w;else{var v=a.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var y=s(g.value);return y.readInt(1)!==1||l(this.fileName)!==y.readInt(4)?null:c.utf8decode(y.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var y=s(g.value);return y.readInt(1)!==1||l(this.fileComment)!==y.readInt(4)?null:c.utf8decode(y.readData(g.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,r,n){function s(y,b,w){this.name=y,this.dir=w.dir,this.date=w.date,this.comment=w.comment,this.unixPermissions=w.unixPermissions,this.dosPermissions=w.dosPermissions,this._data=b,this._dataBinary=w.binary,this.options={compression:w.compression,compressionOptions:w.compressionOptions}}var a=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),l=t("./utf8"),c=t("./compressedObject"),h=t("./stream/GenericWorker");s.prototype={internalStream:function(y){var b=null,w="string";try{if(!y)throw new Error("No output type specified.");var v=(w=y.toLowerCase())==="string"||w==="text";w!=="binarystring"&&w!=="text"||(w="string"),b=this._decompressWorker();var A=!this._dataBinary;A&&!v&&(b=b.pipe(new l.Utf8EncodeWorker)),!A&&v&&(b=b.pipe(new l.Utf8DecodeWorker))}catch(E){(b=new h("error")).error(E)}return new a(b,w,"")},async:function(y,b){return this.internalStream(y).accumulate(b)},nodeStream:function(y,b){return this.internalStream(y||"nodebuffer").toNodejsStream(b)},_compressWorker:function(y,b){if(this._data instanceof c&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var w=this._decompressWorker();return this._dataBinary||(w=w.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(w,y,b)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<d.length;g++)s.prototype[d[g]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,r,n){(function(s){var a,o,l=s.MutationObserver||s.WebKitMutationObserver;if(l){var c=0,h=new l(y),d=s.document.createTextNode("");h.observe(d,{characterData:!0}),a=function(){d.data=c=++c%2}}else if(s.setImmediate||s.MessageChannel===void 0)a="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var b=s.document.createElement("script");b.onreadystatechange=function(){y(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},s.document.documentElement.appendChild(b)}:function(){setTimeout(y,0)};else{var p=new s.MessageChannel;p.port1.onmessage=y,a=function(){p.port2.postMessage(0)}}var g=[];function y(){var b,w;o=!0;for(var v=g.length;v;){for(w=g,g=[],b=-1;++b<v;)w[b]();v=g.length}o=!1}r.exports=function(b){g.push(b)!==1||o||a()}}).call(this,typeof sh<"u"?sh:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,r,n){var s=t("immediate");function a(){}var o={},l=["REJECTED"],c=["FULFILLED"],h=["PENDING"];function d(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,v!==a&&b(this,v)}function p(v,A,E){this.promise=v,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}function g(v,A,E){s(function(){var _;try{_=A(E)}catch(C){return o.reject(v,C)}_===v?o.reject(v,new TypeError("Cannot resolve promise with itself")):o.resolve(v,_)})}function y(v){var A=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof A=="function")return function(){A.apply(v,arguments)}}function b(v,A){var E=!1;function _(k){E||(E=!0,o.reject(v,k))}function C(k){E||(E=!0,o.resolve(v,k))}var I=w(function(){A(C,_)});I.status==="error"&&_(I.value)}function w(v,A){var E={};try{E.value=v(A),E.status="success"}catch(_){E.status="error",E.value=_}return E}(r.exports=d).prototype.finally=function(v){if(typeof v!="function")return this;var A=this.constructor;return this.then(function(E){return A.resolve(v()).then(function(){return E})},function(E){return A.resolve(v()).then(function(){throw E})})},d.prototype.catch=function(v){return this.then(null,v)},d.prototype.then=function(v,A){if(typeof v!="function"&&this.state===c||typeof A!="function"&&this.state===l)return this;var E=new this.constructor(a);return this.state!==h?g(E,this.state===c?v:A,this.outcome):this.queue.push(new p(E,v,A)),E},p.prototype.callFulfilled=function(v){o.resolve(this.promise,v)},p.prototype.otherCallFulfilled=function(v){g(this.promise,this.onFulfilled,v)},p.prototype.callRejected=function(v){o.reject(this.promise,v)},p.prototype.otherCallRejected=function(v){g(this.promise,this.onRejected,v)},o.resolve=function(v,A){var E=w(y,A);if(E.status==="error")return o.reject(v,E.value);var _=E.value;if(_)b(v,_);else{v.state=c,v.outcome=A;for(var C=-1,I=v.queue.length;++C<I;)v.queue[C].callFulfilled(A)}return v},o.reject=function(v,A){v.state=l,v.outcome=A;for(var E=-1,_=v.queue.length;++E<_;)v.queue[E].callRejected(A);return v},d.resolve=function(v){return v instanceof this?v:o.resolve(new this(a),v)},d.reject=function(v){var A=new this(a);return o.reject(A,v)},d.all=function(v){var A=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,_=!1;if(!E)return this.resolve([]);for(var C=new Array(E),I=0,k=-1,D=new this(a);++k<E;)R(v[k],k);return D;function R(z,G){A.resolve(z).then(function(O){C[G]=O,++I!==E||_||(_=!0,o.resolve(D,C))},function(O){_||(_=!0,o.reject(D,O))})}},d.race=function(v){var A=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,_=!1;if(!E)return this.resolve([]);for(var C=-1,I=new this(a);++C<E;)k=v[C],A.resolve(k).then(function(D){_||(_=!0,o.resolve(I,D))},function(D){_||(_=!0,o.reject(I,D))});var k;return I}},{immediate:36}],38:[function(t,r,n){var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,r,n){var s=t("./zlib/deflate"),a=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/messages"),c=t("./zlib/zstream"),h=Object.prototype.toString,d=0,p=-1,g=0,y=8;function b(v){if(!(this instanceof b))return new b(v);this.options=a.assign({level:p,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},v||{});var A=this.options;A.raw&&0<A.windowBits?A.windowBits=-A.windowBits:A.gzip&&0<A.windowBits&&A.windowBits<16&&(A.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var E=s.deflateInit2(this.strm,A.level,A.method,A.windowBits,A.memLevel,A.strategy);if(E!==d)throw new Error(l[E]);if(A.header&&s.deflateSetHeader(this.strm,A.header),A.dictionary){var _;if(_=typeof A.dictionary=="string"?o.string2buf(A.dictionary):h.call(A.dictionary)==="[object ArrayBuffer]"?new Uint8Array(A.dictionary):A.dictionary,(E=s.deflateSetDictionary(this.strm,_))!==d)throw new Error(l[E]);this._dict_set=!0}}function w(v,A){var E=new b(A);if(E.push(v,!0),E.err)throw E.msg||l[E.err];return E.result}b.prototype.push=function(v,A){var E,_,C=this.strm,I=this.options.chunkSize;if(this.ended)return!1;_=A===~~A?A:A===!0?4:0,typeof v=="string"?C.input=o.string2buf(v):h.call(v)==="[object ArrayBuffer]"?C.input=new Uint8Array(v):C.input=v,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new a.Buf8(I),C.next_out=0,C.avail_out=I),(E=s.deflate(C,_))!==1&&E!==d)return this.onEnd(E),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(a.shrinkBuf(C.output,C.next_out))):this.onData(a.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&E!==1);return _===4?(E=s.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===d):_!==2||(this.onEnd(d),!(C.avail_out=0))},b.prototype.onData=function(v){this.chunks.push(v)},b.prototype.onEnd=function(v){v===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},n.Deflate=b,n.deflate=w,n.deflateRaw=function(v,A){return(A=A||{}).raw=!0,w(v,A)},n.gzip=function(v,A){return(A=A||{}).gzip=!0,w(v,A)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,r,n){var s=t("./zlib/inflate"),a=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/constants"),c=t("./zlib/messages"),h=t("./zlib/zstream"),d=t("./zlib/gzheader"),p=Object.prototype.toString;function g(b){if(!(this instanceof g))return new g(b);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},b||{});var w=this.options;w.raw&&0<=w.windowBits&&w.windowBits<16&&(w.windowBits=-w.windowBits,w.windowBits===0&&(w.windowBits=-15)),!(0<=w.windowBits&&w.windowBits<16)||b&&b.windowBits||(w.windowBits+=32),15<w.windowBits&&w.windowBits<48&&!(15&w.windowBits)&&(w.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var v=s.inflateInit2(this.strm,w.windowBits);if(v!==l.Z_OK)throw new Error(c[v]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function y(b,w){var v=new g(w);if(v.push(b,!0),v.err)throw v.msg||c[v.err];return v.result}g.prototype.push=function(b,w){var v,A,E,_,C,I,k=this.strm,D=this.options.chunkSize,R=this.options.dictionary,z=!1;if(this.ended)return!1;A=w===~~w?w:w===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof b=="string"?k.input=o.binstring2buf(b):p.call(b)==="[object ArrayBuffer]"?k.input=new Uint8Array(b):k.input=b,k.next_in=0,k.avail_in=k.input.length;do{if(k.avail_out===0&&(k.output=new a.Buf8(D),k.next_out=0,k.avail_out=D),(v=s.inflate(k,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&R&&(I=typeof R=="string"?o.string2buf(R):p.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,v=s.inflateSetDictionary(this.strm,I)),v===l.Z_BUF_ERROR&&z===!0&&(v=l.Z_OK,z=!1),v!==l.Z_STREAM_END&&v!==l.Z_OK)return this.onEnd(v),!(this.ended=!0);k.next_out&&(k.avail_out!==0&&v!==l.Z_STREAM_END&&(k.avail_in!==0||A!==l.Z_FINISH&&A!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(E=o.utf8border(k.output,k.next_out),_=k.next_out-E,C=o.buf2string(k.output,E),k.next_out=_,k.avail_out=D-_,_&&a.arraySet(k.output,k.output,E,_,0),this.onData(C)):this.onData(a.shrinkBuf(k.output,k.next_out)))),k.avail_in===0&&k.avail_out===0&&(z=!0)}while((0<k.avail_in||k.avail_out===0)&&v!==l.Z_STREAM_END);return v===l.Z_STREAM_END&&(A=l.Z_FINISH),A===l.Z_FINISH?(v=s.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l.Z_OK):A!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(k.avail_out=0))},g.prototype.onData=function(b){this.chunks.push(b)},g.prototype.onEnd=function(b){b===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},n.Inflate=g,n.inflate=y,n.inflateRaw=function(b,w){return(w=w||{}).raw=!0,y(b,w)},n.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,r,n){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";n.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var h=c.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var d in h)h.hasOwnProperty(d)&&(l[d]=h[d])}}return l},n.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var a={arraySet:function(l,c,h,d,p){if(c.subarray&&l.subarray)l.set(c.subarray(h,h+d),p);else for(var g=0;g<d;g++)l[p+g]=c[h+g]},flattenChunks:function(l){var c,h,d,p,g,y;for(c=d=0,h=l.length;c<h;c++)d+=l[c].length;for(y=new Uint8Array(d),c=p=0,h=l.length;c<h;c++)g=l[c],y.set(g,p),p+=g.length;return y}},o={arraySet:function(l,c,h,d,p){for(var g=0;g<d;g++)l[p+g]=c[h+g]},flattenChunks:function(l){return[].concat.apply([],l)}};n.setTyped=function(l){l?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(s)},{}],42:[function(t,r,n){var s=t("./common"),a=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var l=new s.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function h(d,p){if(p<65537&&(d.subarray&&o||!d.subarray&&a))return String.fromCharCode.apply(null,s.shrinkBuf(d,p));for(var g="",y=0;y<p;y++)g+=String.fromCharCode(d[y]);return g}l[254]=l[254]=1,n.string2buf=function(d){var p,g,y,b,w,v=d.length,A=0;for(b=0;b<v;b++)(64512&(g=d.charCodeAt(b)))==55296&&b+1<v&&(64512&(y=d.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),b++),A+=g<128?1:g<2048?2:g<65536?3:4;for(p=new s.Buf8(A),b=w=0;w<A;b++)(64512&(g=d.charCodeAt(b)))==55296&&b+1<v&&(64512&(y=d.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),b++),g<128?p[w++]=g:(g<2048?p[w++]=192|g>>>6:(g<65536?p[w++]=224|g>>>12:(p[w++]=240|g>>>18,p[w++]=128|g>>>12&63),p[w++]=128|g>>>6&63),p[w++]=128|63&g);return p},n.buf2binstring=function(d){return h(d,d.length)},n.binstring2buf=function(d){for(var p=new s.Buf8(d.length),g=0,y=p.length;g<y;g++)p[g]=d.charCodeAt(g);return p},n.buf2string=function(d,p){var g,y,b,w,v=p||d.length,A=new Array(2*v);for(g=y=0;g<v;)if((b=d[g++])<128)A[y++]=b;else if(4<(w=l[b]))A[y++]=65533,g+=w-1;else{for(b&=w===2?31:w===3?15:7;1<w&&g<v;)b=b<<6|63&d[g++],w--;1<w?A[y++]=65533:b<65536?A[y++]=b:(b-=65536,A[y++]=55296|b>>10&1023,A[y++]=56320|1023&b)}return h(A,y)},n.utf8border=function(d,p){var g;for((p=p||d.length)>d.length&&(p=d.length),g=p-1;0<=g&&(192&d[g])==128;)g--;return g<0||g===0?p:g+l[d[g]]>p?g:p}},{"./common":41}],43:[function(t,r,n){r.exports=function(s,a,o,l){for(var c=65535&s|0,h=s>>>16&65535|0,d=0;o!==0;){for(o-=d=2e3<o?2e3:o;h=h+(c=c+a[l++]|0)|0,--d;);c%=65521,h%=65521}return c|h<<16|0}},{}],44:[function(t,r,n){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,r,n){var s=function(){for(var a,o=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;o[l]=a}return o}();r.exports=function(a,o,l,c){var h=s,d=c+l;a^=-1;for(var p=c;p<d;p++)a=a>>>8^h[255&(a^o[p])];return-1^a}},{}],46:[function(t,r,n){var s,a=t("../utils/common"),o=t("./trees"),l=t("./adler32"),c=t("./crc32"),h=t("./messages"),d=0,p=4,g=0,y=-2,b=-1,w=4,v=2,A=8,E=9,_=286,C=30,I=19,k=2*_+1,D=15,R=3,z=258,G=z+R+1,O=42,X=113,S=1,J=2,Y=3,W=4;function fe(x,U){return x.msg=h[U],U}function K(x){return(x<<1)-(4<x?9:0)}function be(x){for(var U=x.length;0<=--U;)x[U]=0}function te(x){var U=x.state,B=U.pending;B>x.avail_out&&(B=x.avail_out),B!==0&&(a.arraySet(x.output,U.pending_buf,U.pending_out,B,x.next_out),x.next_out+=B,U.pending_out+=B,x.total_out+=B,x.avail_out-=B,U.pending-=B,U.pending===0&&(U.pending_out=0))}function j(x,U){o._tr_flush_block(x,0<=x.block_start?x.block_start:-1,x.strstart-x.block_start,U),x.block_start=x.strstart,te(x.strm)}function ie(x,U){x.pending_buf[x.pending++]=U}function ae(x,U){x.pending_buf[x.pending++]=U>>>8&255,x.pending_buf[x.pending++]=255&U}function H(x,U){var B,F,M=x.max_chain_length,q=x.strstart,de=x.prev_length,we=x.nice_match,ee=x.strstart>x.w_size-G?x.strstart-(x.w_size-G):0,Ee=x.window,De=x.w_mask,Ce=x.prev,Me=x.strstart+z,$e=Ee[q+de-1],Xe=Ee[q+de];x.prev_length>=x.good_match&&(M>>=2),we>x.lookahead&&(we=x.lookahead);do if(Ee[(B=U)+de]===Xe&&Ee[B+de-1]===$e&&Ee[B]===Ee[q]&&Ee[++B]===Ee[q+1]){q+=2,B++;do;while(Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&q<Me);if(F=z-(Me-q),q=Me-z,de<F){if(x.match_start=U,we<=(de=F))break;$e=Ee[q+de-1],Xe=Ee[q+de]}}while((U=Ce[U&De])>ee&&--M!=0);return de<=x.lookahead?de:x.lookahead}function se(x){var U,B,F,M,q,de,we,ee,Ee,De,Ce=x.w_size;do{if(M=x.window_size-x.lookahead-x.strstart,x.strstart>=Ce+(Ce-G)){for(a.arraySet(x.window,x.window,Ce,Ce,0),x.match_start-=Ce,x.strstart-=Ce,x.block_start-=Ce,U=B=x.hash_size;F=x.head[--U],x.head[U]=Ce<=F?F-Ce:0,--B;);for(U=B=Ce;F=x.prev[--U],x.prev[U]=Ce<=F?F-Ce:0,--B;);M+=Ce}if(x.strm.avail_in===0)break;if(de=x.strm,we=x.window,ee=x.strstart+x.lookahead,Ee=M,De=void 0,De=de.avail_in,Ee<De&&(De=Ee),B=De===0?0:(de.avail_in-=De,a.arraySet(we,de.input,de.next_in,De,ee),de.state.wrap===1?de.adler=l(de.adler,we,De,ee):de.state.wrap===2&&(de.adler=c(de.adler,we,De,ee)),de.next_in+=De,de.total_in+=De,De),x.lookahead+=B,x.lookahead+x.insert>=R)for(q=x.strstart-x.insert,x.ins_h=x.window[q],x.ins_h=(x.ins_h<<x.hash_shift^x.window[q+1])&x.hash_mask;x.insert&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[q+R-1])&x.hash_mask,x.prev[q&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=q,q++,x.insert--,!(x.lookahead+x.insert<R)););}while(x.lookahead<G&&x.strm.avail_in!==0)}function le(x,U){for(var B,F;;){if(x.lookahead<G){if(se(x),x.lookahead<G&&U===d)return S;if(x.lookahead===0)break}if(B=0,x.lookahead>=R&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),B!==0&&x.strstart-B<=x.w_size-G&&(x.match_length=H(x,B)),x.match_length>=R)if(F=o._tr_tally(x,x.strstart-x.match_start,x.match_length-R),x.lookahead-=x.match_length,x.match_length<=x.max_lazy_match&&x.lookahead>=R){for(x.match_length--;x.strstart++,x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart,--x.match_length!=0;);x.strstart++}else x.strstart+=x.match_length,x.match_length=0,x.ins_h=x.window[x.strstart],x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+1])&x.hash_mask;else F=o._tr_tally(x,0,x.window[x.strstart]),x.lookahead--,x.strstart++;if(F&&(j(x,!1),x.strm.avail_out===0))return S}return x.insert=x.strstart<R-1?x.strstart:R-1,U===p?(j(x,!0),x.strm.avail_out===0?Y:W):x.last_lit&&(j(x,!1),x.strm.avail_out===0)?S:J}function oe(x,U){for(var B,F,M;;){if(x.lookahead<G){if(se(x),x.lookahead<G&&U===d)return S;if(x.lookahead===0)break}if(B=0,x.lookahead>=R&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),x.prev_length=x.match_length,x.prev_match=x.match_start,x.match_length=R-1,B!==0&&x.prev_length<x.max_lazy_match&&x.strstart-B<=x.w_size-G&&(x.match_length=H(x,B),x.match_length<=5&&(x.strategy===1||x.match_length===R&&4096<x.strstart-x.match_start)&&(x.match_length=R-1)),x.prev_length>=R&&x.match_length<=x.prev_length){for(M=x.strstart+x.lookahead-R,F=o._tr_tally(x,x.strstart-1-x.prev_match,x.prev_length-R),x.lookahead-=x.prev_length-1,x.prev_length-=2;++x.strstart<=M&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),--x.prev_length!=0;);if(x.match_available=0,x.match_length=R-1,x.strstart++,F&&(j(x,!1),x.strm.avail_out===0))return S}else if(x.match_available){if((F=o._tr_tally(x,0,x.window[x.strstart-1]))&&j(x,!1),x.strstart++,x.lookahead--,x.strm.avail_out===0)return S}else x.match_available=1,x.strstart++,x.lookahead--}return x.match_available&&(F=o._tr_tally(x,0,x.window[x.strstart-1]),x.match_available=0),x.insert=x.strstart<R-1?x.strstart:R-1,U===p?(j(x,!0),x.strm.avail_out===0?Y:W):x.last_lit&&(j(x,!1),x.strm.avail_out===0)?S:J}function ce(x,U,B,F,M){this.good_length=x,this.max_lazy=U,this.nice_length=B,this.max_chain=F,this.func=M}function Ae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(2*k),this.dyn_dtree=new a.Buf16(2*(2*C+1)),this.bl_tree=new a.Buf16(2*(2*I+1)),be(this.dyn_ltree),be(this.dyn_dtree),be(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(D+1),this.heap=new a.Buf16(2*_+1),be(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*_+1),be(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Se(x){var U;return x&&x.state?(x.total_in=x.total_out=0,x.data_type=v,(U=x.state).pending=0,U.pending_out=0,U.wrap<0&&(U.wrap=-U.wrap),U.status=U.wrap?O:X,x.adler=U.wrap===2?0:1,U.last_flush=d,o._tr_init(U),g):fe(x,y)}function Ne(x){var U=Se(x);return U===g&&function(B){B.window_size=2*B.w_size,be(B.head),B.max_lazy_match=s[B.level].max_lazy,B.good_match=s[B.level].good_length,B.nice_match=s[B.level].nice_length,B.max_chain_length=s[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=R-1,B.match_available=0,B.ins_h=0}(x.state),U}function Te(x,U,B,F,M,q){if(!x)return y;var de=1;if(U===b&&(U=6),F<0?(de=0,F=-F):15<F&&(de=2,F-=16),M<1||E<M||B!==A||F<8||15<F||U<0||9<U||q<0||w<q)return fe(x,y);F===8&&(F=9);var we=new Ae;return(x.state=we).strm=x,we.wrap=de,we.gzhead=null,we.w_bits=F,we.w_size=1<<we.w_bits,we.w_mask=we.w_size-1,we.hash_bits=M+7,we.hash_size=1<<we.hash_bits,we.hash_mask=we.hash_size-1,we.hash_shift=~~((we.hash_bits+R-1)/R),we.window=new a.Buf8(2*we.w_size),we.head=new a.Buf16(we.hash_size),we.prev=new a.Buf16(we.w_size),we.lit_bufsize=1<<M+6,we.pending_buf_size=4*we.lit_bufsize,we.pending_buf=new a.Buf8(we.pending_buf_size),we.d_buf=1*we.lit_bufsize,we.l_buf=3*we.lit_bufsize,we.level=U,we.strategy=q,we.method=B,Ne(x)}s=[new ce(0,0,0,0,function(x,U){var B=65535;for(B>x.pending_buf_size-5&&(B=x.pending_buf_size-5);;){if(x.lookahead<=1){if(se(x),x.lookahead===0&&U===d)return S;if(x.lookahead===0)break}x.strstart+=x.lookahead,x.lookahead=0;var F=x.block_start+B;if((x.strstart===0||x.strstart>=F)&&(x.lookahead=x.strstart-F,x.strstart=F,j(x,!1),x.strm.avail_out===0)||x.strstart-x.block_start>=x.w_size-G&&(j(x,!1),x.strm.avail_out===0))return S}return x.insert=0,U===p?(j(x,!0),x.strm.avail_out===0?Y:W):(x.strstart>x.block_start&&(j(x,!1),x.strm.avail_out),S)}),new ce(4,4,8,4,le),new ce(4,5,16,8,le),new ce(4,6,32,32,le),new ce(4,4,16,16,oe),new ce(8,16,32,32,oe),new ce(8,16,128,128,oe),new ce(8,32,128,256,oe),new ce(32,128,258,1024,oe),new ce(32,258,258,4096,oe)],n.deflateInit=function(x,U){return Te(x,U,A,15,8,0)},n.deflateInit2=Te,n.deflateReset=Ne,n.deflateResetKeep=Se,n.deflateSetHeader=function(x,U){return x&&x.state?x.state.wrap!==2?y:(x.state.gzhead=U,g):y},n.deflate=function(x,U){var B,F,M,q;if(!x||!x.state||5<U||U<0)return x?fe(x,y):y;if(F=x.state,!x.output||!x.input&&x.avail_in!==0||F.status===666&&U!==p)return fe(x,x.avail_out===0?-5:y);if(F.strm=x,B=F.last_flush,F.last_flush=U,F.status===O)if(F.wrap===2)x.adler=0,ie(F,31),ie(F,139),ie(F,8),F.gzhead?(ie(F,(F.gzhead.text?1:0)+(F.gzhead.hcrc?2:0)+(F.gzhead.extra?4:0)+(F.gzhead.name?8:0)+(F.gzhead.comment?16:0)),ie(F,255&F.gzhead.time),ie(F,F.gzhead.time>>8&255),ie(F,F.gzhead.time>>16&255),ie(F,F.gzhead.time>>24&255),ie(F,F.level===9?2:2<=F.strategy||F.level<2?4:0),ie(F,255&F.gzhead.os),F.gzhead.extra&&F.gzhead.extra.length&&(ie(F,255&F.gzhead.extra.length),ie(F,F.gzhead.extra.length>>8&255)),F.gzhead.hcrc&&(x.adler=c(x.adler,F.pending_buf,F.pending,0)),F.gzindex=0,F.status=69):(ie(F,0),ie(F,0),ie(F,0),ie(F,0),ie(F,0),ie(F,F.level===9?2:2<=F.strategy||F.level<2?4:0),ie(F,3),F.status=X);else{var de=A+(F.w_bits-8<<4)<<8;de|=(2<=F.strategy||F.level<2?0:F.level<6?1:F.level===6?2:3)<<6,F.strstart!==0&&(de|=32),de+=31-de%31,F.status=X,ae(F,de),F.strstart!==0&&(ae(F,x.adler>>>16),ae(F,65535&x.adler)),x.adler=1}if(F.status===69)if(F.gzhead.extra){for(M=F.pending;F.gzindex<(65535&F.gzhead.extra.length)&&(F.pending!==F.pending_buf_size||(F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),te(x),M=F.pending,F.pending!==F.pending_buf_size));)ie(F,255&F.gzhead.extra[F.gzindex]),F.gzindex++;F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),F.gzindex===F.gzhead.extra.length&&(F.gzindex=0,F.status=73)}else F.status=73;if(F.status===73)if(F.gzhead.name){M=F.pending;do{if(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),te(x),M=F.pending,F.pending===F.pending_buf_size)){q=1;break}q=F.gzindex<F.gzhead.name.length?255&F.gzhead.name.charCodeAt(F.gzindex++):0,ie(F,q)}while(q!==0);F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),q===0&&(F.gzindex=0,F.status=91)}else F.status=91;if(F.status===91)if(F.gzhead.comment){M=F.pending;do{if(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),te(x),M=F.pending,F.pending===F.pending_buf_size)){q=1;break}q=F.gzindex<F.gzhead.comment.length?255&F.gzhead.comment.charCodeAt(F.gzindex++):0,ie(F,q)}while(q!==0);F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),q===0&&(F.status=103)}else F.status=103;if(F.status===103&&(F.gzhead.hcrc?(F.pending+2>F.pending_buf_size&&te(x),F.pending+2<=F.pending_buf_size&&(ie(F,255&x.adler),ie(F,x.adler>>8&255),x.adler=0,F.status=X)):F.status=X),F.pending!==0){if(te(x),x.avail_out===0)return F.last_flush=-1,g}else if(x.avail_in===0&&K(U)<=K(B)&&U!==p)return fe(x,-5);if(F.status===666&&x.avail_in!==0)return fe(x,-5);if(x.avail_in!==0||F.lookahead!==0||U!==d&&F.status!==666){var we=F.strategy===2?function(ee,Ee){for(var De;;){if(ee.lookahead===0&&(se(ee),ee.lookahead===0)){if(Ee===d)return S;break}if(ee.match_length=0,De=o._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++,De&&(j(ee,!1),ee.strm.avail_out===0))return S}return ee.insert=0,Ee===p?(j(ee,!0),ee.strm.avail_out===0?Y:W):ee.last_lit&&(j(ee,!1),ee.strm.avail_out===0)?S:J}(F,U):F.strategy===3?function(ee,Ee){for(var De,Ce,Me,$e,Xe=ee.window;;){if(ee.lookahead<=z){if(se(ee),ee.lookahead<=z&&Ee===d)return S;if(ee.lookahead===0)break}if(ee.match_length=0,ee.lookahead>=R&&0<ee.strstart&&(Ce=Xe[Me=ee.strstart-1])===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]){$e=ee.strstart+z;do;while(Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Me<$e);ee.match_length=z-($e-Me),ee.match_length>ee.lookahead&&(ee.match_length=ee.lookahead)}if(ee.match_length>=R?(De=o._tr_tally(ee,1,ee.match_length-R),ee.lookahead-=ee.match_length,ee.strstart+=ee.match_length,ee.match_length=0):(De=o._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++),De&&(j(ee,!1),ee.strm.avail_out===0))return S}return ee.insert=0,Ee===p?(j(ee,!0),ee.strm.avail_out===0?Y:W):ee.last_lit&&(j(ee,!1),ee.strm.avail_out===0)?S:J}(F,U):s[F.level].func(F,U);if(we!==Y&&we!==W||(F.status=666),we===S||we===Y)return x.avail_out===0&&(F.last_flush=-1),g;if(we===J&&(U===1?o._tr_align(F):U!==5&&(o._tr_stored_block(F,0,0,!1),U===3&&(be(F.head),F.lookahead===0&&(F.strstart=0,F.block_start=0,F.insert=0))),te(x),x.avail_out===0))return F.last_flush=-1,g}return U!==p?g:F.wrap<=0?1:(F.wrap===2?(ie(F,255&x.adler),ie(F,x.adler>>8&255),ie(F,x.adler>>16&255),ie(F,x.adler>>24&255),ie(F,255&x.total_in),ie(F,x.total_in>>8&255),ie(F,x.total_in>>16&255),ie(F,x.total_in>>24&255)):(ae(F,x.adler>>>16),ae(F,65535&x.adler)),te(x),0<F.wrap&&(F.wrap=-F.wrap),F.pending!==0?g:1)},n.deflateEnd=function(x){var U;return x&&x.state?(U=x.state.status)!==O&&U!==69&&U!==73&&U!==91&&U!==103&&U!==X&&U!==666?fe(x,y):(x.state=null,U===X?fe(x,-3):g):y},n.deflateSetDictionary=function(x,U){var B,F,M,q,de,we,ee,Ee,De=U.length;if(!x||!x.state||(q=(B=x.state).wrap)===2||q===1&&B.status!==O||B.lookahead)return y;for(q===1&&(x.adler=l(x.adler,U,De,0)),B.wrap=0,De>=B.w_size&&(q===0&&(be(B.head),B.strstart=0,B.block_start=0,B.insert=0),Ee=new a.Buf8(B.w_size),a.arraySet(Ee,U,De-B.w_size,B.w_size,0),U=Ee,De=B.w_size),de=x.avail_in,we=x.next_in,ee=x.input,x.avail_in=De,x.next_in=0,x.input=U,se(B);B.lookahead>=R;){for(F=B.strstart,M=B.lookahead-(R-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[F+R-1])&B.hash_mask,B.prev[F&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=F,F++,--M;);B.strstart=F,B.lookahead=R-1,se(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=R-1,B.match_available=0,x.next_in=we,x.input=ee,x.avail_in=de,B.wrap=q,g},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,r,n){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,r,n){r.exports=function(s,a){var o,l,c,h,d,p,g,y,b,w,v,A,E,_,C,I,k,D,R,z,G,O,X,S,J;o=s.state,l=s.next_in,S=s.input,c=l+(s.avail_in-5),h=s.next_out,J=s.output,d=h-(a-s.avail_out),p=h+(s.avail_out-257),g=o.dmax,y=o.wsize,b=o.whave,w=o.wnext,v=o.window,A=o.hold,E=o.bits,_=o.lencode,C=o.distcode,I=(1<<o.lenbits)-1,k=(1<<o.distbits)-1;e:do{E<15&&(A+=S[l++]<<E,E+=8,A+=S[l++]<<E,E+=8),D=_[A&I];t:for(;;){if(A>>>=R=D>>>24,E-=R,(R=D>>>16&255)===0)J[h++]=65535&D;else{if(!(16&R)){if(!(64&R)){D=_[(65535&D)+(A&(1<<R)-1)];continue t}if(32&R){o.mode=12;break e}s.msg="invalid literal/length code",o.mode=30;break e}z=65535&D,(R&=15)&&(E<R&&(A+=S[l++]<<E,E+=8),z+=A&(1<<R)-1,A>>>=R,E-=R),E<15&&(A+=S[l++]<<E,E+=8,A+=S[l++]<<E,E+=8),D=C[A&k];r:for(;;){if(A>>>=R=D>>>24,E-=R,!(16&(R=D>>>16&255))){if(!(64&R)){D=C[(65535&D)+(A&(1<<R)-1)];continue r}s.msg="invalid distance code",o.mode=30;break e}if(G=65535&D,E<(R&=15)&&(A+=S[l++]<<E,(E+=8)<R&&(A+=S[l++]<<E,E+=8)),g<(G+=A&(1<<R)-1)){s.msg="invalid distance too far back",o.mode=30;break e}if(A>>>=R,E-=R,(R=h-d)<G){if(b<(R=G-R)&&o.sane){s.msg="invalid distance too far back",o.mode=30;break e}if(X=v,(O=0)===w){if(O+=y-R,R<z){for(z-=R;J[h++]=v[O++],--R;);O=h-G,X=J}}else if(w<R){if(O+=y+w-R,(R-=w)<z){for(z-=R;J[h++]=v[O++],--R;);if(O=0,w<z){for(z-=R=w;J[h++]=v[O++],--R;);O=h-G,X=J}}}else if(O+=w-R,R<z){for(z-=R;J[h++]=v[O++],--R;);O=h-G,X=J}for(;2<z;)J[h++]=X[O++],J[h++]=X[O++],J[h++]=X[O++],z-=3;z&&(J[h++]=X[O++],1<z&&(J[h++]=X[O++]))}else{for(O=h-G;J[h++]=J[O++],J[h++]=J[O++],J[h++]=J[O++],2<(z-=3););z&&(J[h++]=J[O++],1<z&&(J[h++]=J[O++]))}break}}break}}while(l<c&&h<p);l-=z=E>>3,A&=(1<<(E-=z<<3))-1,s.next_in=l,s.next_out=h,s.avail_in=l<c?c-l+5:5-(l-c),s.avail_out=h<p?p-h+257:257-(h-p),o.hold=A,o.bits=E}},{}],49:[function(t,r,n){var s=t("../utils/common"),a=t("./adler32"),o=t("./crc32"),l=t("./inffast"),c=t("./inftrees"),h=1,d=2,p=0,g=-2,y=1,b=852,w=592;function v(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function A(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function E(O){var X;return O&&O.state?(X=O.state,O.total_in=O.total_out=X.total=0,O.msg="",X.wrap&&(O.adler=1&X.wrap),X.mode=y,X.last=0,X.havedict=0,X.dmax=32768,X.head=null,X.hold=0,X.bits=0,X.lencode=X.lendyn=new s.Buf32(b),X.distcode=X.distdyn=new s.Buf32(w),X.sane=1,X.back=-1,p):g}function _(O){var X;return O&&O.state?((X=O.state).wsize=0,X.whave=0,X.wnext=0,E(O)):g}function C(O,X){var S,J;return O&&O.state?(J=O.state,X<0?(S=0,X=-X):(S=1+(X>>4),X<48&&(X&=15)),X&&(X<8||15<X)?g:(J.window!==null&&J.wbits!==X&&(J.window=null),J.wrap=S,J.wbits=X,_(O))):g}function I(O,X){var S,J;return O?(J=new A,(O.state=J).window=null,(S=C(O,X))!==p&&(O.state=null),S):g}var k,D,R=!0;function z(O){if(R){var X;for(k=new s.Buf32(512),D=new s.Buf32(32),X=0;X<144;)O.lens[X++]=8;for(;X<256;)O.lens[X++]=9;for(;X<280;)O.lens[X++]=7;for(;X<288;)O.lens[X++]=8;for(c(h,O.lens,0,288,k,0,O.work,{bits:9}),X=0;X<32;)O.lens[X++]=5;c(d,O.lens,0,32,D,0,O.work,{bits:5}),R=!1}O.lencode=k,O.lenbits=9,O.distcode=D,O.distbits=5}function G(O,X,S,J){var Y,W=O.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new s.Buf8(W.wsize)),J>=W.wsize?(s.arraySet(W.window,X,S-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(J<(Y=W.wsize-W.wnext)&&(Y=J),s.arraySet(W.window,X,S-J,Y,W.wnext),(J-=Y)?(s.arraySet(W.window,X,S-J,J,0),W.wnext=J,W.whave=W.wsize):(W.wnext+=Y,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=Y))),0}n.inflateReset=_,n.inflateReset2=C,n.inflateResetKeep=E,n.inflateInit=function(O){return I(O,15)},n.inflateInit2=I,n.inflate=function(O,X){var S,J,Y,W,fe,K,be,te,j,ie,ae,H,se,le,oe,ce,Ae,Se,Ne,Te,x,U,B,F,M=0,q=new s.Buf8(4),de=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return g;(S=O.state).mode===12&&(S.mode=13),fe=O.next_out,Y=O.output,be=O.avail_out,W=O.next_in,J=O.input,K=O.avail_in,te=S.hold,j=S.bits,ie=K,ae=be,U=p;e:for(;;)switch(S.mode){case y:if(S.wrap===0){S.mode=13;break}for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(2&S.wrap&&te===35615){q[S.check=0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0),j=te=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&te)<<8)+(te>>8))%31){O.msg="incorrect header check",S.mode=30;break}if((15&te)!=8){O.msg="unknown compression method",S.mode=30;break}if(j-=4,x=8+(15&(te>>>=4)),S.wbits===0)S.wbits=x;else if(x>S.wbits){O.msg="invalid window size",S.mode=30;break}S.dmax=1<<x,O.adler=S.check=1,S.mode=512&te?10:12,j=te=0;break;case 2:for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(S.flags=te,(255&S.flags)!=8){O.msg="unknown compression method",S.mode=30;break}if(57344&S.flags){O.msg="unknown header flags set",S.mode=30;break}S.head&&(S.head.text=te>>8&1),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0)),j=te=0,S.mode=3;case 3:for(;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.head&&(S.head.time=te),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,q[2]=te>>>16&255,q[3]=te>>>24&255,S.check=o(S.check,q,4,0)),j=te=0,S.mode=4;case 4:for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.head&&(S.head.xflags=255&te,S.head.os=te>>8),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0)),j=te=0,S.mode=5;case 5:if(1024&S.flags){for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.length=te,S.head&&(S.head.extra_len=te),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0)),j=te=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&(K<(H=S.length)&&(H=K),H&&(S.head&&(x=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),s.arraySet(S.head.extra,J,W,H,x)),512&S.flags&&(S.check=o(S.check,J,H,W)),K-=H,W+=H,S.length-=H),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if(K===0)break e;for(H=0;x=J[W+H++],S.head&&x&&S.length<65536&&(S.head.name+=String.fromCharCode(x)),x&&H<K;);if(512&S.flags&&(S.check=o(S.check,J,H,W)),K-=H,W+=H,x)break e}else S.head&&(S.head.name=null);S.length=0,S.mode=8;case 8:if(4096&S.flags){if(K===0)break e;for(H=0;x=J[W+H++],S.head&&x&&S.length<65536&&(S.head.comment+=String.fromCharCode(x)),x&&H<K;);if(512&S.flags&&(S.check=o(S.check,J,H,W)),K-=H,W+=H,x)break e}else S.head&&(S.head.comment=null);S.mode=9;case 9:if(512&S.flags){for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(te!==(65535&S.check)){O.msg="header crc mismatch",S.mode=30;break}j=te=0}S.head&&(S.head.hcrc=S.flags>>9&1,S.head.done=!0),O.adler=S.check=0,S.mode=12;break;case 10:for(;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}O.adler=S.check=v(te),j=te=0,S.mode=11;case 11:if(S.havedict===0)return O.next_out=fe,O.avail_out=be,O.next_in=W,O.avail_in=K,S.hold=te,S.bits=j,2;O.adler=S.check=1,S.mode=12;case 12:if(X===5||X===6)break e;case 13:if(S.last){te>>>=7&j,j-=7&j,S.mode=27;break}for(;j<3;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}switch(S.last=1&te,j-=1,3&(te>>>=1)){case 0:S.mode=14;break;case 1:if(z(S),S.mode=20,X!==6)break;te>>>=2,j-=2;break e;case 2:S.mode=17;break;case 3:O.msg="invalid block type",S.mode=30}te>>>=2,j-=2;break;case 14:for(te>>>=7&j,j-=7&j;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if((65535&te)!=(te>>>16^65535)){O.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&te,j=te=0,S.mode=15,X===6)break e;case 15:S.mode=16;case 16:if(H=S.length){if(K<H&&(H=K),be<H&&(H=be),H===0)break e;s.arraySet(Y,J,W,H,fe),K-=H,W+=H,be-=H,fe+=H,S.length-=H;break}S.mode=12;break;case 17:for(;j<14;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(S.nlen=257+(31&te),te>>>=5,j-=5,S.ndist=1+(31&te),te>>>=5,j-=5,S.ncode=4+(15&te),te>>>=4,j-=4,286<S.nlen||30<S.ndist){O.msg="too many length or distance symbols",S.mode=30;break}S.have=0,S.mode=18;case 18:for(;S.have<S.ncode;){for(;j<3;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.lens[de[S.have++]]=7&te,te>>>=3,j-=3}for(;S.have<19;)S.lens[de[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,B={bits:S.lenbits},U=c(0,S.lens,0,19,S.lencode,0,S.work,B),S.lenbits=B.bits,U){O.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have<S.nlen+S.ndist;){for(;ce=(M=S.lencode[te&(1<<S.lenbits)-1])>>>16&255,Ae=65535&M,!((oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(Ae<16)te>>>=oe,j-=oe,S.lens[S.have++]=Ae;else{if(Ae===16){for(F=oe+2;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(te>>>=oe,j-=oe,S.have===0){O.msg="invalid bit length repeat",S.mode=30;break}x=S.lens[S.have-1],H=3+(3&te),te>>>=2,j-=2}else if(Ae===17){for(F=oe+3;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}j-=oe,x=0,H=3+(7&(te>>>=oe)),te>>>=3,j-=3}else{for(F=oe+7;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}j-=oe,x=0,H=11+(127&(te>>>=oe)),te>>>=7,j-=7}if(S.have+H>S.nlen+S.ndist){O.msg="invalid bit length repeat",S.mode=30;break}for(;H--;)S.lens[S.have++]=x}}if(S.mode===30)break;if(S.lens[256]===0){O.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,B={bits:S.lenbits},U=c(h,S.lens,0,S.nlen,S.lencode,0,S.work,B),S.lenbits=B.bits,U){O.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,B={bits:S.distbits},U=c(d,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,B),S.distbits=B.bits,U){O.msg="invalid distances set",S.mode=30;break}if(S.mode=20,X===6)break e;case 20:S.mode=21;case 21:if(6<=K&&258<=be){O.next_out=fe,O.avail_out=be,O.next_in=W,O.avail_in=K,S.hold=te,S.bits=j,l(O,ae),fe=O.next_out,Y=O.output,be=O.avail_out,W=O.next_in,J=O.input,K=O.avail_in,te=S.hold,j=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;ce=(M=S.lencode[te&(1<<S.lenbits)-1])>>>16&255,Ae=65535&M,!((oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(ce&&!(240&ce)){for(Se=oe,Ne=ce,Te=Ae;ce=(M=S.lencode[Te+((te&(1<<Se+Ne)-1)>>Se)])>>>16&255,Ae=65535&M,!(Se+(oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}te>>>=Se,j-=Se,S.back+=Se}if(te>>>=oe,j-=oe,S.back+=oe,S.length=Ae,ce===0){S.mode=26;break}if(32&ce){S.back=-1,S.mode=12;break}if(64&ce){O.msg="invalid literal/length code",S.mode=30;break}S.extra=15&ce,S.mode=22;case 22:if(S.extra){for(F=S.extra;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.length+=te&(1<<S.extra)-1,te>>>=S.extra,j-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;ce=(M=S.distcode[te&(1<<S.distbits)-1])>>>16&255,Ae=65535&M,!((oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(!(240&ce)){for(Se=oe,Ne=ce,Te=Ae;ce=(M=S.distcode[Te+((te&(1<<Se+Ne)-1)>>Se)])>>>16&255,Ae=65535&M,!(Se+(oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}te>>>=Se,j-=Se,S.back+=Se}if(te>>>=oe,j-=oe,S.back+=oe,64&ce){O.msg="invalid distance code",S.mode=30;break}S.offset=Ae,S.extra=15&ce,S.mode=24;case 24:if(S.extra){for(F=S.extra;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.offset+=te&(1<<S.extra)-1,te>>>=S.extra,j-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){O.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(be===0)break e;if(H=ae-be,S.offset>H){if((H=S.offset-H)>S.whave&&S.sane){O.msg="invalid distance too far back",S.mode=30;break}se=H>S.wnext?(H-=S.wnext,S.wsize-H):S.wnext-H,H>S.length&&(H=S.length),le=S.window}else le=Y,se=fe-S.offset,H=S.length;for(be<H&&(H=be),be-=H,S.length-=H;Y[fe++]=le[se++],--H;);S.length===0&&(S.mode=21);break;case 26:if(be===0)break e;Y[fe++]=S.length,be--,S.mode=21;break;case 27:if(S.wrap){for(;j<32;){if(K===0)break e;K--,te|=J[W++]<<j,j+=8}if(ae-=be,O.total_out+=ae,S.total+=ae,ae&&(O.adler=S.check=S.flags?o(S.check,Y,ae,fe-ae):a(S.check,Y,ae,fe-ae)),ae=be,(S.flags?te:v(te))!==S.check){O.msg="incorrect data check",S.mode=30;break}j=te=0}S.mode=28;case 28:if(S.wrap&&S.flags){for(;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(te!==(4294967295&S.total)){O.msg="incorrect length check",S.mode=30;break}j=te=0}S.mode=29;case 29:U=1;break e;case 30:U=-3;break e;case 31:return-4;case 32:default:return g}return O.next_out=fe,O.avail_out=be,O.next_in=W,O.avail_in=K,S.hold=te,S.bits=j,(S.wsize||ae!==O.avail_out&&S.mode<30&&(S.mode<27||X!==4))&&G(O,O.output,O.next_out,ae-O.avail_out)?(S.mode=31,-4):(ie-=O.avail_in,ae-=O.avail_out,O.total_in+=ie,O.total_out+=ae,S.total+=ae,S.wrap&&ae&&(O.adler=S.check=S.flags?o(S.check,Y,ae,O.next_out-ae):a(S.check,Y,ae,O.next_out-ae)),O.data_type=S.bits+(S.last?64:0)+(S.mode===12?128:0)+(S.mode===20||S.mode===15?256:0),(ie==0&&ae===0||X===4)&&U===p&&(U=-5),U)},n.inflateEnd=function(O){if(!O||!O.state)return g;var X=O.state;return X.window&&(X.window=null),O.state=null,p},n.inflateGetHeader=function(O,X){var S;return O&&O.state&&2&(S=O.state).wrap?((S.head=X).done=!1,p):g},n.inflateSetDictionary=function(O,X){var S,J=X.length;return O&&O.state?(S=O.state).wrap!==0&&S.mode!==11?g:S.mode===11&&a(1,X,J,0)!==S.check?-3:G(O,X,J,J)?(S.mode=31,-4):(S.havedict=1,p):g},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,r,n){var s=t("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(h,d,p,g,y,b,w,v){var A,E,_,C,I,k,D,R,z,G=v.bits,O=0,X=0,S=0,J=0,Y=0,W=0,fe=0,K=0,be=0,te=0,j=null,ie=0,ae=new s.Buf16(16),H=new s.Buf16(16),se=null,le=0;for(O=0;O<=15;O++)ae[O]=0;for(X=0;X<g;X++)ae[d[p+X]]++;for(Y=G,J=15;1<=J&&ae[J]===0;J--);if(J<Y&&(Y=J),J===0)return y[b++]=20971520,y[b++]=20971520,v.bits=1,0;for(S=1;S<J&&ae[S]===0;S++);for(Y<S&&(Y=S),O=K=1;O<=15;O++)if(K<<=1,(K-=ae[O])<0)return-1;if(0<K&&(h===0||J!==1))return-1;for(H[1]=0,O=1;O<15;O++)H[O+1]=H[O]+ae[O];for(X=0;X<g;X++)d[p+X]!==0&&(w[H[d[p+X]]++]=X);if(k=h===0?(j=se=w,19):h===1?(j=a,ie-=257,se=o,le-=257,256):(j=l,se=c,-1),O=S,I=b,fe=X=te=0,_=-1,C=(be=1<<(W=Y))-1,h===1&&852<be||h===2&&592<be)return 1;for(;;){for(D=O-fe,z=w[X]<k?(R=0,w[X]):w[X]>k?(R=se[le+w[X]],j[ie+w[X]]):(R=96,0),A=1<<O-fe,S=E=1<<W;y[I+(te>>fe)+(E-=A)]=D<<24|R<<16|z|0,E!==0;);for(A=1<<O-1;te&A;)A>>=1;if(A!==0?(te&=A-1,te+=A):te=0,X++,--ae[O]==0){if(O===J)break;O=d[p+w[X]]}if(Y<O&&(te&C)!==_){for(fe===0&&(fe=Y),I+=S,K=1<<(W=O-fe);W+fe<J&&!((K-=ae[W+fe])<=0);)W++,K<<=1;if(be+=1<<W,h===1&&852<be||h===2&&592<be)return 1;y[_=te&C]=Y<<24|W<<16|I-b|0}}return te!==0&&(y[I+te]=O-fe<<24|64<<16|0),v.bits=Y,0}},{"../utils/common":41}],51:[function(t,r,n){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,r,n){var s=t("../utils/common"),a=0,o=1;function l(M){for(var q=M.length;0<=--q;)M[q]=0}var c=0,h=29,d=256,p=d+1+h,g=30,y=19,b=2*p+1,w=15,v=16,A=7,E=256,_=16,C=17,I=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],D=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=new Array(2*(p+2));l(G);var O=new Array(2*g);l(O);var X=new Array(512);l(X);var S=new Array(256);l(S);var J=new Array(h);l(J);var Y,W,fe,K=new Array(g);function be(M,q,de,we,ee){this.static_tree=M,this.extra_bits=q,this.extra_base=de,this.elems=we,this.max_length=ee,this.has_stree=M&&M.length}function te(M,q){this.dyn_tree=M,this.max_code=0,this.stat_desc=q}function j(M){return M<256?X[M]:X[256+(M>>>7)]}function ie(M,q){M.pending_buf[M.pending++]=255&q,M.pending_buf[M.pending++]=q>>>8&255}function ae(M,q,de){M.bi_valid>v-de?(M.bi_buf|=q<<M.bi_valid&65535,ie(M,M.bi_buf),M.bi_buf=q>>v-M.bi_valid,M.bi_valid+=de-v):(M.bi_buf|=q<<M.bi_valid&65535,M.bi_valid+=de)}function H(M,q,de){ae(M,de[2*q],de[2*q+1])}function se(M,q){for(var de=0;de|=1&M,M>>>=1,de<<=1,0<--q;);return de>>>1}function le(M,q,de){var we,ee,Ee=new Array(w+1),De=0;for(we=1;we<=w;we++)Ee[we]=De=De+de[we-1]<<1;for(ee=0;ee<=q;ee++){var Ce=M[2*ee+1];Ce!==0&&(M[2*ee]=se(Ee[Ce]++,Ce))}}function oe(M){var q;for(q=0;q<p;q++)M.dyn_ltree[2*q]=0;for(q=0;q<g;q++)M.dyn_dtree[2*q]=0;for(q=0;q<y;q++)M.bl_tree[2*q]=0;M.dyn_ltree[2*E]=1,M.opt_len=M.static_len=0,M.last_lit=M.matches=0}function ce(M){8<M.bi_valid?ie(M,M.bi_buf):0<M.bi_valid&&(M.pending_buf[M.pending++]=M.bi_buf),M.bi_buf=0,M.bi_valid=0}function Ae(M,q,de,we){var ee=2*q,Ee=2*de;return M[ee]<M[Ee]||M[ee]===M[Ee]&&we[q]<=we[de]}function Se(M,q,de){for(var we=M.heap[de],ee=de<<1;ee<=M.heap_len&&(ee<M.heap_len&&Ae(q,M.heap[ee+1],M.heap[ee],M.depth)&&ee++,!Ae(q,we,M.heap[ee],M.depth));)M.heap[de]=M.heap[ee],de=ee,ee<<=1;M.heap[de]=we}function Ne(M,q,de){var we,ee,Ee,De,Ce=0;if(M.last_lit!==0)for(;we=M.pending_buf[M.d_buf+2*Ce]<<8|M.pending_buf[M.d_buf+2*Ce+1],ee=M.pending_buf[M.l_buf+Ce],Ce++,we===0?H(M,ee,q):(H(M,(Ee=S[ee])+d+1,q),(De=k[Ee])!==0&&ae(M,ee-=J[Ee],De),H(M,Ee=j(--we),de),(De=D[Ee])!==0&&ae(M,we-=K[Ee],De)),Ce<M.last_lit;);H(M,E,q)}function Te(M,q){var de,we,ee,Ee=q.dyn_tree,De=q.stat_desc.static_tree,Ce=q.stat_desc.has_stree,Me=q.stat_desc.elems,$e=-1;for(M.heap_len=0,M.heap_max=b,de=0;de<Me;de++)Ee[2*de]!==0?(M.heap[++M.heap_len]=$e=de,M.depth[de]=0):Ee[2*de+1]=0;for(;M.heap_len<2;)Ee[2*(ee=M.heap[++M.heap_len]=$e<2?++$e:0)]=1,M.depth[ee]=0,M.opt_len--,Ce&&(M.static_len-=De[2*ee+1]);for(q.max_code=$e,de=M.heap_len>>1;1<=de;de--)Se(M,Ee,de);for(ee=Me;de=M.heap[1],M.heap[1]=M.heap[M.heap_len--],Se(M,Ee,1),we=M.heap[1],M.heap[--M.heap_max]=de,M.heap[--M.heap_max]=we,Ee[2*ee]=Ee[2*de]+Ee[2*we],M.depth[ee]=(M.depth[de]>=M.depth[we]?M.depth[de]:M.depth[we])+1,Ee[2*de+1]=Ee[2*we+1]=ee,M.heap[1]=ee++,Se(M,Ee,1),2<=M.heap_len;);M.heap[--M.heap_max]=M.heap[1],function(Xe,Tt){var nr,yr,rr,ge,ve,he,me=Tt.dyn_tree,Fe=Tt.max_code,Ue=Tt.stat_desc.static_tree,st=Tt.stat_desc.has_stree,Ye=Tt.stat_desc.extra_bits,ct=Tt.stat_desc.extra_base,pt=Tt.stat_desc.max_length,mt=0;for(ge=0;ge<=w;ge++)Xe.bl_count[ge]=0;for(me[2*Xe.heap[Xe.heap_max]+1]=0,nr=Xe.heap_max+1;nr<b;nr++)pt<(ge=me[2*me[2*(yr=Xe.heap[nr])+1]+1]+1)&&(ge=pt,mt++),me[2*yr+1]=ge,Fe<yr||(Xe.bl_count[ge]++,ve=0,ct<=yr&&(ve=Ye[yr-ct]),he=me[2*yr],Xe.opt_len+=he*(ge+ve),st&&(Xe.static_len+=he*(Ue[2*yr+1]+ve)));if(mt!==0){do{for(ge=pt-1;Xe.bl_count[ge]===0;)ge--;Xe.bl_count[ge]--,Xe.bl_count[ge+1]+=2,Xe.bl_count[pt]--,mt-=2}while(0<mt);for(ge=pt;ge!==0;ge--)for(yr=Xe.bl_count[ge];yr!==0;)Fe<(rr=Xe.heap[--nr])||(me[2*rr+1]!==ge&&(Xe.opt_len+=(ge-me[2*rr+1])*me[2*rr],me[2*rr+1]=ge),yr--)}}(M,q),le(Ee,$e,M.bl_count)}function x(M,q,de){var we,ee,Ee=-1,De=q[1],Ce=0,Me=7,$e=4;for(De===0&&(Me=138,$e=3),q[2*(de+1)+1]=65535,we=0;we<=de;we++)ee=De,De=q[2*(we+1)+1],++Ce<Me&&ee===De||(Ce<$e?M.bl_tree[2*ee]+=Ce:ee!==0?(ee!==Ee&&M.bl_tree[2*ee]++,M.bl_tree[2*_]++):Ce<=10?M.bl_tree[2*C]++:M.bl_tree[2*I]++,Ee=ee,$e=(Ce=0)===De?(Me=138,3):ee===De?(Me=6,3):(Me=7,4))}function U(M,q,de){var we,ee,Ee=-1,De=q[1],Ce=0,Me=7,$e=4;for(De===0&&(Me=138,$e=3),we=0;we<=de;we++)if(ee=De,De=q[2*(we+1)+1],!(++Ce<Me&&ee===De)){if(Ce<$e)for(;H(M,ee,M.bl_tree),--Ce!=0;);else ee!==0?(ee!==Ee&&(H(M,ee,M.bl_tree),Ce--),H(M,_,M.bl_tree),ae(M,Ce-3,2)):Ce<=10?(H(M,C,M.bl_tree),ae(M,Ce-3,3)):(H(M,I,M.bl_tree),ae(M,Ce-11,7));Ee=ee,$e=(Ce=0)===De?(Me=138,3):ee===De?(Me=6,3):(Me=7,4)}}l(K);var B=!1;function F(M,q,de,we){ae(M,(c<<1)+(we?1:0),3),function(ee,Ee,De,Ce){ce(ee),ie(ee,De),ie(ee,~De),s.arraySet(ee.pending_buf,ee.window,Ee,De,ee.pending),ee.pending+=De}(M,q,de)}n._tr_init=function(M){B||(function(){var q,de,we,ee,Ee,De=new Array(w+1);for(ee=we=0;ee<h-1;ee++)for(J[ee]=we,q=0;q<1<<k[ee];q++)S[we++]=ee;for(S[we-1]=ee,ee=Ee=0;ee<16;ee++)for(K[ee]=Ee,q=0;q<1<<D[ee];q++)X[Ee++]=ee;for(Ee>>=7;ee<g;ee++)for(K[ee]=Ee<<7,q=0;q<1<<D[ee]-7;q++)X[256+Ee++]=ee;for(de=0;de<=w;de++)De[de]=0;for(q=0;q<=143;)G[2*q+1]=8,q++,De[8]++;for(;q<=255;)G[2*q+1]=9,q++,De[9]++;for(;q<=279;)G[2*q+1]=7,q++,De[7]++;for(;q<=287;)G[2*q+1]=8,q++,De[8]++;for(le(G,p+1,De),q=0;q<g;q++)O[2*q+1]=5,O[2*q]=se(q,5);Y=new be(G,k,d+1,p,w),W=new be(O,D,0,g,w),fe=new be(new Array(0),R,0,y,A)}(),B=!0),M.l_desc=new te(M.dyn_ltree,Y),M.d_desc=new te(M.dyn_dtree,W),M.bl_desc=new te(M.bl_tree,fe),M.bi_buf=0,M.bi_valid=0,oe(M)},n._tr_stored_block=F,n._tr_flush_block=function(M,q,de,we){var ee,Ee,De=0;0<M.level?(M.strm.data_type===2&&(M.strm.data_type=function(Ce){var Me,$e=4093624447;for(Me=0;Me<=31;Me++,$e>>>=1)if(1&$e&&Ce.dyn_ltree[2*Me]!==0)return a;if(Ce.dyn_ltree[18]!==0||Ce.dyn_ltree[20]!==0||Ce.dyn_ltree[26]!==0)return o;for(Me=32;Me<d;Me++)if(Ce.dyn_ltree[2*Me]!==0)return o;return a}(M)),Te(M,M.l_desc),Te(M,M.d_desc),De=function(Ce){var Me;for(x(Ce,Ce.dyn_ltree,Ce.l_desc.max_code),x(Ce,Ce.dyn_dtree,Ce.d_desc.max_code),Te(Ce,Ce.bl_desc),Me=y-1;3<=Me&&Ce.bl_tree[2*z[Me]+1]===0;Me--);return Ce.opt_len+=3*(Me+1)+5+5+4,Me}(M),ee=M.opt_len+3+7>>>3,(Ee=M.static_len+3+7>>>3)<=ee&&(ee=Ee)):ee=Ee=de+5,de+4<=ee&&q!==-1?F(M,q,de,we):M.strategy===4||Ee===ee?(ae(M,2+(we?1:0),3),Ne(M,G,O)):(ae(M,4+(we?1:0),3),function(Ce,Me,$e,Xe){var Tt;for(ae(Ce,Me-257,5),ae(Ce,$e-1,5),ae(Ce,Xe-4,4),Tt=0;Tt<Xe;Tt++)ae(Ce,Ce.bl_tree[2*z[Tt]+1],3);U(Ce,Ce.dyn_ltree,Me-1),U(Ce,Ce.dyn_dtree,$e-1)}(M,M.l_desc.max_code+1,M.d_desc.max_code+1,De+1),Ne(M,M.dyn_ltree,M.dyn_dtree)),oe(M),we&&ce(M)},n._tr_tally=function(M,q,de){return M.pending_buf[M.d_buf+2*M.last_lit]=q>>>8&255,M.pending_buf[M.d_buf+2*M.last_lit+1]=255&q,M.pending_buf[M.l_buf+M.last_lit]=255&de,M.last_lit++,q===0?M.dyn_ltree[2*de]++:(M.matches++,q--,M.dyn_ltree[2*(S[de]+d+1)]++,M.dyn_dtree[2*j(q)]++),M.last_lit===M.lit_bufsize-1},n._tr_align=function(M){ae(M,2,3),H(M,E,G),function(q){q.bi_valid===16?(ie(q,q.bi_buf),q.bi_buf=0,q.bi_valid=0):8<=q.bi_valid&&(q.pending_buf[q.pending++]=255&q.bi_buf,q.bi_buf>>=8,q.bi_valid-=8)}(M)}},{"../utils/common":41}],53:[function(t,r,n){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,r,n){(function(s){(function(a,o){if(!a.setImmediate){var l,c,h,d,p=1,g={},y=!1,b=a.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(a);w=w&&w.setTimeout?w:a,l={}.toString.call(a.process)==="[object process]"?function(_){process.nextTick(function(){A(_)})}:function(){if(a.postMessage&&!a.importScripts){var _=!0,C=a.onmessage;return a.onmessage=function(){_=!1},a.postMessage("","*"),a.onmessage=C,_}}()?(d="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",E,!1):a.attachEvent("onmessage",E),function(_){a.postMessage(d+_,"*")}):a.MessageChannel?((h=new MessageChannel).port1.onmessage=function(_){A(_.data)},function(_){h.port2.postMessage(_)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,function(_){var C=b.createElement("script");C.onreadystatechange=function(){A(_),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(_){setTimeout(A,0,_)},w.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),I=0;I<C.length;I++)C[I]=arguments[I+1];var k={callback:_,args:C};return g[p]=k,l(p),p++},w.clearImmediate=v}function v(_){delete g[_]}function A(_){if(y)setTimeout(A,0,_);else{var C=g[_];if(C){y=!0;try{(function(I){var k=I.callback,D=I.args;switch(D.length){case 0:k();break;case 1:k(D[0]);break;case 2:k(D[0],D[1]);break;case 3:k(D[0],D[1],D[2]);break;default:k.apply(o,D)}})(C)}finally{v(_),y=!1}}}}function E(_){_.source===a&&typeof _.data=="string"&&_.data.indexOf(d)===0&&A(+_.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof sh<"u"?sh:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(HA);var FR=HA.exports;const BR=_g(FR);/*
70
+ \0`,ae+=s(te,2),ae+=I.magic,ae+=s(E,2),ae+=s(_,2),ae+=s(be.crc32,4),ae+=s(be.compressedSize,4),ae+=s(be.uncompressedSize,4),ae+=s(D.length,2),ae+=s(J.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ae+D+J,dirRecord:d.CENTRAL_FILE_HEADER+s(ie,2)+ae+s(G.length,2)+"\0\0\0\0"+s(j,4)+s(w,4)+D+J+G}}var o=t("../utils"),l=t("../stream/GenericWorker"),c=t("../utf8"),h=t("../crc32"),d=t("../signature");function p(g,y,b,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=b,this.encodeFileName=w,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(p,l),p.prototype.push=function(g){var y=g.meta.percent||0,b=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,l.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:b?(y+100*(b-w-1))/b:100}}))},p.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var y=this.streamFiles&&!g.file.dir;if(y){var b=a(g,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:b.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(g){this.accumulate=!1;var y=this.streamFiles&&!g.file.dir,b=a(g,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(b.dirRecord),y)this.push({data:function(w){return d.DATA_DESCRIPTOR+s(w.crc32,4)+s(w.compressedSize,4)+s(w.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:b.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var g=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var b=this.bytesWritten-g,w=function(v,A,E,_,C){var I=o.transformTo("string",C(_));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(v,2)+s(v,2)+s(A,4)+s(E,4)+s(I.length,2)+I}(this.dirRecords.length,b,g,this.zipComment,this.encodeFileName);this.push({data:w,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(g){this._sources.push(g);var y=this;return g.on("data",function(b){y.processChunk(b)}),g.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),g.on("error",function(b){y.error(b)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(g){var y=this._sources;if(!l.prototype.error.call(this,g))return!1;for(var b=0;b<y.length;b++)try{y[b].error(g)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var g=this._sources,y=0;y<g.length;y++)g[y].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,r,n){var s=t("../compressions"),a=t("./ZipFileWorker");n.generateWorker=function(o,l,c){var h=new a(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{o.forEach(function(p,g){d++;var y=function(A,E){var _=A||E,C=s[_];if(!C)throw new Error(_+" is not a valid compression method !");return C}(g.options.compression,l.compression),b=g.options.compressionOptions||l.compressionOptions||{},w=g.dir,v=g.date;g._compressWorker(y,b).withStreamInfo("file",{name:p,dir:w,date:v,comment:g.comment||"",unixPermissions:g.unixPermissions,dosPermissions:g.dosPermissions}).pipe(h)}),h.entriesCount=d}catch(p){h.error(p)}return h}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,r,n){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var a=new s;for(var o in this)typeof this[o]!="function"&&(a[o]=this[o]);return a}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(a,o){return new s().loadAsync(a,o)},s.external=t("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,r,n){var s=t("./utils"),a=t("./external"),o=t("./utf8"),l=t("./zipEntries"),c=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function d(p){return new a.Promise(function(g,y){var b=p.decompressed.getContentWorker().pipe(new c);b.on("error",function(w){y(w)}).on("end",function(){b.streamInfo.crc32!==p.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}r.exports=function(p,g){var y=this;return g=s.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),h.isNode&&h.isStream(p)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,g.optimizedBinaryString,g.base64).then(function(b){var w=new l(g);return w.load(b),w}).then(function(b){var w=[a.Promise.resolve(b)],v=b.files;if(g.checkCRC32)for(var A=0;A<v.length;A++)w.push(d(v[A]));return a.Promise.all(w)}).then(function(b){for(var w=b.shift(),v=w.files,A=0;A<v.length;A++){var E=v[A],_=E.fileNameStr,C=s.resolve(E.fileNameStr);y.file(C,E.decompressed,{binary:!0,optimizedBinaryString:!0,date:E.date,dir:E.dir,comment:E.fileCommentStr.length?E.fileCommentStr:null,unixPermissions:E.unixPermissions,dosPermissions:E.dosPermissions,createFolders:g.createFolders}),E.dir||(y.file(C).unsafeOriginalName=_)}return w.zipComment.length&&(y.comment=w.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,r,n){var s=t("../utils"),a=t("../stream/GenericWorker");function o(l,c){a.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}s.inherits(o,a),o.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(h){c.push({data:h,meta:{percent:0}})}).on("error",function(h){c.isPaused?this.generatedError=h:c.error(h)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},o.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,r,n){var s=t("readable-stream").Readable;function a(o,l,c){s.call(this,l),this._helper=o;var h=this;o.on("data",function(d,p){h.push(d)||h._helper.pause(),c&&c(p)}).on("error",function(d){h.emit("error",d)}).on("end",function(){h.push(null)})}t("../utils").inherits(a,s),a.prototype._read=function(){this._helper.resume()},r.exports=a},{"../utils":32,"readable-stream":16}],14:[function(t,r,n){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,a);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,a)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var a=new Buffer(s);return a.fill(0),a},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(t,r,n){function s(C,I,k){var D,R=o.getTypeOf(I),z=o.extend(k||{},h);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(C=v(C)),z.createFolders&&(D=w(C))&&A.call(this,D,!0);var G=R==="string"&&z.binary===!1&&z.base64===!1;k&&k.binary!==void 0||(z.binary=!G),(I instanceof d&&I.uncompressedSize===0||z.dir||!I||I.length===0)&&(z.base64=!1,z.binary=!0,I="",z.compression="STORE",R="string");var O=null;O=I instanceof d||I instanceof l?I:y.isNode&&y.isStream(I)?new b(C,I):o.prepareContent(C,I,z.binary,z.optimizedBinaryString,z.base64);var X=new p(C,O,z);this.files[C]=X}var a=t("./utf8"),o=t("./utils"),l=t("./stream/GenericWorker"),c=t("./stream/StreamHelper"),h=t("./defaults"),d=t("./compressedObject"),p=t("./zipObject"),g=t("./generate"),y=t("./nodejsUtils"),b=t("./nodejs/NodejsStreamInputAdapter"),w=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var I=C.lastIndexOf("/");return 0<I?C.substring(0,I):""},v=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},A=function(C,I){return I=I!==void 0?I:h.createFolders,C=v(C),this.files[C]||s.call(this,C,null,{dir:!0,createFolders:I}),this.files[C]};function E(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var I,k,D;for(I in this.files)D=this.files[I],(k=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&C(k,D)},filter:function(C){var I=[];return this.forEach(function(k,D){C(k,D)&&I.push(D)}),I},file:function(C,I,k){if(arguments.length!==1)return C=this.root+C,s.call(this,C,I,k),this;if(E(C)){var D=C;return this.filter(function(z,G){return!G.dir&&D.test(z)})}var R=this.files[this.root+C];return R&&!R.dir?R:null},folder:function(C){if(!C)return this;if(E(C))return this.filter(function(R,z){return z.dir&&C.test(R)});var I=this.root+C,k=A.call(this,I),D=this.clone();return D.root=k.name,D},remove:function(C){C=this.root+C;var I=this.files[C];if(I||(C.slice(-1)!=="/"&&(C+="/"),I=this.files[C]),I&&!I.dir)delete this.files[C];else for(var k=this.filter(function(R,z){return z.name.slice(0,C.length)===C}),D=0;D<k.length;D++)delete this.files[k[D].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var I,k={};try{if((k=o.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=k.type.toLowerCase(),k.compression=k.compression.toUpperCase(),k.type==="binarystring"&&(k.type="string"),!k.type)throw new Error("No output type specified.");o.checkSupport(k.type),k.platform!=="darwin"&&k.platform!=="freebsd"&&k.platform!=="linux"&&k.platform!=="sunos"||(k.platform="UNIX"),k.platform==="win32"&&(k.platform="DOS");var D=k.comment||this.comment||"";I=g.generateWorker(this,k,D)}catch(R){(I=new l("error")).error(R)}return new c(I,k.type||"string",k.mimeType)},generateAsync:function(C,I){return this.generateInternalStream(C).accumulate(I)},generateNodeStream:function(C,I){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(I)}};r.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,r,n){r.exports=t("stream")},{stream:void 0}],17:[function(t,r,n){var s=t("./DataReader");function a(o){s.call(this,o);for(var l=0;l<this.data.length;l++)o[l]=255&o[l]}t("../utils").inherits(a,s),a.prototype.byteAt=function(o){return this.data[this.zero+o]},a.prototype.lastIndexOfSignature=function(o){for(var l=o.charCodeAt(0),c=o.charCodeAt(1),h=o.charCodeAt(2),d=o.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===h&&this.data[p+3]===d)return p-this.zero;return-1},a.prototype.readAndCheckSignature=function(o){var l=o.charCodeAt(0),c=o.charCodeAt(1),h=o.charCodeAt(2),d=o.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&h===p[2]&&d===p[3]},a.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./DataReader":18}],18:[function(t,r,n){var s=t("../utils");function a(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var l,c=0;for(this.checkOffset(o),l=this.index+o-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=o,c},readString:function(o){return s.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},r.exports=a},{"../utils":32}],19:[function(t,r,n){var s=t("./Uint8ArrayReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,r,n){var s=t("./DataReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},a.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},a.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},a.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./DataReader":18}],21:[function(t,r,n){var s=t("./ArrayReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(t,r,n){var s=t("../utils"),a=t("../support"),o=t("./ArrayReader"),l=t("./StringReader"),c=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");r.exports=function(d){var p=s.getTypeOf(d);return s.checkSupport(p),p!=="string"||a.uint8array?p==="nodebuffer"?new c(d):a.uint8array?new h(s.transformTo("uint8array",d)):new o(s.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,r,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,r,n){var s=t("./GenericWorker"),a=t("../utils");function o(l){s.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(o,s),o.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},r.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,r,n){var s=t("./GenericWorker"),a=t("../crc32");function o(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,s),o.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,r,n){var s=t("../utils"),a=t("./GenericWorker");function o(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(o,a),o.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},r.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,r,n){var s=t("../utils"),a=t("./GenericWorker");function o(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(h){c.dataIsReady=!0,c.data=h,c.max=h&&h.length||0,c.type=s.getTypeOf(h),c.isPaused||c._tickAndRepeat()},function(h){c.error(h)})}s.inherits(o,a),o.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,r,n){function s(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,o){return this._listeners[a].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,o){if(this._listeners[a])for(var l=0;l<this._listeners[a].length;l++)this._listeners[a][l].call(this,o)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var o=this;return a.on("data",function(l){o.processChunk(l)}),a.on("end",function(){o.end()}),a.on("error",function(l){o.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,o){return this.extraStreamInfo[a]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},r.exports=s},{}],29:[function(t,r,n){var s=t("../utils"),a=t("./ConvertWorker"),o=t("./GenericWorker"),l=t("../base64"),c=t("../support"),h=t("../external"),d=null;if(c.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,b){return new h.Promise(function(w,v){var A=[],E=y._internalType,_=y._outputType,C=y._mimeType;y.on("data",function(I,k){A.push(I),b&&b(k)}).on("error",function(I){A=[],v(I)}).on("end",function(){try{var I=function(k,D,R){switch(k){case"blob":return s.newBlob(s.transformTo("arraybuffer",D),R);case"base64":return l.encode(D);default:return s.transformTo(k,D)}}(_,function(k,D){var R,z=0,G=null,O=0;for(R=0;R<D.length;R++)O+=D[R].length;switch(k){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(G=new Uint8Array(O),R=0;R<D.length;R++)G.set(D[R],z),z+=D[R].length;return G;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+k+"'")}}(E,A),C);w(I)}catch(k){v(k)}A=[]}).resume()})}function g(y,b,w){var v=b;switch(b){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=b,this._mimeType=w,s.checkSupport(v),this._worker=y.pipe(new a(v)),y.lock()}catch(A){this._worker=new o("error"),this._worker.error(A)}}g.prototype={accumulate:function(y){return p(this,y)},on:function(y,b){var w=this;return y==="data"?this._worker.on(y,function(v){b.call(w,v.data,v.meta)}):this._worker.on(y,function(){s.delay(b,arguments,w)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},y)}},r.exports=g},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,r,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",n.nodebuffer=typeof Buffer<"u",n.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(s),n.blob=a.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(t,r,n){for(var s=t("./utils"),a=t("./support"),o=t("./nodejsUtils"),l=t("./stream/GenericWorker"),c=new Array(256),h=0;h<256;h++)c[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}n.utf8encode=function(g){return a.nodebuffer?o.newBufferFrom(g,"utf-8"):function(y){var b,w,v,A,E,_=y.length,C=0;for(A=0;A<_;A++)(64512&(w=y.charCodeAt(A)))==55296&&A+1<_&&(64512&(v=y.charCodeAt(A+1)))==56320&&(w=65536+(w-55296<<10)+(v-56320),A++),C+=w<128?1:w<2048?2:w<65536?3:4;for(b=a.uint8array?new Uint8Array(C):new Array(C),A=E=0;E<C;A++)(64512&(w=y.charCodeAt(A)))==55296&&A+1<_&&(64512&(v=y.charCodeAt(A+1)))==56320&&(w=65536+(w-55296<<10)+(v-56320),A++),w<128?b[E++]=w:(w<2048?b[E++]=192|w>>>6:(w<65536?b[E++]=224|w>>>12:(b[E++]=240|w>>>18,b[E++]=128|w>>>12&63),b[E++]=128|w>>>6&63),b[E++]=128|63&w);return b}(g)},n.utf8decode=function(g){return a.nodebuffer?s.transformTo("nodebuffer",g).toString("utf-8"):function(y){var b,w,v,A,E=y.length,_=new Array(2*E);for(b=w=0;b<E;)if((v=y[b++])<128)_[w++]=v;else if(4<(A=c[v]))_[w++]=65533,b+=A-1;else{for(v&=A===2?31:A===3?15:7;1<A&&b<E;)v=v<<6|63&y[b++],A--;1<A?_[w++]=65533:v<65536?_[w++]=v:(v-=65536,_[w++]=55296|v>>10&1023,_[w++]=56320|1023&v)}return _.length!==w&&(_.subarray?_=_.subarray(0,w):_.length=w),s.applyFromCharCode(_)}(g=s.transformTo(a.uint8array?"uint8array":"array",g))},s.inherits(d,l),d.prototype.processChunk=function(g){var y=s.transformTo(a.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var b=y;(y=new Uint8Array(b.length+this.leftOver.length)).set(this.leftOver,0),y.set(b,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var w=function(A,E){var _;for((E=E||A.length)>A.length&&(E=A.length),_=E-1;0<=_&&(192&A[_])==128;)_--;return _<0||_===0?E:_+c[A[_]]>E?_:E}(y),v=y;w!==y.length&&(a.uint8array?(v=y.subarray(0,w),this.leftOver=y.subarray(w,y.length)):(v=y.slice(0,w),this.leftOver=y.slice(w,y.length))),this.push({data:n.utf8decode(v),meta:g.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=d,s.inherits(p,l),p.prototype.processChunk=function(g){this.push({data:n.utf8encode(g.data),meta:g.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,r,n){var s=t("./support"),a=t("./base64"),o=t("./nodejsUtils"),l=t("./external");function c(b){return b}function h(b,w){for(var v=0;v<b.length;++v)w[v]=255&b.charCodeAt(v);return w}t("setimmediate"),n.newBlob=function(b,w){n.checkSupport("blob");try{return new Blob([b],{type:w})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(b),v.getBlob(w)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(b,w,v){var A=[],E=0,_=b.length;if(_<=v)return String.fromCharCode.apply(null,b);for(;E<_;)w==="array"||w==="nodebuffer"?A.push(String.fromCharCode.apply(null,b.slice(E,Math.min(E+v,_)))):A.push(String.fromCharCode.apply(null,b.subarray(E,Math.min(E+v,_)))),E+=v;return A.join("")},stringifyByChar:function(b){for(var w="",v=0;v<b.length;v++)w+=String.fromCharCode(b[v]);return w},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}}()}};function p(b){var w=65536,v=n.getTypeOf(b),A=!0;if(v==="uint8array"?A=d.applyCanBeUsed.uint8array:v==="nodebuffer"&&(A=d.applyCanBeUsed.nodebuffer),A)for(;1<w;)try{return d.stringifyByChunk(b,v,w)}catch{w=Math.floor(w/2)}return d.stringifyByChar(b)}function g(b,w){for(var v=0;v<b.length;v++)w[v]=b[v];return w}n.applyFromCharCode=p;var y={};y.string={string:c,array:function(b){return h(b,new Array(b.length))},arraybuffer:function(b){return y.string.uint8array(b).buffer},uint8array:function(b){return h(b,new Uint8Array(b.length))},nodebuffer:function(b){return h(b,o.allocBuffer(b.length))}},y.array={string:p,array:c,arraybuffer:function(b){return new Uint8Array(b).buffer},uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return o.newBufferFrom(b)}},y.arraybuffer={string:function(b){return p(new Uint8Array(b))},array:function(b){return g(new Uint8Array(b),new Array(b.byteLength))},arraybuffer:c,uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return o.newBufferFrom(new Uint8Array(b))}},y.uint8array={string:p,array:function(b){return g(b,new Array(b.length))},arraybuffer:function(b){return b.buffer},uint8array:c,nodebuffer:function(b){return o.newBufferFrom(b)}},y.nodebuffer={string:p,array:function(b){return g(b,new Array(b.length))},arraybuffer:function(b){return y.nodebuffer.uint8array(b).buffer},uint8array:function(b){return g(b,new Uint8Array(b.length))},nodebuffer:c},n.transformTo=function(b,w){if(w=w||"",!b)return w;n.checkSupport(b);var v=n.getTypeOf(w);return y[v][b](w)},n.resolve=function(b){for(var w=b.split("/"),v=[],A=0;A<w.length;A++){var E=w[A];E==="."||E===""&&A!==0&&A!==w.length-1||(E===".."?v.pop():v.push(E))}return v.join("/")},n.getTypeOf=function(b){return typeof b=="string"?"string":Object.prototype.toString.call(b)==="[object Array]"?"array":s.nodebuffer&&o.isBuffer(b)?"nodebuffer":s.uint8array&&b instanceof Uint8Array?"uint8array":s.arraybuffer&&b instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(b){if(!s[b.toLowerCase()])throw new Error(b+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(b){var w,v,A="";for(v=0;v<(b||"").length;v++)A+="\\x"+((w=b.charCodeAt(v))<16?"0":"")+w.toString(16).toUpperCase();return A},n.delay=function(b,w,v){setImmediate(function(){b.apply(v||null,w||[])})},n.inherits=function(b,w){function v(){}v.prototype=w.prototype,b.prototype=new v},n.extend=function(){var b,w,v={};for(b=0;b<arguments.length;b++)for(w in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],w)&&v[w]===void 0&&(v[w]=arguments[b][w]);return v},n.prepareContent=function(b,w,v,A,E){return l.Promise.resolve(w).then(function(_){return s.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,I){var k=new FileReader;k.onload=function(D){C(D.target.result)},k.onerror=function(D){I(D.target.error)},k.readAsArrayBuffer(_)}):_}).then(function(_){var C=n.getTypeOf(_);return C?(C==="arraybuffer"?_=n.transformTo("uint8array",_):C==="string"&&(E?_=a.decode(_):v&&A!==!0&&(_=function(I){return h(I,s.uint8array?new Uint8Array(I.length):new Array(I.length))}(_))),_):l.Promise.reject(new Error("Can't read the data of '"+b+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,r,n){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./signature"),l=t("./zipEntry"),c=t("./support");function h(d){this.files=[],this.loadOptions=d}h.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(p)+", expected "+a.pretty(d)+")")}},isSignature:function(d,p){var g=this.reader.index;this.reader.setIndex(d);var y=this.reader.readString(4)===p;return this.reader.setIndex(g),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",g=a.transformTo(p,d);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,p,g,y=this.zip64EndOfCentralSize-44;0<y;)d=this.reader.readInt(2),p=this.reader.readInt(4),g=this.reader.readData(p),this.zip64ExtensibleData[d]={id:d,length:p,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,p;for(d=0;d<this.files.length;d++)p=this.files[d],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var p=d;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var g=this.centralDirOffset+this.centralDirSize;this.zip64&&(g+=20,g+=12+this.zip64EndOfCentralSize);var y=p-g;if(0<y)this.isSignature(p,o.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,r,n){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./compressedObject"),l=t("./crc32"),c=t("./utf8"),h=t("./compressions"),d=t("./support");function p(g,y){this.options=g,this.loadOptions=y}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(g){var y,b;if(g.skip(22),this.fileNameLength=g.readInt(2),b=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(b),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((y=function(w){for(var v in h)if(Object.prototype.hasOwnProperty.call(h,v)&&h[v].magic===w)return h[v];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,y,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var y=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(y),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=s(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var y,b,w,v=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4<v;)y=g.readInt(2),b=g.readInt(2),w=g.readData(b),this.extraFields[y]={id:y,length:b,value:w};g.setIndex(v)},handleUTF8:function(){var g=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var b=a.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(b)}var w=this.findExtraFieldUnicodeComment();if(w!==null)this.fileCommentStr=w;else{var v=a.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var y=s(g.value);return y.readInt(1)!==1||l(this.fileName)!==y.readInt(4)?null:c.utf8decode(y.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var y=s(g.value);return y.readInt(1)!==1||l(this.fileComment)!==y.readInt(4)?null:c.utf8decode(y.readData(g.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,r,n){function s(y,b,w){this.name=y,this.dir=w.dir,this.date=w.date,this.comment=w.comment,this.unixPermissions=w.unixPermissions,this.dosPermissions=w.dosPermissions,this._data=b,this._dataBinary=w.binary,this.options={compression:w.compression,compressionOptions:w.compressionOptions}}var a=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),l=t("./utf8"),c=t("./compressedObject"),h=t("./stream/GenericWorker");s.prototype={internalStream:function(y){var b=null,w="string";try{if(!y)throw new Error("No output type specified.");var v=(w=y.toLowerCase())==="string"||w==="text";w!=="binarystring"&&w!=="text"||(w="string"),b=this._decompressWorker();var A=!this._dataBinary;A&&!v&&(b=b.pipe(new l.Utf8EncodeWorker)),!A&&v&&(b=b.pipe(new l.Utf8DecodeWorker))}catch(E){(b=new h("error")).error(E)}return new a(b,w,"")},async:function(y,b){return this.internalStream(y).accumulate(b)},nodeStream:function(y,b){return this.internalStream(y||"nodebuffer").toNodejsStream(b)},_compressWorker:function(y,b){if(this._data instanceof c&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var w=this._decompressWorker();return this._dataBinary||(w=w.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(w,y,b)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<d.length;g++)s.prototype[d[g]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,r,n){(function(s){var a,o,l=s.MutationObserver||s.WebKitMutationObserver;if(l){var c=0,h=new l(y),d=s.document.createTextNode("");h.observe(d,{characterData:!0}),a=function(){d.data=c=++c%2}}else if(s.setImmediate||s.MessageChannel===void 0)a="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var b=s.document.createElement("script");b.onreadystatechange=function(){y(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},s.document.documentElement.appendChild(b)}:function(){setTimeout(y,0)};else{var p=new s.MessageChannel;p.port1.onmessage=y,a=function(){p.port2.postMessage(0)}}var g=[];function y(){var b,w;o=!0;for(var v=g.length;v;){for(w=g,g=[],b=-1;++b<v;)w[b]();v=g.length}o=!1}r.exports=function(b){g.push(b)!==1||o||a()}}).call(this,typeof sh<"u"?sh:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,r,n){var s=t("immediate");function a(){}var o={},l=["REJECTED"],c=["FULFILLED"],h=["PENDING"];function d(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,v!==a&&b(this,v)}function p(v,A,E){this.promise=v,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}function g(v,A,E){s(function(){var _;try{_=A(E)}catch(C){return o.reject(v,C)}_===v?o.reject(v,new TypeError("Cannot resolve promise with itself")):o.resolve(v,_)})}function y(v){var A=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof A=="function")return function(){A.apply(v,arguments)}}function b(v,A){var E=!1;function _(k){E||(E=!0,o.reject(v,k))}function C(k){E||(E=!0,o.resolve(v,k))}var I=w(function(){A(C,_)});I.status==="error"&&_(I.value)}function w(v,A){var E={};try{E.value=v(A),E.status="success"}catch(_){E.status="error",E.value=_}return E}(r.exports=d).prototype.finally=function(v){if(typeof v!="function")return this;var A=this.constructor;return this.then(function(E){return A.resolve(v()).then(function(){return E})},function(E){return A.resolve(v()).then(function(){throw E})})},d.prototype.catch=function(v){return this.then(null,v)},d.prototype.then=function(v,A){if(typeof v!="function"&&this.state===c||typeof A!="function"&&this.state===l)return this;var E=new this.constructor(a);return this.state!==h?g(E,this.state===c?v:A,this.outcome):this.queue.push(new p(E,v,A)),E},p.prototype.callFulfilled=function(v){o.resolve(this.promise,v)},p.prototype.otherCallFulfilled=function(v){g(this.promise,this.onFulfilled,v)},p.prototype.callRejected=function(v){o.reject(this.promise,v)},p.prototype.otherCallRejected=function(v){g(this.promise,this.onRejected,v)},o.resolve=function(v,A){var E=w(y,A);if(E.status==="error")return o.reject(v,E.value);var _=E.value;if(_)b(v,_);else{v.state=c,v.outcome=A;for(var C=-1,I=v.queue.length;++C<I;)v.queue[C].callFulfilled(A)}return v},o.reject=function(v,A){v.state=l,v.outcome=A;for(var E=-1,_=v.queue.length;++E<_;)v.queue[E].callRejected(A);return v},d.resolve=function(v){return v instanceof this?v:o.resolve(new this(a),v)},d.reject=function(v){var A=new this(a);return o.reject(A,v)},d.all=function(v){var A=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,_=!1;if(!E)return this.resolve([]);for(var C=new Array(E),I=0,k=-1,D=new this(a);++k<E;)R(v[k],k);return D;function R(z,G){A.resolve(z).then(function(O){C[G]=O,++I!==E||_||(_=!0,o.resolve(D,C))},function(O){_||(_=!0,o.reject(D,O))})}},d.race=function(v){var A=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,_=!1;if(!E)return this.resolve([]);for(var C=-1,I=new this(a);++C<E;)k=v[C],A.resolve(k).then(function(D){_||(_=!0,o.resolve(I,D))},function(D){_||(_=!0,o.reject(I,D))});var k;return I}},{immediate:36}],38:[function(t,r,n){var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,r,n){var s=t("./zlib/deflate"),a=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/messages"),c=t("./zlib/zstream"),h=Object.prototype.toString,d=0,p=-1,g=0,y=8;function b(v){if(!(this instanceof b))return new b(v);this.options=a.assign({level:p,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},v||{});var A=this.options;A.raw&&0<A.windowBits?A.windowBits=-A.windowBits:A.gzip&&0<A.windowBits&&A.windowBits<16&&(A.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var E=s.deflateInit2(this.strm,A.level,A.method,A.windowBits,A.memLevel,A.strategy);if(E!==d)throw new Error(l[E]);if(A.header&&s.deflateSetHeader(this.strm,A.header),A.dictionary){var _;if(_=typeof A.dictionary=="string"?o.string2buf(A.dictionary):h.call(A.dictionary)==="[object ArrayBuffer]"?new Uint8Array(A.dictionary):A.dictionary,(E=s.deflateSetDictionary(this.strm,_))!==d)throw new Error(l[E]);this._dict_set=!0}}function w(v,A){var E=new b(A);if(E.push(v,!0),E.err)throw E.msg||l[E.err];return E.result}b.prototype.push=function(v,A){var E,_,C=this.strm,I=this.options.chunkSize;if(this.ended)return!1;_=A===~~A?A:A===!0?4:0,typeof v=="string"?C.input=o.string2buf(v):h.call(v)==="[object ArrayBuffer]"?C.input=new Uint8Array(v):C.input=v,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new a.Buf8(I),C.next_out=0,C.avail_out=I),(E=s.deflate(C,_))!==1&&E!==d)return this.onEnd(E),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(a.shrinkBuf(C.output,C.next_out))):this.onData(a.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&E!==1);return _===4?(E=s.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===d):_!==2||(this.onEnd(d),!(C.avail_out=0))},b.prototype.onData=function(v){this.chunks.push(v)},b.prototype.onEnd=function(v){v===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},n.Deflate=b,n.deflate=w,n.deflateRaw=function(v,A){return(A=A||{}).raw=!0,w(v,A)},n.gzip=function(v,A){return(A=A||{}).gzip=!0,w(v,A)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,r,n){var s=t("./zlib/inflate"),a=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/constants"),c=t("./zlib/messages"),h=t("./zlib/zstream"),d=t("./zlib/gzheader"),p=Object.prototype.toString;function g(b){if(!(this instanceof g))return new g(b);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},b||{});var w=this.options;w.raw&&0<=w.windowBits&&w.windowBits<16&&(w.windowBits=-w.windowBits,w.windowBits===0&&(w.windowBits=-15)),!(0<=w.windowBits&&w.windowBits<16)||b&&b.windowBits||(w.windowBits+=32),15<w.windowBits&&w.windowBits<48&&!(15&w.windowBits)&&(w.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var v=s.inflateInit2(this.strm,w.windowBits);if(v!==l.Z_OK)throw new Error(c[v]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function y(b,w){var v=new g(w);if(v.push(b,!0),v.err)throw v.msg||c[v.err];return v.result}g.prototype.push=function(b,w){var v,A,E,_,C,I,k=this.strm,D=this.options.chunkSize,R=this.options.dictionary,z=!1;if(this.ended)return!1;A=w===~~w?w:w===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof b=="string"?k.input=o.binstring2buf(b):p.call(b)==="[object ArrayBuffer]"?k.input=new Uint8Array(b):k.input=b,k.next_in=0,k.avail_in=k.input.length;do{if(k.avail_out===0&&(k.output=new a.Buf8(D),k.next_out=0,k.avail_out=D),(v=s.inflate(k,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&R&&(I=typeof R=="string"?o.string2buf(R):p.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,v=s.inflateSetDictionary(this.strm,I)),v===l.Z_BUF_ERROR&&z===!0&&(v=l.Z_OK,z=!1),v!==l.Z_STREAM_END&&v!==l.Z_OK)return this.onEnd(v),!(this.ended=!0);k.next_out&&(k.avail_out!==0&&v!==l.Z_STREAM_END&&(k.avail_in!==0||A!==l.Z_FINISH&&A!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(E=o.utf8border(k.output,k.next_out),_=k.next_out-E,C=o.buf2string(k.output,E),k.next_out=_,k.avail_out=D-_,_&&a.arraySet(k.output,k.output,E,_,0),this.onData(C)):this.onData(a.shrinkBuf(k.output,k.next_out)))),k.avail_in===0&&k.avail_out===0&&(z=!0)}while((0<k.avail_in||k.avail_out===0)&&v!==l.Z_STREAM_END);return v===l.Z_STREAM_END&&(A=l.Z_FINISH),A===l.Z_FINISH?(v=s.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l.Z_OK):A!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(k.avail_out=0))},g.prototype.onData=function(b){this.chunks.push(b)},g.prototype.onEnd=function(b){b===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},n.Inflate=g,n.inflate=y,n.inflateRaw=function(b,w){return(w=w||{}).raw=!0,y(b,w)},n.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,r,n){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";n.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var h=c.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var d in h)h.hasOwnProperty(d)&&(l[d]=h[d])}}return l},n.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var a={arraySet:function(l,c,h,d,p){if(c.subarray&&l.subarray)l.set(c.subarray(h,h+d),p);else for(var g=0;g<d;g++)l[p+g]=c[h+g]},flattenChunks:function(l){var c,h,d,p,g,y;for(c=d=0,h=l.length;c<h;c++)d+=l[c].length;for(y=new Uint8Array(d),c=p=0,h=l.length;c<h;c++)g=l[c],y.set(g,p),p+=g.length;return y}},o={arraySet:function(l,c,h,d,p){for(var g=0;g<d;g++)l[p+g]=c[h+g]},flattenChunks:function(l){return[].concat.apply([],l)}};n.setTyped=function(l){l?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(s)},{}],42:[function(t,r,n){var s=t("./common"),a=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var l=new s.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function h(d,p){if(p<65537&&(d.subarray&&o||!d.subarray&&a))return String.fromCharCode.apply(null,s.shrinkBuf(d,p));for(var g="",y=0;y<p;y++)g+=String.fromCharCode(d[y]);return g}l[254]=l[254]=1,n.string2buf=function(d){var p,g,y,b,w,v=d.length,A=0;for(b=0;b<v;b++)(64512&(g=d.charCodeAt(b)))==55296&&b+1<v&&(64512&(y=d.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),b++),A+=g<128?1:g<2048?2:g<65536?3:4;for(p=new s.Buf8(A),b=w=0;w<A;b++)(64512&(g=d.charCodeAt(b)))==55296&&b+1<v&&(64512&(y=d.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),b++),g<128?p[w++]=g:(g<2048?p[w++]=192|g>>>6:(g<65536?p[w++]=224|g>>>12:(p[w++]=240|g>>>18,p[w++]=128|g>>>12&63),p[w++]=128|g>>>6&63),p[w++]=128|63&g);return p},n.buf2binstring=function(d){return h(d,d.length)},n.binstring2buf=function(d){for(var p=new s.Buf8(d.length),g=0,y=p.length;g<y;g++)p[g]=d.charCodeAt(g);return p},n.buf2string=function(d,p){var g,y,b,w,v=p||d.length,A=new Array(2*v);for(g=y=0;g<v;)if((b=d[g++])<128)A[y++]=b;else if(4<(w=l[b]))A[y++]=65533,g+=w-1;else{for(b&=w===2?31:w===3?15:7;1<w&&g<v;)b=b<<6|63&d[g++],w--;1<w?A[y++]=65533:b<65536?A[y++]=b:(b-=65536,A[y++]=55296|b>>10&1023,A[y++]=56320|1023&b)}return h(A,y)},n.utf8border=function(d,p){var g;for((p=p||d.length)>d.length&&(p=d.length),g=p-1;0<=g&&(192&d[g])==128;)g--;return g<0||g===0?p:g+l[d[g]]>p?g:p}},{"./common":41}],43:[function(t,r,n){r.exports=function(s,a,o,l){for(var c=65535&s|0,h=s>>>16&65535|0,d=0;o!==0;){for(o-=d=2e3<o?2e3:o;h=h+(c=c+a[l++]|0)|0,--d;);c%=65521,h%=65521}return c|h<<16|0}},{}],44:[function(t,r,n){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,r,n){var s=function(){for(var a,o=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;o[l]=a}return o}();r.exports=function(a,o,l,c){var h=s,d=c+l;a^=-1;for(var p=c;p<d;p++)a=a>>>8^h[255&(a^o[p])];return-1^a}},{}],46:[function(t,r,n){var s,a=t("../utils/common"),o=t("./trees"),l=t("./adler32"),c=t("./crc32"),h=t("./messages"),d=0,p=4,g=0,y=-2,b=-1,w=4,v=2,A=8,E=9,_=286,C=30,I=19,k=2*_+1,D=15,R=3,z=258,G=z+R+1,O=42,X=113,S=1,J=2,Y=3,W=4;function fe(x,U){return x.msg=h[U],U}function K(x){return(x<<1)-(4<x?9:0)}function be(x){for(var U=x.length;0<=--U;)x[U]=0}function te(x){var U=x.state,B=U.pending;B>x.avail_out&&(B=x.avail_out),B!==0&&(a.arraySet(x.output,U.pending_buf,U.pending_out,B,x.next_out),x.next_out+=B,U.pending_out+=B,x.total_out+=B,x.avail_out-=B,U.pending-=B,U.pending===0&&(U.pending_out=0))}function j(x,U){o._tr_flush_block(x,0<=x.block_start?x.block_start:-1,x.strstart-x.block_start,U),x.block_start=x.strstart,te(x.strm)}function ie(x,U){x.pending_buf[x.pending++]=U}function ae(x,U){x.pending_buf[x.pending++]=U>>>8&255,x.pending_buf[x.pending++]=255&U}function H(x,U){var B,F,M=x.max_chain_length,q=x.strstart,de=x.prev_length,ye=x.nice_match,ee=x.strstart>x.w_size-G?x.strstart-(x.w_size-G):0,Ee=x.window,De=x.w_mask,Ce=x.prev,Me=x.strstart+z,$e=Ee[q+de-1],Xe=Ee[q+de];x.prev_length>=x.good_match&&(M>>=2),ye>x.lookahead&&(ye=x.lookahead);do if(Ee[(B=U)+de]===Xe&&Ee[B+de-1]===$e&&Ee[B]===Ee[q]&&Ee[++B]===Ee[q+1]){q+=2,B++;do;while(Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&Ee[++q]===Ee[++B]&&q<Me);if(F=z-(Me-q),q=Me-z,de<F){if(x.match_start=U,ye<=(de=F))break;$e=Ee[q+de-1],Xe=Ee[q+de]}}while((U=Ce[U&De])>ee&&--M!=0);return de<=x.lookahead?de:x.lookahead}function se(x){var U,B,F,M,q,de,ye,ee,Ee,De,Ce=x.w_size;do{if(M=x.window_size-x.lookahead-x.strstart,x.strstart>=Ce+(Ce-G)){for(a.arraySet(x.window,x.window,Ce,Ce,0),x.match_start-=Ce,x.strstart-=Ce,x.block_start-=Ce,U=B=x.hash_size;F=x.head[--U],x.head[U]=Ce<=F?F-Ce:0,--B;);for(U=B=Ce;F=x.prev[--U],x.prev[U]=Ce<=F?F-Ce:0,--B;);M+=Ce}if(x.strm.avail_in===0)break;if(de=x.strm,ye=x.window,ee=x.strstart+x.lookahead,Ee=M,De=void 0,De=de.avail_in,Ee<De&&(De=Ee),B=De===0?0:(de.avail_in-=De,a.arraySet(ye,de.input,de.next_in,De,ee),de.state.wrap===1?de.adler=l(de.adler,ye,De,ee):de.state.wrap===2&&(de.adler=c(de.adler,ye,De,ee)),de.next_in+=De,de.total_in+=De,De),x.lookahead+=B,x.lookahead+x.insert>=R)for(q=x.strstart-x.insert,x.ins_h=x.window[q],x.ins_h=(x.ins_h<<x.hash_shift^x.window[q+1])&x.hash_mask;x.insert&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[q+R-1])&x.hash_mask,x.prev[q&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=q,q++,x.insert--,!(x.lookahead+x.insert<R)););}while(x.lookahead<G&&x.strm.avail_in!==0)}function le(x,U){for(var B,F;;){if(x.lookahead<G){if(se(x),x.lookahead<G&&U===d)return S;if(x.lookahead===0)break}if(B=0,x.lookahead>=R&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),B!==0&&x.strstart-B<=x.w_size-G&&(x.match_length=H(x,B)),x.match_length>=R)if(F=o._tr_tally(x,x.strstart-x.match_start,x.match_length-R),x.lookahead-=x.match_length,x.match_length<=x.max_lazy_match&&x.lookahead>=R){for(x.match_length--;x.strstart++,x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart,--x.match_length!=0;);x.strstart++}else x.strstart+=x.match_length,x.match_length=0,x.ins_h=x.window[x.strstart],x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+1])&x.hash_mask;else F=o._tr_tally(x,0,x.window[x.strstart]),x.lookahead--,x.strstart++;if(F&&(j(x,!1),x.strm.avail_out===0))return S}return x.insert=x.strstart<R-1?x.strstart:R-1,U===p?(j(x,!0),x.strm.avail_out===0?Y:W):x.last_lit&&(j(x,!1),x.strm.avail_out===0)?S:J}function oe(x,U){for(var B,F,M;;){if(x.lookahead<G){if(se(x),x.lookahead<G&&U===d)return S;if(x.lookahead===0)break}if(B=0,x.lookahead>=R&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),x.prev_length=x.match_length,x.prev_match=x.match_start,x.match_length=R-1,B!==0&&x.prev_length<x.max_lazy_match&&x.strstart-B<=x.w_size-G&&(x.match_length=H(x,B),x.match_length<=5&&(x.strategy===1||x.match_length===R&&4096<x.strstart-x.match_start)&&(x.match_length=R-1)),x.prev_length>=R&&x.match_length<=x.prev_length){for(M=x.strstart+x.lookahead-R,F=o._tr_tally(x,x.strstart-1-x.prev_match,x.prev_length-R),x.lookahead-=x.prev_length-1,x.prev_length-=2;++x.strstart<=M&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+R-1])&x.hash_mask,B=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),--x.prev_length!=0;);if(x.match_available=0,x.match_length=R-1,x.strstart++,F&&(j(x,!1),x.strm.avail_out===0))return S}else if(x.match_available){if((F=o._tr_tally(x,0,x.window[x.strstart-1]))&&j(x,!1),x.strstart++,x.lookahead--,x.strm.avail_out===0)return S}else x.match_available=1,x.strstart++,x.lookahead--}return x.match_available&&(F=o._tr_tally(x,0,x.window[x.strstart-1]),x.match_available=0),x.insert=x.strstart<R-1?x.strstart:R-1,U===p?(j(x,!0),x.strm.avail_out===0?Y:W):x.last_lit&&(j(x,!1),x.strm.avail_out===0)?S:J}function ce(x,U,B,F,M){this.good_length=x,this.max_lazy=U,this.nice_length=B,this.max_chain=F,this.func=M}function Ae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(2*k),this.dyn_dtree=new a.Buf16(2*(2*C+1)),this.bl_tree=new a.Buf16(2*(2*I+1)),be(this.dyn_ltree),be(this.dyn_dtree),be(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(D+1),this.heap=new a.Buf16(2*_+1),be(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*_+1),be(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Se(x){var U;return x&&x.state?(x.total_in=x.total_out=0,x.data_type=v,(U=x.state).pending=0,U.pending_out=0,U.wrap<0&&(U.wrap=-U.wrap),U.status=U.wrap?O:X,x.adler=U.wrap===2?0:1,U.last_flush=d,o._tr_init(U),g):fe(x,y)}function Ne(x){var U=Se(x);return U===g&&function(B){B.window_size=2*B.w_size,be(B.head),B.max_lazy_match=s[B.level].max_lazy,B.good_match=s[B.level].good_length,B.nice_match=s[B.level].nice_length,B.max_chain_length=s[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=R-1,B.match_available=0,B.ins_h=0}(x.state),U}function Te(x,U,B,F,M,q){if(!x)return y;var de=1;if(U===b&&(U=6),F<0?(de=0,F=-F):15<F&&(de=2,F-=16),M<1||E<M||B!==A||F<8||15<F||U<0||9<U||q<0||w<q)return fe(x,y);F===8&&(F=9);var ye=new Ae;return(x.state=ye).strm=x,ye.wrap=de,ye.gzhead=null,ye.w_bits=F,ye.w_size=1<<ye.w_bits,ye.w_mask=ye.w_size-1,ye.hash_bits=M+7,ye.hash_size=1<<ye.hash_bits,ye.hash_mask=ye.hash_size-1,ye.hash_shift=~~((ye.hash_bits+R-1)/R),ye.window=new a.Buf8(2*ye.w_size),ye.head=new a.Buf16(ye.hash_size),ye.prev=new a.Buf16(ye.w_size),ye.lit_bufsize=1<<M+6,ye.pending_buf_size=4*ye.lit_bufsize,ye.pending_buf=new a.Buf8(ye.pending_buf_size),ye.d_buf=1*ye.lit_bufsize,ye.l_buf=3*ye.lit_bufsize,ye.level=U,ye.strategy=q,ye.method=B,Ne(x)}s=[new ce(0,0,0,0,function(x,U){var B=65535;for(B>x.pending_buf_size-5&&(B=x.pending_buf_size-5);;){if(x.lookahead<=1){if(se(x),x.lookahead===0&&U===d)return S;if(x.lookahead===0)break}x.strstart+=x.lookahead,x.lookahead=0;var F=x.block_start+B;if((x.strstart===0||x.strstart>=F)&&(x.lookahead=x.strstart-F,x.strstart=F,j(x,!1),x.strm.avail_out===0)||x.strstart-x.block_start>=x.w_size-G&&(j(x,!1),x.strm.avail_out===0))return S}return x.insert=0,U===p?(j(x,!0),x.strm.avail_out===0?Y:W):(x.strstart>x.block_start&&(j(x,!1),x.strm.avail_out),S)}),new ce(4,4,8,4,le),new ce(4,5,16,8,le),new ce(4,6,32,32,le),new ce(4,4,16,16,oe),new ce(8,16,32,32,oe),new ce(8,16,128,128,oe),new ce(8,32,128,256,oe),new ce(32,128,258,1024,oe),new ce(32,258,258,4096,oe)],n.deflateInit=function(x,U){return Te(x,U,A,15,8,0)},n.deflateInit2=Te,n.deflateReset=Ne,n.deflateResetKeep=Se,n.deflateSetHeader=function(x,U){return x&&x.state?x.state.wrap!==2?y:(x.state.gzhead=U,g):y},n.deflate=function(x,U){var B,F,M,q;if(!x||!x.state||5<U||U<0)return x?fe(x,y):y;if(F=x.state,!x.output||!x.input&&x.avail_in!==0||F.status===666&&U!==p)return fe(x,x.avail_out===0?-5:y);if(F.strm=x,B=F.last_flush,F.last_flush=U,F.status===O)if(F.wrap===2)x.adler=0,ie(F,31),ie(F,139),ie(F,8),F.gzhead?(ie(F,(F.gzhead.text?1:0)+(F.gzhead.hcrc?2:0)+(F.gzhead.extra?4:0)+(F.gzhead.name?8:0)+(F.gzhead.comment?16:0)),ie(F,255&F.gzhead.time),ie(F,F.gzhead.time>>8&255),ie(F,F.gzhead.time>>16&255),ie(F,F.gzhead.time>>24&255),ie(F,F.level===9?2:2<=F.strategy||F.level<2?4:0),ie(F,255&F.gzhead.os),F.gzhead.extra&&F.gzhead.extra.length&&(ie(F,255&F.gzhead.extra.length),ie(F,F.gzhead.extra.length>>8&255)),F.gzhead.hcrc&&(x.adler=c(x.adler,F.pending_buf,F.pending,0)),F.gzindex=0,F.status=69):(ie(F,0),ie(F,0),ie(F,0),ie(F,0),ie(F,0),ie(F,F.level===9?2:2<=F.strategy||F.level<2?4:0),ie(F,3),F.status=X);else{var de=A+(F.w_bits-8<<4)<<8;de|=(2<=F.strategy||F.level<2?0:F.level<6?1:F.level===6?2:3)<<6,F.strstart!==0&&(de|=32),de+=31-de%31,F.status=X,ae(F,de),F.strstart!==0&&(ae(F,x.adler>>>16),ae(F,65535&x.adler)),x.adler=1}if(F.status===69)if(F.gzhead.extra){for(M=F.pending;F.gzindex<(65535&F.gzhead.extra.length)&&(F.pending!==F.pending_buf_size||(F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),te(x),M=F.pending,F.pending!==F.pending_buf_size));)ie(F,255&F.gzhead.extra[F.gzindex]),F.gzindex++;F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),F.gzindex===F.gzhead.extra.length&&(F.gzindex=0,F.status=73)}else F.status=73;if(F.status===73)if(F.gzhead.name){M=F.pending;do{if(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),te(x),M=F.pending,F.pending===F.pending_buf_size)){q=1;break}q=F.gzindex<F.gzhead.name.length?255&F.gzhead.name.charCodeAt(F.gzindex++):0,ie(F,q)}while(q!==0);F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),q===0&&(F.gzindex=0,F.status=91)}else F.status=91;if(F.status===91)if(F.gzhead.comment){M=F.pending;do{if(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),te(x),M=F.pending,F.pending===F.pending_buf_size)){q=1;break}q=F.gzindex<F.gzhead.comment.length?255&F.gzhead.comment.charCodeAt(F.gzindex++):0,ie(F,q)}while(q!==0);F.gzhead.hcrc&&F.pending>M&&(x.adler=c(x.adler,F.pending_buf,F.pending-M,M)),q===0&&(F.status=103)}else F.status=103;if(F.status===103&&(F.gzhead.hcrc?(F.pending+2>F.pending_buf_size&&te(x),F.pending+2<=F.pending_buf_size&&(ie(F,255&x.adler),ie(F,x.adler>>8&255),x.adler=0,F.status=X)):F.status=X),F.pending!==0){if(te(x),x.avail_out===0)return F.last_flush=-1,g}else if(x.avail_in===0&&K(U)<=K(B)&&U!==p)return fe(x,-5);if(F.status===666&&x.avail_in!==0)return fe(x,-5);if(x.avail_in!==0||F.lookahead!==0||U!==d&&F.status!==666){var ye=F.strategy===2?function(ee,Ee){for(var De;;){if(ee.lookahead===0&&(se(ee),ee.lookahead===0)){if(Ee===d)return S;break}if(ee.match_length=0,De=o._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++,De&&(j(ee,!1),ee.strm.avail_out===0))return S}return ee.insert=0,Ee===p?(j(ee,!0),ee.strm.avail_out===0?Y:W):ee.last_lit&&(j(ee,!1),ee.strm.avail_out===0)?S:J}(F,U):F.strategy===3?function(ee,Ee){for(var De,Ce,Me,$e,Xe=ee.window;;){if(ee.lookahead<=z){if(se(ee),ee.lookahead<=z&&Ee===d)return S;if(ee.lookahead===0)break}if(ee.match_length=0,ee.lookahead>=R&&0<ee.strstart&&(Ce=Xe[Me=ee.strstart-1])===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]){$e=ee.strstart+z;do;while(Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Ce===Xe[++Me]&&Me<$e);ee.match_length=z-($e-Me),ee.match_length>ee.lookahead&&(ee.match_length=ee.lookahead)}if(ee.match_length>=R?(De=o._tr_tally(ee,1,ee.match_length-R),ee.lookahead-=ee.match_length,ee.strstart+=ee.match_length,ee.match_length=0):(De=o._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++),De&&(j(ee,!1),ee.strm.avail_out===0))return S}return ee.insert=0,Ee===p?(j(ee,!0),ee.strm.avail_out===0?Y:W):ee.last_lit&&(j(ee,!1),ee.strm.avail_out===0)?S:J}(F,U):s[F.level].func(F,U);if(ye!==Y&&ye!==W||(F.status=666),ye===S||ye===Y)return x.avail_out===0&&(F.last_flush=-1),g;if(ye===J&&(U===1?o._tr_align(F):U!==5&&(o._tr_stored_block(F,0,0,!1),U===3&&(be(F.head),F.lookahead===0&&(F.strstart=0,F.block_start=0,F.insert=0))),te(x),x.avail_out===0))return F.last_flush=-1,g}return U!==p?g:F.wrap<=0?1:(F.wrap===2?(ie(F,255&x.adler),ie(F,x.adler>>8&255),ie(F,x.adler>>16&255),ie(F,x.adler>>24&255),ie(F,255&x.total_in),ie(F,x.total_in>>8&255),ie(F,x.total_in>>16&255),ie(F,x.total_in>>24&255)):(ae(F,x.adler>>>16),ae(F,65535&x.adler)),te(x),0<F.wrap&&(F.wrap=-F.wrap),F.pending!==0?g:1)},n.deflateEnd=function(x){var U;return x&&x.state?(U=x.state.status)!==O&&U!==69&&U!==73&&U!==91&&U!==103&&U!==X&&U!==666?fe(x,y):(x.state=null,U===X?fe(x,-3):g):y},n.deflateSetDictionary=function(x,U){var B,F,M,q,de,ye,ee,Ee,De=U.length;if(!x||!x.state||(q=(B=x.state).wrap)===2||q===1&&B.status!==O||B.lookahead)return y;for(q===1&&(x.adler=l(x.adler,U,De,0)),B.wrap=0,De>=B.w_size&&(q===0&&(be(B.head),B.strstart=0,B.block_start=0,B.insert=0),Ee=new a.Buf8(B.w_size),a.arraySet(Ee,U,De-B.w_size,B.w_size,0),U=Ee,De=B.w_size),de=x.avail_in,ye=x.next_in,ee=x.input,x.avail_in=De,x.next_in=0,x.input=U,se(B);B.lookahead>=R;){for(F=B.strstart,M=B.lookahead-(R-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[F+R-1])&B.hash_mask,B.prev[F&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=F,F++,--M;);B.strstart=F,B.lookahead=R-1,se(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=R-1,B.match_available=0,x.next_in=ye,x.input=ee,x.avail_in=de,B.wrap=q,g},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,r,n){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,r,n){r.exports=function(s,a){var o,l,c,h,d,p,g,y,b,w,v,A,E,_,C,I,k,D,R,z,G,O,X,S,J;o=s.state,l=s.next_in,S=s.input,c=l+(s.avail_in-5),h=s.next_out,J=s.output,d=h-(a-s.avail_out),p=h+(s.avail_out-257),g=o.dmax,y=o.wsize,b=o.whave,w=o.wnext,v=o.window,A=o.hold,E=o.bits,_=o.lencode,C=o.distcode,I=(1<<o.lenbits)-1,k=(1<<o.distbits)-1;e:do{E<15&&(A+=S[l++]<<E,E+=8,A+=S[l++]<<E,E+=8),D=_[A&I];t:for(;;){if(A>>>=R=D>>>24,E-=R,(R=D>>>16&255)===0)J[h++]=65535&D;else{if(!(16&R)){if(!(64&R)){D=_[(65535&D)+(A&(1<<R)-1)];continue t}if(32&R){o.mode=12;break e}s.msg="invalid literal/length code",o.mode=30;break e}z=65535&D,(R&=15)&&(E<R&&(A+=S[l++]<<E,E+=8),z+=A&(1<<R)-1,A>>>=R,E-=R),E<15&&(A+=S[l++]<<E,E+=8,A+=S[l++]<<E,E+=8),D=C[A&k];r:for(;;){if(A>>>=R=D>>>24,E-=R,!(16&(R=D>>>16&255))){if(!(64&R)){D=C[(65535&D)+(A&(1<<R)-1)];continue r}s.msg="invalid distance code",o.mode=30;break e}if(G=65535&D,E<(R&=15)&&(A+=S[l++]<<E,(E+=8)<R&&(A+=S[l++]<<E,E+=8)),g<(G+=A&(1<<R)-1)){s.msg="invalid distance too far back",o.mode=30;break e}if(A>>>=R,E-=R,(R=h-d)<G){if(b<(R=G-R)&&o.sane){s.msg="invalid distance too far back",o.mode=30;break e}if(X=v,(O=0)===w){if(O+=y-R,R<z){for(z-=R;J[h++]=v[O++],--R;);O=h-G,X=J}}else if(w<R){if(O+=y+w-R,(R-=w)<z){for(z-=R;J[h++]=v[O++],--R;);if(O=0,w<z){for(z-=R=w;J[h++]=v[O++],--R;);O=h-G,X=J}}}else if(O+=w-R,R<z){for(z-=R;J[h++]=v[O++],--R;);O=h-G,X=J}for(;2<z;)J[h++]=X[O++],J[h++]=X[O++],J[h++]=X[O++],z-=3;z&&(J[h++]=X[O++],1<z&&(J[h++]=X[O++]))}else{for(O=h-G;J[h++]=J[O++],J[h++]=J[O++],J[h++]=J[O++],2<(z-=3););z&&(J[h++]=J[O++],1<z&&(J[h++]=J[O++]))}break}}break}}while(l<c&&h<p);l-=z=E>>3,A&=(1<<(E-=z<<3))-1,s.next_in=l,s.next_out=h,s.avail_in=l<c?c-l+5:5-(l-c),s.avail_out=h<p?p-h+257:257-(h-p),o.hold=A,o.bits=E}},{}],49:[function(t,r,n){var s=t("../utils/common"),a=t("./adler32"),o=t("./crc32"),l=t("./inffast"),c=t("./inftrees"),h=1,d=2,p=0,g=-2,y=1,b=852,w=592;function v(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function A(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function E(O){var X;return O&&O.state?(X=O.state,O.total_in=O.total_out=X.total=0,O.msg="",X.wrap&&(O.adler=1&X.wrap),X.mode=y,X.last=0,X.havedict=0,X.dmax=32768,X.head=null,X.hold=0,X.bits=0,X.lencode=X.lendyn=new s.Buf32(b),X.distcode=X.distdyn=new s.Buf32(w),X.sane=1,X.back=-1,p):g}function _(O){var X;return O&&O.state?((X=O.state).wsize=0,X.whave=0,X.wnext=0,E(O)):g}function C(O,X){var S,J;return O&&O.state?(J=O.state,X<0?(S=0,X=-X):(S=1+(X>>4),X<48&&(X&=15)),X&&(X<8||15<X)?g:(J.window!==null&&J.wbits!==X&&(J.window=null),J.wrap=S,J.wbits=X,_(O))):g}function I(O,X){var S,J;return O?(J=new A,(O.state=J).window=null,(S=C(O,X))!==p&&(O.state=null),S):g}var k,D,R=!0;function z(O){if(R){var X;for(k=new s.Buf32(512),D=new s.Buf32(32),X=0;X<144;)O.lens[X++]=8;for(;X<256;)O.lens[X++]=9;for(;X<280;)O.lens[X++]=7;for(;X<288;)O.lens[X++]=8;for(c(h,O.lens,0,288,k,0,O.work,{bits:9}),X=0;X<32;)O.lens[X++]=5;c(d,O.lens,0,32,D,0,O.work,{bits:5}),R=!1}O.lencode=k,O.lenbits=9,O.distcode=D,O.distbits=5}function G(O,X,S,J){var Y,W=O.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new s.Buf8(W.wsize)),J>=W.wsize?(s.arraySet(W.window,X,S-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(J<(Y=W.wsize-W.wnext)&&(Y=J),s.arraySet(W.window,X,S-J,Y,W.wnext),(J-=Y)?(s.arraySet(W.window,X,S-J,J,0),W.wnext=J,W.whave=W.wsize):(W.wnext+=Y,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=Y))),0}n.inflateReset=_,n.inflateReset2=C,n.inflateResetKeep=E,n.inflateInit=function(O){return I(O,15)},n.inflateInit2=I,n.inflate=function(O,X){var S,J,Y,W,fe,K,be,te,j,ie,ae,H,se,le,oe,ce,Ae,Se,Ne,Te,x,U,B,F,M=0,q=new s.Buf8(4),de=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return g;(S=O.state).mode===12&&(S.mode=13),fe=O.next_out,Y=O.output,be=O.avail_out,W=O.next_in,J=O.input,K=O.avail_in,te=S.hold,j=S.bits,ie=K,ae=be,U=p;e:for(;;)switch(S.mode){case y:if(S.wrap===0){S.mode=13;break}for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(2&S.wrap&&te===35615){q[S.check=0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0),j=te=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&te)<<8)+(te>>8))%31){O.msg="incorrect header check",S.mode=30;break}if((15&te)!=8){O.msg="unknown compression method",S.mode=30;break}if(j-=4,x=8+(15&(te>>>=4)),S.wbits===0)S.wbits=x;else if(x>S.wbits){O.msg="invalid window size",S.mode=30;break}S.dmax=1<<x,O.adler=S.check=1,S.mode=512&te?10:12,j=te=0;break;case 2:for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(S.flags=te,(255&S.flags)!=8){O.msg="unknown compression method",S.mode=30;break}if(57344&S.flags){O.msg="unknown header flags set",S.mode=30;break}S.head&&(S.head.text=te>>8&1),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0)),j=te=0,S.mode=3;case 3:for(;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.head&&(S.head.time=te),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,q[2]=te>>>16&255,q[3]=te>>>24&255,S.check=o(S.check,q,4,0)),j=te=0,S.mode=4;case 4:for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.head&&(S.head.xflags=255&te,S.head.os=te>>8),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0)),j=te=0,S.mode=5;case 5:if(1024&S.flags){for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.length=te,S.head&&(S.head.extra_len=te),512&S.flags&&(q[0]=255&te,q[1]=te>>>8&255,S.check=o(S.check,q,2,0)),j=te=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&(K<(H=S.length)&&(H=K),H&&(S.head&&(x=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),s.arraySet(S.head.extra,J,W,H,x)),512&S.flags&&(S.check=o(S.check,J,H,W)),K-=H,W+=H,S.length-=H),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if(K===0)break e;for(H=0;x=J[W+H++],S.head&&x&&S.length<65536&&(S.head.name+=String.fromCharCode(x)),x&&H<K;);if(512&S.flags&&(S.check=o(S.check,J,H,W)),K-=H,W+=H,x)break e}else S.head&&(S.head.name=null);S.length=0,S.mode=8;case 8:if(4096&S.flags){if(K===0)break e;for(H=0;x=J[W+H++],S.head&&x&&S.length<65536&&(S.head.comment+=String.fromCharCode(x)),x&&H<K;);if(512&S.flags&&(S.check=o(S.check,J,H,W)),K-=H,W+=H,x)break e}else S.head&&(S.head.comment=null);S.mode=9;case 9:if(512&S.flags){for(;j<16;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(te!==(65535&S.check)){O.msg="header crc mismatch",S.mode=30;break}j=te=0}S.head&&(S.head.hcrc=S.flags>>9&1,S.head.done=!0),O.adler=S.check=0,S.mode=12;break;case 10:for(;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}O.adler=S.check=v(te),j=te=0,S.mode=11;case 11:if(S.havedict===0)return O.next_out=fe,O.avail_out=be,O.next_in=W,O.avail_in=K,S.hold=te,S.bits=j,2;O.adler=S.check=1,S.mode=12;case 12:if(X===5||X===6)break e;case 13:if(S.last){te>>>=7&j,j-=7&j,S.mode=27;break}for(;j<3;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}switch(S.last=1&te,j-=1,3&(te>>>=1)){case 0:S.mode=14;break;case 1:if(z(S),S.mode=20,X!==6)break;te>>>=2,j-=2;break e;case 2:S.mode=17;break;case 3:O.msg="invalid block type",S.mode=30}te>>>=2,j-=2;break;case 14:for(te>>>=7&j,j-=7&j;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if((65535&te)!=(te>>>16^65535)){O.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&te,j=te=0,S.mode=15,X===6)break e;case 15:S.mode=16;case 16:if(H=S.length){if(K<H&&(H=K),be<H&&(H=be),H===0)break e;s.arraySet(Y,J,W,H,fe),K-=H,W+=H,be-=H,fe+=H,S.length-=H;break}S.mode=12;break;case 17:for(;j<14;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(S.nlen=257+(31&te),te>>>=5,j-=5,S.ndist=1+(31&te),te>>>=5,j-=5,S.ncode=4+(15&te),te>>>=4,j-=4,286<S.nlen||30<S.ndist){O.msg="too many length or distance symbols",S.mode=30;break}S.have=0,S.mode=18;case 18:for(;S.have<S.ncode;){for(;j<3;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.lens[de[S.have++]]=7&te,te>>>=3,j-=3}for(;S.have<19;)S.lens[de[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,B={bits:S.lenbits},U=c(0,S.lens,0,19,S.lencode,0,S.work,B),S.lenbits=B.bits,U){O.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have<S.nlen+S.ndist;){for(;ce=(M=S.lencode[te&(1<<S.lenbits)-1])>>>16&255,Ae=65535&M,!((oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(Ae<16)te>>>=oe,j-=oe,S.lens[S.have++]=Ae;else{if(Ae===16){for(F=oe+2;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(te>>>=oe,j-=oe,S.have===0){O.msg="invalid bit length repeat",S.mode=30;break}x=S.lens[S.have-1],H=3+(3&te),te>>>=2,j-=2}else if(Ae===17){for(F=oe+3;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}j-=oe,x=0,H=3+(7&(te>>>=oe)),te>>>=3,j-=3}else{for(F=oe+7;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}j-=oe,x=0,H=11+(127&(te>>>=oe)),te>>>=7,j-=7}if(S.have+H>S.nlen+S.ndist){O.msg="invalid bit length repeat",S.mode=30;break}for(;H--;)S.lens[S.have++]=x}}if(S.mode===30)break;if(S.lens[256]===0){O.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,B={bits:S.lenbits},U=c(h,S.lens,0,S.nlen,S.lencode,0,S.work,B),S.lenbits=B.bits,U){O.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,B={bits:S.distbits},U=c(d,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,B),S.distbits=B.bits,U){O.msg="invalid distances set",S.mode=30;break}if(S.mode=20,X===6)break e;case 20:S.mode=21;case 21:if(6<=K&&258<=be){O.next_out=fe,O.avail_out=be,O.next_in=W,O.avail_in=K,S.hold=te,S.bits=j,l(O,ae),fe=O.next_out,Y=O.output,be=O.avail_out,W=O.next_in,J=O.input,K=O.avail_in,te=S.hold,j=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;ce=(M=S.lencode[te&(1<<S.lenbits)-1])>>>16&255,Ae=65535&M,!((oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(ce&&!(240&ce)){for(Se=oe,Ne=ce,Te=Ae;ce=(M=S.lencode[Te+((te&(1<<Se+Ne)-1)>>Se)])>>>16&255,Ae=65535&M,!(Se+(oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}te>>>=Se,j-=Se,S.back+=Se}if(te>>>=oe,j-=oe,S.back+=oe,S.length=Ae,ce===0){S.mode=26;break}if(32&ce){S.back=-1,S.mode=12;break}if(64&ce){O.msg="invalid literal/length code",S.mode=30;break}S.extra=15&ce,S.mode=22;case 22:if(S.extra){for(F=S.extra;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.length+=te&(1<<S.extra)-1,te>>>=S.extra,j-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;ce=(M=S.distcode[te&(1<<S.distbits)-1])>>>16&255,Ae=65535&M,!((oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(!(240&ce)){for(Se=oe,Ne=ce,Te=Ae;ce=(M=S.distcode[Te+((te&(1<<Se+Ne)-1)>>Se)])>>>16&255,Ae=65535&M,!(Se+(oe=M>>>24)<=j);){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}te>>>=Se,j-=Se,S.back+=Se}if(te>>>=oe,j-=oe,S.back+=oe,64&ce){O.msg="invalid distance code",S.mode=30;break}S.offset=Ae,S.extra=15&ce,S.mode=24;case 24:if(S.extra){for(F=S.extra;j<F;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}S.offset+=te&(1<<S.extra)-1,te>>>=S.extra,j-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){O.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(be===0)break e;if(H=ae-be,S.offset>H){if((H=S.offset-H)>S.whave&&S.sane){O.msg="invalid distance too far back",S.mode=30;break}se=H>S.wnext?(H-=S.wnext,S.wsize-H):S.wnext-H,H>S.length&&(H=S.length),le=S.window}else le=Y,se=fe-S.offset,H=S.length;for(be<H&&(H=be),be-=H,S.length-=H;Y[fe++]=le[se++],--H;);S.length===0&&(S.mode=21);break;case 26:if(be===0)break e;Y[fe++]=S.length,be--,S.mode=21;break;case 27:if(S.wrap){for(;j<32;){if(K===0)break e;K--,te|=J[W++]<<j,j+=8}if(ae-=be,O.total_out+=ae,S.total+=ae,ae&&(O.adler=S.check=S.flags?o(S.check,Y,ae,fe-ae):a(S.check,Y,ae,fe-ae)),ae=be,(S.flags?te:v(te))!==S.check){O.msg="incorrect data check",S.mode=30;break}j=te=0}S.mode=28;case 28:if(S.wrap&&S.flags){for(;j<32;){if(K===0)break e;K--,te+=J[W++]<<j,j+=8}if(te!==(4294967295&S.total)){O.msg="incorrect length check",S.mode=30;break}j=te=0}S.mode=29;case 29:U=1;break e;case 30:U=-3;break e;case 31:return-4;case 32:default:return g}return O.next_out=fe,O.avail_out=be,O.next_in=W,O.avail_in=K,S.hold=te,S.bits=j,(S.wsize||ae!==O.avail_out&&S.mode<30&&(S.mode<27||X!==4))&&G(O,O.output,O.next_out,ae-O.avail_out)?(S.mode=31,-4):(ie-=O.avail_in,ae-=O.avail_out,O.total_in+=ie,O.total_out+=ae,S.total+=ae,S.wrap&&ae&&(O.adler=S.check=S.flags?o(S.check,Y,ae,O.next_out-ae):a(S.check,Y,ae,O.next_out-ae)),O.data_type=S.bits+(S.last?64:0)+(S.mode===12?128:0)+(S.mode===20||S.mode===15?256:0),(ie==0&&ae===0||X===4)&&U===p&&(U=-5),U)},n.inflateEnd=function(O){if(!O||!O.state)return g;var X=O.state;return X.window&&(X.window=null),O.state=null,p},n.inflateGetHeader=function(O,X){var S;return O&&O.state&&2&(S=O.state).wrap?((S.head=X).done=!1,p):g},n.inflateSetDictionary=function(O,X){var S,J=X.length;return O&&O.state?(S=O.state).wrap!==0&&S.mode!==11?g:S.mode===11&&a(1,X,J,0)!==S.check?-3:G(O,X,J,J)?(S.mode=31,-4):(S.havedict=1,p):g},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,r,n){var s=t("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(h,d,p,g,y,b,w,v){var A,E,_,C,I,k,D,R,z,G=v.bits,O=0,X=0,S=0,J=0,Y=0,W=0,fe=0,K=0,be=0,te=0,j=null,ie=0,ae=new s.Buf16(16),H=new s.Buf16(16),se=null,le=0;for(O=0;O<=15;O++)ae[O]=0;for(X=0;X<g;X++)ae[d[p+X]]++;for(Y=G,J=15;1<=J&&ae[J]===0;J--);if(J<Y&&(Y=J),J===0)return y[b++]=20971520,y[b++]=20971520,v.bits=1,0;for(S=1;S<J&&ae[S]===0;S++);for(Y<S&&(Y=S),O=K=1;O<=15;O++)if(K<<=1,(K-=ae[O])<0)return-1;if(0<K&&(h===0||J!==1))return-1;for(H[1]=0,O=1;O<15;O++)H[O+1]=H[O]+ae[O];for(X=0;X<g;X++)d[p+X]!==0&&(w[H[d[p+X]]++]=X);if(k=h===0?(j=se=w,19):h===1?(j=a,ie-=257,se=o,le-=257,256):(j=l,se=c,-1),O=S,I=b,fe=X=te=0,_=-1,C=(be=1<<(W=Y))-1,h===1&&852<be||h===2&&592<be)return 1;for(;;){for(D=O-fe,z=w[X]<k?(R=0,w[X]):w[X]>k?(R=se[le+w[X]],j[ie+w[X]]):(R=96,0),A=1<<O-fe,S=E=1<<W;y[I+(te>>fe)+(E-=A)]=D<<24|R<<16|z|0,E!==0;);for(A=1<<O-1;te&A;)A>>=1;if(A!==0?(te&=A-1,te+=A):te=0,X++,--ae[O]==0){if(O===J)break;O=d[p+w[X]]}if(Y<O&&(te&C)!==_){for(fe===0&&(fe=Y),I+=S,K=1<<(W=O-fe);W+fe<J&&!((K-=ae[W+fe])<=0);)W++,K<<=1;if(be+=1<<W,h===1&&852<be||h===2&&592<be)return 1;y[_=te&C]=Y<<24|W<<16|I-b|0}}return te!==0&&(y[I+te]=O-fe<<24|64<<16|0),v.bits=Y,0}},{"../utils/common":41}],51:[function(t,r,n){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,r,n){var s=t("../utils/common"),a=0,o=1;function l(M){for(var q=M.length;0<=--q;)M[q]=0}var c=0,h=29,d=256,p=d+1+h,g=30,y=19,b=2*p+1,w=15,v=16,A=7,E=256,_=16,C=17,I=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],D=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=new Array(2*(p+2));l(G);var O=new Array(2*g);l(O);var X=new Array(512);l(X);var S=new Array(256);l(S);var J=new Array(h);l(J);var Y,W,fe,K=new Array(g);function be(M,q,de,ye,ee){this.static_tree=M,this.extra_bits=q,this.extra_base=de,this.elems=ye,this.max_length=ee,this.has_stree=M&&M.length}function te(M,q){this.dyn_tree=M,this.max_code=0,this.stat_desc=q}function j(M){return M<256?X[M]:X[256+(M>>>7)]}function ie(M,q){M.pending_buf[M.pending++]=255&q,M.pending_buf[M.pending++]=q>>>8&255}function ae(M,q,de){M.bi_valid>v-de?(M.bi_buf|=q<<M.bi_valid&65535,ie(M,M.bi_buf),M.bi_buf=q>>v-M.bi_valid,M.bi_valid+=de-v):(M.bi_buf|=q<<M.bi_valid&65535,M.bi_valid+=de)}function H(M,q,de){ae(M,de[2*q],de[2*q+1])}function se(M,q){for(var de=0;de|=1&M,M>>>=1,de<<=1,0<--q;);return de>>>1}function le(M,q,de){var ye,ee,Ee=new Array(w+1),De=0;for(ye=1;ye<=w;ye++)Ee[ye]=De=De+de[ye-1]<<1;for(ee=0;ee<=q;ee++){var Ce=M[2*ee+1];Ce!==0&&(M[2*ee]=se(Ee[Ce]++,Ce))}}function oe(M){var q;for(q=0;q<p;q++)M.dyn_ltree[2*q]=0;for(q=0;q<g;q++)M.dyn_dtree[2*q]=0;for(q=0;q<y;q++)M.bl_tree[2*q]=0;M.dyn_ltree[2*E]=1,M.opt_len=M.static_len=0,M.last_lit=M.matches=0}function ce(M){8<M.bi_valid?ie(M,M.bi_buf):0<M.bi_valid&&(M.pending_buf[M.pending++]=M.bi_buf),M.bi_buf=0,M.bi_valid=0}function Ae(M,q,de,ye){var ee=2*q,Ee=2*de;return M[ee]<M[Ee]||M[ee]===M[Ee]&&ye[q]<=ye[de]}function Se(M,q,de){for(var ye=M.heap[de],ee=de<<1;ee<=M.heap_len&&(ee<M.heap_len&&Ae(q,M.heap[ee+1],M.heap[ee],M.depth)&&ee++,!Ae(q,ye,M.heap[ee],M.depth));)M.heap[de]=M.heap[ee],de=ee,ee<<=1;M.heap[de]=ye}function Ne(M,q,de){var ye,ee,Ee,De,Ce=0;if(M.last_lit!==0)for(;ye=M.pending_buf[M.d_buf+2*Ce]<<8|M.pending_buf[M.d_buf+2*Ce+1],ee=M.pending_buf[M.l_buf+Ce],Ce++,ye===0?H(M,ee,q):(H(M,(Ee=S[ee])+d+1,q),(De=k[Ee])!==0&&ae(M,ee-=J[Ee],De),H(M,Ee=j(--ye),de),(De=D[Ee])!==0&&ae(M,ye-=K[Ee],De)),Ce<M.last_lit;);H(M,E,q)}function Te(M,q){var de,ye,ee,Ee=q.dyn_tree,De=q.stat_desc.static_tree,Ce=q.stat_desc.has_stree,Me=q.stat_desc.elems,$e=-1;for(M.heap_len=0,M.heap_max=b,de=0;de<Me;de++)Ee[2*de]!==0?(M.heap[++M.heap_len]=$e=de,M.depth[de]=0):Ee[2*de+1]=0;for(;M.heap_len<2;)Ee[2*(ee=M.heap[++M.heap_len]=$e<2?++$e:0)]=1,M.depth[ee]=0,M.opt_len--,Ce&&(M.static_len-=De[2*ee+1]);for(q.max_code=$e,de=M.heap_len>>1;1<=de;de--)Se(M,Ee,de);for(ee=Me;de=M.heap[1],M.heap[1]=M.heap[M.heap_len--],Se(M,Ee,1),ye=M.heap[1],M.heap[--M.heap_max]=de,M.heap[--M.heap_max]=ye,Ee[2*ee]=Ee[2*de]+Ee[2*ye],M.depth[ee]=(M.depth[de]>=M.depth[ye]?M.depth[de]:M.depth[ye])+1,Ee[2*de+1]=Ee[2*ye+1]=ee,M.heap[1]=ee++,Se(M,Ee,1),2<=M.heap_len;);M.heap[--M.heap_max]=M.heap[1],function(Xe,Tt){var nr,yr,rr,ge,ve,he,me=Tt.dyn_tree,Fe=Tt.max_code,Ue=Tt.stat_desc.static_tree,st=Tt.stat_desc.has_stree,Ye=Tt.stat_desc.extra_bits,ct=Tt.stat_desc.extra_base,pt=Tt.stat_desc.max_length,mt=0;for(ge=0;ge<=w;ge++)Xe.bl_count[ge]=0;for(me[2*Xe.heap[Xe.heap_max]+1]=0,nr=Xe.heap_max+1;nr<b;nr++)pt<(ge=me[2*me[2*(yr=Xe.heap[nr])+1]+1]+1)&&(ge=pt,mt++),me[2*yr+1]=ge,Fe<yr||(Xe.bl_count[ge]++,ve=0,ct<=yr&&(ve=Ye[yr-ct]),he=me[2*yr],Xe.opt_len+=he*(ge+ve),st&&(Xe.static_len+=he*(Ue[2*yr+1]+ve)));if(mt!==0){do{for(ge=pt-1;Xe.bl_count[ge]===0;)ge--;Xe.bl_count[ge]--,Xe.bl_count[ge+1]+=2,Xe.bl_count[pt]--,mt-=2}while(0<mt);for(ge=pt;ge!==0;ge--)for(yr=Xe.bl_count[ge];yr!==0;)Fe<(rr=Xe.heap[--nr])||(me[2*rr+1]!==ge&&(Xe.opt_len+=(ge-me[2*rr+1])*me[2*rr],me[2*rr+1]=ge),yr--)}}(M,q),le(Ee,$e,M.bl_count)}function x(M,q,de){var ye,ee,Ee=-1,De=q[1],Ce=0,Me=7,$e=4;for(De===0&&(Me=138,$e=3),q[2*(de+1)+1]=65535,ye=0;ye<=de;ye++)ee=De,De=q[2*(ye+1)+1],++Ce<Me&&ee===De||(Ce<$e?M.bl_tree[2*ee]+=Ce:ee!==0?(ee!==Ee&&M.bl_tree[2*ee]++,M.bl_tree[2*_]++):Ce<=10?M.bl_tree[2*C]++:M.bl_tree[2*I]++,Ee=ee,$e=(Ce=0)===De?(Me=138,3):ee===De?(Me=6,3):(Me=7,4))}function U(M,q,de){var ye,ee,Ee=-1,De=q[1],Ce=0,Me=7,$e=4;for(De===0&&(Me=138,$e=3),ye=0;ye<=de;ye++)if(ee=De,De=q[2*(ye+1)+1],!(++Ce<Me&&ee===De)){if(Ce<$e)for(;H(M,ee,M.bl_tree),--Ce!=0;);else ee!==0?(ee!==Ee&&(H(M,ee,M.bl_tree),Ce--),H(M,_,M.bl_tree),ae(M,Ce-3,2)):Ce<=10?(H(M,C,M.bl_tree),ae(M,Ce-3,3)):(H(M,I,M.bl_tree),ae(M,Ce-11,7));Ee=ee,$e=(Ce=0)===De?(Me=138,3):ee===De?(Me=6,3):(Me=7,4)}}l(K);var B=!1;function F(M,q,de,ye){ae(M,(c<<1)+(ye?1:0),3),function(ee,Ee,De,Ce){ce(ee),ie(ee,De),ie(ee,~De),s.arraySet(ee.pending_buf,ee.window,Ee,De,ee.pending),ee.pending+=De}(M,q,de)}n._tr_init=function(M){B||(function(){var q,de,ye,ee,Ee,De=new Array(w+1);for(ee=ye=0;ee<h-1;ee++)for(J[ee]=ye,q=0;q<1<<k[ee];q++)S[ye++]=ee;for(S[ye-1]=ee,ee=Ee=0;ee<16;ee++)for(K[ee]=Ee,q=0;q<1<<D[ee];q++)X[Ee++]=ee;for(Ee>>=7;ee<g;ee++)for(K[ee]=Ee<<7,q=0;q<1<<D[ee]-7;q++)X[256+Ee++]=ee;for(de=0;de<=w;de++)De[de]=0;for(q=0;q<=143;)G[2*q+1]=8,q++,De[8]++;for(;q<=255;)G[2*q+1]=9,q++,De[9]++;for(;q<=279;)G[2*q+1]=7,q++,De[7]++;for(;q<=287;)G[2*q+1]=8,q++,De[8]++;for(le(G,p+1,De),q=0;q<g;q++)O[2*q+1]=5,O[2*q]=se(q,5);Y=new be(G,k,d+1,p,w),W=new be(O,D,0,g,w),fe=new be(new Array(0),R,0,y,A)}(),B=!0),M.l_desc=new te(M.dyn_ltree,Y),M.d_desc=new te(M.dyn_dtree,W),M.bl_desc=new te(M.bl_tree,fe),M.bi_buf=0,M.bi_valid=0,oe(M)},n._tr_stored_block=F,n._tr_flush_block=function(M,q,de,ye){var ee,Ee,De=0;0<M.level?(M.strm.data_type===2&&(M.strm.data_type=function(Ce){var Me,$e=4093624447;for(Me=0;Me<=31;Me++,$e>>>=1)if(1&$e&&Ce.dyn_ltree[2*Me]!==0)return a;if(Ce.dyn_ltree[18]!==0||Ce.dyn_ltree[20]!==0||Ce.dyn_ltree[26]!==0)return o;for(Me=32;Me<d;Me++)if(Ce.dyn_ltree[2*Me]!==0)return o;return a}(M)),Te(M,M.l_desc),Te(M,M.d_desc),De=function(Ce){var Me;for(x(Ce,Ce.dyn_ltree,Ce.l_desc.max_code),x(Ce,Ce.dyn_dtree,Ce.d_desc.max_code),Te(Ce,Ce.bl_desc),Me=y-1;3<=Me&&Ce.bl_tree[2*z[Me]+1]===0;Me--);return Ce.opt_len+=3*(Me+1)+5+5+4,Me}(M),ee=M.opt_len+3+7>>>3,(Ee=M.static_len+3+7>>>3)<=ee&&(ee=Ee)):ee=Ee=de+5,de+4<=ee&&q!==-1?F(M,q,de,ye):M.strategy===4||Ee===ee?(ae(M,2+(ye?1:0),3),Ne(M,G,O)):(ae(M,4+(ye?1:0),3),function(Ce,Me,$e,Xe){var Tt;for(ae(Ce,Me-257,5),ae(Ce,$e-1,5),ae(Ce,Xe-4,4),Tt=0;Tt<Xe;Tt++)ae(Ce,Ce.bl_tree[2*z[Tt]+1],3);U(Ce,Ce.dyn_ltree,Me-1),U(Ce,Ce.dyn_dtree,$e-1)}(M,M.l_desc.max_code+1,M.d_desc.max_code+1,De+1),Ne(M,M.dyn_ltree,M.dyn_dtree)),oe(M),ye&&ce(M)},n._tr_tally=function(M,q,de){return M.pending_buf[M.d_buf+2*M.last_lit]=q>>>8&255,M.pending_buf[M.d_buf+2*M.last_lit+1]=255&q,M.pending_buf[M.l_buf+M.last_lit]=255&de,M.last_lit++,q===0?M.dyn_ltree[2*de]++:(M.matches++,q--,M.dyn_ltree[2*(S[de]+d+1)]++,M.dyn_dtree[2*j(q)]++),M.last_lit===M.lit_bufsize-1},n._tr_align=function(M){ae(M,2,3),H(M,E,G),function(q){q.bi_valid===16?(ie(q,q.bi_buf),q.bi_buf=0,q.bi_valid=0):8<=q.bi_valid&&(q.pending_buf[q.pending++]=255&q.bi_buf,q.bi_buf>>=8,q.bi_valid-=8)}(M)}},{"../utils/common":41}],53:[function(t,r,n){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,r,n){(function(s){(function(a,o){if(!a.setImmediate){var l,c,h,d,p=1,g={},y=!1,b=a.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(a);w=w&&w.setTimeout?w:a,l={}.toString.call(a.process)==="[object process]"?function(_){process.nextTick(function(){A(_)})}:function(){if(a.postMessage&&!a.importScripts){var _=!0,C=a.onmessage;return a.onmessage=function(){_=!1},a.postMessage("","*"),a.onmessage=C,_}}()?(d="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",E,!1):a.attachEvent("onmessage",E),function(_){a.postMessage(d+_,"*")}):a.MessageChannel?((h=new MessageChannel).port1.onmessage=function(_){A(_.data)},function(_){h.port2.postMessage(_)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,function(_){var C=b.createElement("script");C.onreadystatechange=function(){A(_),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(_){setTimeout(A,0,_)},w.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),I=0;I<C.length;I++)C[I]=arguments[I+1];var k={callback:_,args:C};return g[p]=k,l(p),p++},w.clearImmediate=v}function v(_){delete g[_]}function A(_){if(y)setTimeout(A,0,_);else{var C=g[_];if(C){y=!0;try{(function(I){var k=I.callback,D=I.args;switch(D.length){case 0:k();break;case 1:k(D[0]);break;case 2:k(D[0],D[1]);break;case 3:k(D[0],D[1],D[2]);break;default:k.apply(o,D)}})(C)}finally{v(_),y=!1}}}}function E(_){_.source===a&&typeof _.data=="string"&&_.data.indexOf(d)===0&&A(+_.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof sh<"u"?sh:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(HA);var FR=HA.exports;const BR=_g(FR);/*
71
71
  * @license
72
72
  * docx-preview <https://github.com/VolodymyrBaydalka/docxjs>
73
73
  * Released under Apache License 2.0 <https://github.com/VolodymyrBaydalka/docxjs/blob/master/LICENSE>
@@ -96,7 +96,7 @@ section.${e}>footer { z-index: 1; }
96
96
  `}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}levelTextToContent(e,t,r,n){const s={tab:"\\9",space:"\\a0"};var a=e.replace(/%\d*/g,o=>{let l=parseInt(o.substring(1),10)-1;return`"counter(${this.numberingCounter(r,l)}, ${n})"`});return`"${a}${s[t]??""}"`}numFormatToCssValue(e){var t={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return t[e]??e}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const e=e5();for(let t of this.currentTabs)t5(t.span,t.stops,this.defaultTabSize,e)},500)}createElementNS(e,t,r,n){var s=e?this.htmlDocument.createElementNS(e,t):this.htmlDocument.createElement(t);return Object.assign(s,r),n&&e0(s,n),s}createElement(e,t,r){return this.createElementNS(void 0,e,t,r)}createSvgElement(e,t,r){return this.createElementNS(_t.svg,e,t,r)}createStyleElement(e){return this.createElement("style",{innerHTML:e})}createComment(e){return this.htmlDocument.createComment(e)}later(e){this.postRenderTasks.push(e)}}function N2(i){i.innerHTML=""}function e0(i,e){e.forEach(t=>i.appendChild(HR(t)?document.createTextNode(t):t))}function n5(i,e){for(var t=i.parent;t!=null&&t.type!=e;)t=t.parent;return t}const tE={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0};function i5(i,e){const t={...tE,...e};return gv.load(i,new K3(t),t)}async function s5(i,e,t,r){const n={...tE,...r};return await new r5(window.document).render(i,e,t,n)}async function a5(i,e,t,r){const n=await i5(i,r);return await s5(n,e,t,r),n}class o5{constructor(e={}){Ie(this,"checkboxData");Ie(this,"schema");Ie(this,"finalGeneration");Ie(this,"name","CheckboxModule");this.checkboxData=e.checkboxData||{},this.schema=e.schema,this.finalGeneration=e.finalGeneration||!1}parse(e){return null}postparse(e){return e}render(e,t){return e}postrender(e,t){return!!(t&&t.contentType&&t.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")?(()=>{try{const n=e.map(a=>{const o=typeof a=="string",l=a&&typeof a=="object"&&a.value,c=()=>o&&a,h=()=>!o&&l&&a.value,d=()=>!o&&!l&&String(a);return c()||h()||d()}).join("");return[this.processCheckboxPatterns(n)]}catch{return e}})():e}processCheckboxPatterns(e){try{const t=/<w:bookmarkStart[^>]*w:name="(Check\d+)"[^>]*\/>/gi;t.lastIndex=0;const r=[];let n;for(;(n=t.exec(e))!==null;)r.push(n[1]);return r.length>0?(()=>{const a=()=>(r.forEach(h=>{const p=this.getCheckboxState(h)?"1":"0",g=new RegExp(`(<w:fldChar w:fldCharType="begin">.*?<w:name w:val="${h}".*?<w:default w:val=")([01])(".*?</w:fldChar>)`,"gs");e=e.replace(g,`$1${p}$3`)}),e),o=()=>(t.lastIndex=0,e.replace(t,(h,d)=>{try{return`<w:r><w:t>${`|||${this.getCheckboxState(d)?"☑":"☐"}|||checkbox:${d}|||`}</w:t></w:r><w:bookmarkStart w:name="${d}" w:id="0"/>`}catch{return h}})),l=()=>this.finalGeneration&&a(),c=()=>!this.finalGeneration&&o();return l()||c()})():e}catch{return e}}getCheckboxState(e){const t=!!this.schema,r=()=>!t&&(this.checkboxData[e]||!1),n=()=>t&&(()=>{const s=Object.entries(this.schema.properties||{}).find(([a,o])=>{const c=o.docx_mapping,h=c&&c.type==="checkbox",d=c&&c.type==="radio"&&c.mapping,p=h&&c.name===e,g=h&&c.true_name===e,y=h&&c.false_name===e,b=d&&c.mapping.find(w=>w.name===e);return p||g||y||!!b});return s?(()=>{const[a,o]=s,c=o.docx_mapping,h=c&&c.type==="checkbox"&&c.name===e,d=c&&c.type==="checkbox"&&c.true_name===e,p=c&&c.type==="checkbox"&&c.false_name===e,g=c&&c.type==="radio"&&c.mapping&&c.mapping.find(v=>v.name===e),y=()=>(h||d)&&this.checkboxData[a]===!0,b=()=>p&&this.checkboxData[a]===!1,w=()=>g&&this.checkboxData[a]===g.value;return y()||b()||w()||!1})():this.checkboxData[e]||!1})();return r()||n()||!1}updateCheckboxData(e){this.checkboxData={...this.checkboxData,...e}}}let vn={},M2={};const l5=({docxUrl:i,schema:e,onDataChange:t,initialData:r,onSaveRef:n,readonly:s=!1})=>{const[a,o]=Pe.useState([]),[l,c]=Pe.useState(!0),[h,d]=Pe.useState(null),[p,g]=Pe.useState(0),y=Pe.useRef(null),b=Pe.useCallback(fe=>{const K=/\{([^}]+)\}/g,be=[];let te;for(;(te=K.exec(fe))!==null;)be.push(te[1]);return[...new Set(be)]},[]),w=Pe.useCallback((fe,K)=>{vn={...vn,[fe]:K},E(fe,K),t==null||t(vn)},[t]),v=Pe.useCallback((fe,K)=>{!Object.entries(e.properties||{}).find(([te,j])=>{var ce;const ae=j.docx_mapping,H=(ae==null?void 0:ae.type)==="checkbox"&&ae.name===fe;H&&w(te,K);const se=(ae==null?void 0:ae.type)==="checkbox"&&ae.true_name===fe,le=(ae==null?void 0:ae.type)==="checkbox"&&ae.false_name===fe;se&&w(te,K),le&&w(te,!K);const oe=(ae==null?void 0:ae.type)==="radio"&&((ce=ae.mapping)==null?void 0:ce.find(Ae=>Ae.name===fe));return oe&&w(te,oe.value),H||se||le||!!oe})&&w(fe,K)},[w,e]),A=Pe.useCallback((fe,K)=>{const be=M2[fe];return!(K===be||K===""&&be==null||be===""&&K==null)},[]),E=Pe.useCallback((fe,K)=>{const be=!!y.current,te=A(fe,K);be&&y.current.querySelectorAll(`[data-field-path="${fe}"]`).forEach(ie=>{const ae=te?"field-edited":"field-original",H=te?"field-original":"field-edited";ie.classList.remove(H),ie.classList.add(ae)})},[A]),_=Pe.useCallback(()=>{!!y.current&&Object.entries(vn).forEach(([K,be])=>{E(K,be)})},[E]),C=Pe.useCallback(async()=>{t==null||t(vn),g(fe=>fe+1)},[t]);Pe.useEffect(()=>{n&&(n.current=C)},[C,n]);const I=Pe.useCallback(async fe=>{try{const be=await(await fetch(i)).arrayBuffer(),te=new _2(be),j={};Object.entries(fe).forEach(([le,oe])=>{(typeof oe=="boolean"||oe==="true"||oe==="false")&&(j[le]=oe===!0||oe==="true")});const ie=new v2(te,{paragraphLoop:!0,linebreaks:!0,nullGetter:le=>`||| |||${le.value||"unknown_field"}|||`,modules:[new o5({checkboxData:j,schema:e,finalGeneration:!1})]}),ae={},H="__NEWLINE__";return Object.entries(fe).forEach(([le,oe])=>{if(oe!=null&&oe!==""){let ce=oe;typeof oe=="string"&&(ce=oe.replace(/\n/g,H)),ae[le]=`|||${ce}|||${le}|||`}else ae[le]=null}),ie.render(ae),ie.getZip().generate({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}catch(K){throw console.error("Error processing document:",K),new Error(K instanceof Error?K.message:"Failed to process document")}},[i,e]),k=Pe.useCallback((fe,K,be,te)=>{const j=document.createElement("span");j.className="inline-field-container",j.setAttribute("data-field-path",fe);const ie=s,ae=K||vn[fe]||"",H=()=>{const U=be.type==="boolean"?(()=>{const B=document.createElement("span");return B.textContent=ae==="true"||vn[fe]===!0?"☑":"☐",B.className="inline-checkbox-readonly",B})():(()=>{const B="__NEWLINE__",F=String(ae).replace(new RegExp(B,"g"),`
97
97
  `),M=document.createElement("span");return M.textContent=F,M.className="inline-field-readonly",M.style.whiteSpace="pre-wrap",M})();return j.appendChild(U),j},se=()=>{const x=document.createElement("input");return x.type="checkbox",x.checked=K==="true"||vn[fe]===!0,x.className="inline-checkbox rounded border-gray-300 text-green-600 focus:ring-green-500",x.setAttribute("data-field-path",fe),x.addEventListener("change",U=>{w(fe,U.target.checked)}),j.appendChild(x),j},le=()=>{const x=document.createElement("select");x.className="inline-select border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-500",x.setAttribute("data-field-path",fe);const U=document.createElement("option");return U.value="",U.textContent="Select...",x.appendChild(U),be.enum.forEach(B=>{const F=document.createElement("option");F.value=String(B),F.textContent=String(B),F.selected=K===B||vn[fe]===B,x.appendChild(F)}),x.addEventListener("change",B=>{w(fe,B.target.value)}),j.appendChild(x),j},oe=()=>{const x=document.createElement("input");return x.type=be.format==="date"?"date":"datetime-local",x.value=String(K||vn[fe]||""),x.className="inline-date-input text-sm focus:outline-none",x.setAttribute("data-field-path",fe),x.style.width="100%",x.style.maxWidth="200px",x.placeholder=String(be.description||fe),x.addEventListener("input",U=>{w(fe,U.target.value)}),j.appendChild(x),j},ce=()=>{const x="__NEWLINE__",U=String(K||vn[fe]||"").replace(new RegExp(x,"g"),`
98
98
  `),B=document.createElement("textarea");B.value=U,B.className="inline-textarea text-sm focus:outline-none resize-none",B.setAttribute("data-field-path",fe),B.style.width="100%",B.style.minHeight="17px",B.style.overflow="hidden",B.placeholder=String(be.description||fe),B.rows=1;const F=()=>{B.style.height="auto";const M=B.value.includes(`
99
- `)||B.scrollHeight>25;B.style.height=M?Math.max(17,B.scrollHeight)+"px":"17px"};return B.addEventListener("input",M=>{w(fe,M.target.value),F()}),setTimeout(F,0),j.appendChild(B),j},Ae=()=>ie&&H(),Se=()=>!ie&&be.type==="boolean"&&se(),Ne=()=>!ie&&be.enum&&le(),Te=()=>!ie&&(be.format==="date"||be.format==="date-time")&&oe();return Ae()||Se()||Ne()||Te()||ce()},[w,s]),D=Pe.useCallback((fe,K)=>{const be=document.createTreeWalker(fe,NodeFilter.SHOW_TEXT,null,!1),te=[];let j;for(;j=be.nextNode();)te.push(j);te.forEach(ie=>{const ae=!!ie.textContent,H=/\|\|\|([^|]*)\|\|\|([^|]+)\|\|\|/g,se=ie.textContent||"",le=H.test(se),oe=ie.parentNode;ae&&le&&oe&&(()=>{let ce=0;const Ae=document.createDocumentFragment();ie.textContent.replace(H,(Se,Ne,Te,x)=>{x>ce&&Ae.appendChild(document.createTextNode(se.slice(ce,x)));const M=Te.startsWith("checkbox:")?(()=>{const q=Te.replace("checkbox:",""),de=Object.entries(e.properties||{}).find(([ge,ve])=>{const me=ve.docx_mapping;return(me==null?void 0:me.type)==="checkbox"&&me.true_name&&me.false_name&&(me.true_name===q||me.false_name===q)}),[we,ee]=de||[],Ee=ee,De=Ee==null?void 0:Ee.docx_mapping,Ce=!!de,Me=(De==null?void 0:De.true_name)===q,$e=()=>{const ge=document.createElement("span");return ge.textContent=Ne,ge.className="inline-checkbox-readonly",ge},Xe=()=>{const ge=document.createElement("span");ge.className="inline-radio-container";const ve=document.createElement("input");ve.type="radio",ve.name=`radio-group-${we}`,ve.value=Me?"true":"false";const he=K[we];return ve.checked=Me?he===!0||he==="true":he===!1||he==="false",ve.className="text-green-600 focus:ring-green-500 border-gray-300",ve.setAttribute("data-field-path",q),ve.addEventListener("change",me=>{me.target.checked&&v(q,!0)}),ge.appendChild(ve),ge},Tt=()=>{const ge=document.createElement("input");return ge.type="checkbox",ge.checked=Ne==="☑",ge.className="inline-checkbox rounded border-gray-300 text-green-600 focus:ring-green-500",ge.setAttribute("data-field-path",q),ge.addEventListener("change",ve=>{v(q,ve.target.checked)}),ge},nr=()=>s&&$e(),yr=()=>!s&&Ce&&Xe(),rr=()=>!s&&!Ce&&Tt();return nr()||yr()||rr()})():(()=>{var de;const q=((de=e.properties)==null?void 0:de[Te])||{};return k(Te,Ne,q,K)})();return Ae.appendChild(M),ce=x+Se.length,Se}),ce<se.length&&Ae.appendChild(document.createTextNode(se.slice(ce))),oe.replaceChild(Ae,ie)})()})},[e,k,v,s]),R=Pe.useCallback(async fe=>{!!y.current&&await(async()=>{try{const be=await I(fe);for(;y.current.firstChild;)y.current.removeChild(y.current.firstChild);await a5(be,y.current,void 0,{className:"docx-preview",inWrapper:!0,hideWrapperOnPrint:!0,ignoreWidth:!1,ignoreHeight:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!0,trimXmlDeclaration:!0,renderHeaders:!1,renderFooters:!1,renderFootnotes:!0,renderEndnotes:!0,ignoreLastRenderedPageBreak:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1}),setTimeout(()=>{!!y.current&&(D(y.current,fe),_())},100)}catch(be){console.error("Error updating preview:",be),!!y.current&&(()=>{for(;y.current.firstChild;)y.current.removeChild(y.current.firstChild);const j=document.createElement("div");j.className="p-4 text-red-600",j.textContent=`Error updating preview: ${be instanceof Error?be.message:"Unknown error"}`,y.current.appendChild(j)})()}})()},[I,D,_]),z=Pe.useCallback(async()=>{try{c(!0);const K=await(await fetch(i)).arrayBuffer(),be=new _2(K),j=new v2(be).getFullText(),ie=b(j);o(ie);const ae={};ie.forEach(se=>{var Te;const le=(Te=e.properties)==null?void 0:Te[se],oe=!!le,ce=()=>oe&&le.type==="boolean"&&!1,Ae=()=>oe&&le.type==="string"&&le.format==="date"&&"",Se=()=>oe&&le.type!=="boolean"&&!(le.type==="string"&&le.format==="date")&&"",Ne=()=>!oe&&"";ae[se]=ce()||Ae()||Se()||""});const H={...ae,...r};vn=H,M2={...H},d(null)}catch(fe){d(`Failed to load document: ${fe instanceof Error?fe.message:"Unknown error"}`)}finally{c(!1)}},[i,e,b,r]);Pe.useEffect(()=>{z()},[z]),Pe.useEffect(()=>{!l&&Object.keys(vn).length>0&&!!y.current&&R(vn)},[l,R]),Pe.useEffect(()=>{p>0&&!!y.current&&R(vn)},[p,R]);const G=()=>ye.jsx("div",{className:"flex items-center justify-center p-8",children:ye.jsx("div",{className:"text-body",children:"Loading document..."})}),O=()=>ye.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[ye.jsx("div",{className:"text-red-800 text-body-em",children:"Error"}),ye.jsx("div",{className:"text-red-700 text-body mt-1",children:h})]}),X=l,S=!l&&!!h,J=()=>X&&ye.jsx(G,{}),Y=()=>S&&ye.jsx(O,{}),W=()=>!X&&!S&&ye.jsxs("div",{children:[ye.jsx("style",{children:`
99
+ `)||B.scrollHeight>25;B.style.height=M?Math.max(17,B.scrollHeight)+"px":"17px"};return B.addEventListener("input",M=>{w(fe,M.target.value),F()}),setTimeout(F,0),j.appendChild(B),j},Ae=()=>ie&&H(),Se=()=>!ie&&be.type==="boolean"&&se(),Ne=()=>!ie&&be.enum&&le(),Te=()=>!ie&&(be.format==="date"||be.format==="date-time")&&oe();return Ae()||Se()||Ne()||Te()||ce()},[w,s]),D=Pe.useCallback((fe,K)=>{const be=document.createTreeWalker(fe,NodeFilter.SHOW_TEXT,null,!1),te=[];let j;for(;j=be.nextNode();)te.push(j);te.forEach(ie=>{const ae=!!ie.textContent,H=/\|\|\|([^|]*)\|\|\|([^|]+)\|\|\|/g,se=ie.textContent||"",le=H.test(se),oe=ie.parentNode;ae&&le&&oe&&(()=>{let ce=0;const Ae=document.createDocumentFragment();ie.textContent.replace(H,(Se,Ne,Te,x)=>{x>ce&&Ae.appendChild(document.createTextNode(se.slice(ce,x)));const M=Te.startsWith("checkbox:")?(()=>{const q=Te.replace("checkbox:",""),de=Object.entries(e.properties||{}).find(([ge,ve])=>{const me=ve.docx_mapping;return(me==null?void 0:me.type)==="checkbox"&&me.true_name&&me.false_name&&(me.true_name===q||me.false_name===q)}),[ye,ee]=de||[],Ee=ee,De=Ee==null?void 0:Ee.docx_mapping,Ce=!!de,Me=(De==null?void 0:De.true_name)===q,$e=()=>{const ge=document.createElement("span");return ge.textContent=Ne,ge.className="inline-checkbox-readonly",ge},Xe=()=>{const ge=document.createElement("span");ge.className="inline-radio-container";const ve=document.createElement("input");ve.type="radio",ve.name=`radio-group-${ye}`,ve.value=Me?"true":"false";const he=K[ye];return ve.checked=Me?he===!0||he==="true":he===!1||he==="false",ve.className="text-green-600 focus:ring-green-500 border-gray-300",ve.setAttribute("data-field-path",q),ve.addEventListener("change",me=>{me.target.checked&&v(q,!0)}),ge.appendChild(ve),ge},Tt=()=>{const ge=document.createElement("input");return ge.type="checkbox",ge.checked=Ne==="☑",ge.className="inline-checkbox rounded border-gray-300 text-green-600 focus:ring-green-500",ge.setAttribute("data-field-path",q),ge.addEventListener("change",ve=>{v(q,ve.target.checked)}),ge},nr=()=>s&&$e(),yr=()=>!s&&Ce&&Xe(),rr=()=>!s&&!Ce&&Tt();return nr()||yr()||rr()})():(()=>{var de;const q=((de=e.properties)==null?void 0:de[Te])||{};return k(Te,Ne,q,K)})();return Ae.appendChild(M),ce=x+Se.length,Se}),ce<se.length&&Ae.appendChild(document.createTextNode(se.slice(ce))),oe.replaceChild(Ae,ie)})()})},[e,k,v,s]),R=Pe.useCallback(async fe=>{!!y.current&&await(async()=>{try{const be=await I(fe);for(;y.current.firstChild;)y.current.removeChild(y.current.firstChild);await a5(be,y.current,void 0,{className:"docx-preview",inWrapper:!0,hideWrapperOnPrint:!0,ignoreWidth:!1,ignoreHeight:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!0,trimXmlDeclaration:!0,renderHeaders:!1,renderFooters:!1,renderFootnotes:!0,renderEndnotes:!0,ignoreLastRenderedPageBreak:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1}),setTimeout(()=>{!!y.current&&(D(y.current,fe),_())},100)}catch(be){console.error("Error updating preview:",be),!!y.current&&(()=>{for(;y.current.firstChild;)y.current.removeChild(y.current.firstChild);const j=document.createElement("div");j.className="p-4 text-red-600",j.textContent=`Error updating preview: ${be instanceof Error?be.message:"Unknown error"}`,y.current.appendChild(j)})()}})()},[I,D,_]),z=Pe.useCallback(async()=>{try{c(!0);const K=await(await fetch(i)).arrayBuffer(),be=new _2(K),j=new v2(be).getFullText(),ie=b(j);o(ie);const ae={};ie.forEach(se=>{var Te;const le=(Te=e.properties)==null?void 0:Te[se],oe=!!le,ce=()=>oe&&le.type==="boolean"&&!1,Ae=()=>oe&&le.type==="string"&&le.format==="date"&&"",Se=()=>oe&&le.type!=="boolean"&&!(le.type==="string"&&le.format==="date")&&"",Ne=()=>!oe&&"";ae[se]=ce()||Ae()||Se()||""});const H={...ae,...r};vn=H,M2={...H},d(null)}catch(fe){d(`Failed to load document: ${fe instanceof Error?fe.message:"Unknown error"}`)}finally{c(!1)}},[i,e,b,r]);Pe.useEffect(()=>{z()},[z]),Pe.useEffect(()=>{!l&&Object.keys(vn).length>0&&!!y.current&&R(vn)},[l,R]),Pe.useEffect(()=>{p>0&&!!y.current&&R(vn)},[p,R]);const G=()=>we.jsx("div",{className:"flex items-center justify-center p-8",children:we.jsx("div",{className:"text-body",children:"Loading document..."})}),O=()=>we.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[we.jsx("div",{className:"text-red-800 text-body-em",children:"Error"}),we.jsx("div",{className:"text-red-700 text-body mt-1",children:h})]}),X=l,S=!l&&!!h,J=()=>X&&we.jsx(G,{}),Y=()=>S&&we.jsx(O,{}),W=()=>!X&&!S&&we.jsxs("div",{children:[we.jsx("style",{children:`
100
100
  .inline-field-container {
101
101
  display: block;
102
102
  margin: 0;
@@ -289,4 +289,4 @@ section.${e}>footer { z-index: 1; }
289
289
  font-size: inherit;
290
290
  margin: 0 2px;
291
291
  }
292
- `}),ye.jsx("div",{className:"bg-white max-w-full",children:ye.jsx("div",{ref:y,className:"bg-white"})})]});return J()||Y()||W()};exports.DocumentEditor=l5;exports.HelloWorld=IE;exports.ImageViewer=A_;exports.InputPrompt=h_;exports.PdfViewer=KS;exports.Sidebar=y_;exports.TabsContainer=JS;exports.materialTheme=DE;exports.tailwindTheme=kE;
292
+ `}),we.jsx("div",{className:"bg-white max-w-full",children:we.jsx("div",{ref:y,className:"bg-white"})})]});return J()||Y()||W()};exports.DocumentEditor=l5;exports.HelloWorld=IE;exports.ImageViewer=A_;exports.InputPrompt=h_;exports.PdfViewer=KS;exports.Sidebar=y_;exports.TabsContainer=JS;exports.materialTheme=DE;exports.tailwindTheme=kE;