@zeniai/web-cockpit-ui 2.2.41-qa → 2.2.42-qa

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.
Files changed (39) hide show
  1. package/dist/assets/{CreditAgentRoutes-DdvubR8Z.js → CreditAgentRoutes-ErAQlOHB.js} +1 -1
  2. package/dist/assets/{Preview-BNcXoFu-.js → Preview-D4vnK8Bk.js} +1 -1
  3. package/dist/assets/{ScreenRoutes-BC9Q2kAr.js → ScreenRoutes-CE-2Tj1d.js} +48 -48
  4. package/dist/assets/SignInScreen-BSc5qqTv.js +1 -0
  5. package/dist/assets/{analytics-mjW35rRf.js → analytics-qjKu72CP.js} +23 -23
  6. package/dist/assets/{analyticsHelper-YaLVWIG3.js → analyticsHelper-CibxtJqd.js} +1 -1
  7. package/dist/assets/{core-BDcFi_72.js → core-kDzcwErP.js} +1 -1
  8. package/dist/assets/{dash.all.min-C3Z_UkF7.js → dash.all.min-B9W8x92U.js} +1 -1
  9. package/dist/assets/{empty-CgYLD2qf.js → empty-Bnn0zo5b.js} +1 -1
  10. package/dist/assets/{empty-Jc4qs5f9.js → empty-CdLmUDrM.js} +1 -1
  11. package/dist/assets/{epic-DQelVzDp.js → epic-CiGXI5L-.js} +1 -1
  12. package/dist/assets/{index-CqQr0ZB9.js → index-B7W4HILP.js} +64 -65
  13. package/dist/assets/{index-BOz0wXfz.js → index-Cy6_UeJ6.js} +1 -1
  14. package/dist/assets/{index--ls1mnOQ.js → index-DP1J6R69.js} +1 -1
  15. package/dist/assets/{index-TuR64bb4.js → index-DlGmElBC.js} +1 -1
  16. package/dist/assets/{index-CoGs120j.js → index-DzHZDGWq.js} +2 -2
  17. package/dist/assets/{index-CipuZsLG.js → index-bmJpztu9.js} +1 -1
  18. package/dist/assets/{index-Diyol4zO.js → index-fXjCjw6w.js} +1 -1
  19. package/dist/assets/{lexical-uzfcaaYd.js → lexical-BSGlB8Tt.js} +1 -1
  20. package/dist/assets/{liveblocks-Dt6r-fcM.js → liveblocks-DySvlCFz.js} +1 -1
  21. package/dist/assets/{lottie-D9W-dgA5.js → lottie-BeYaqM3r.js} +1 -1
  22. package/dist/assets/{mui-BElll8Xy.js → mui-DaMtXmvv.js} +1 -1
  23. package/dist/assets/{react-C7NDvs_I.js → react-BsyKMuVi.js} +1 -1
  24. package/dist/assets/{react-B4rxvEyu.js → react-CBSFG41b.js} +1 -1
  25. package/dist/assets/{react-DuG8IGrX.js → react-D42xmk9Q.js} +1 -1
  26. package/dist/assets/{react-BWHZhBVD.js → react-DC_dRO0A.js} +1 -1
  27. package/dist/assets/{react-rLAVHKH6.js → react-DY9zNzKf.js} +1 -1
  28. package/dist/assets/{react-BSrHuELw.js → react-Do2KbqWf.js} +2 -2
  29. package/dist/assets/{react-DYB9F9-J.js → react-QFDyk72I.js} +1 -1
  30. package/dist/assets/{react-CtiLL5Qs.js → react-sgShXZCu.js} +1 -1
  31. package/dist/assets/{recharts-CCZEPeJr.js → recharts-BEzCLGEF.js} +1 -1
  32. package/dist/assets/{sentry-DD0HIvOH.js → sentry-CrFvlFGm.js} +1 -1
  33. package/dist/assets/{url-CP8T_H6Z.js → url-BwZimkA1.js} +1 -1
  34. package/dist/assets/{url-BkXBPObc.js → url-DtZG2OD7.js} +1 -1
  35. package/dist/assets/{utils-ZIql0v4_.js → utils-ueB_tslp.js} +1 -1
  36. package/dist/assets/{zeni-epic-state-BERB8zIa.js → zeni-epic-state-CusYXz9D.js} +3 -3
  37. package/dist/index.html +1 -1
  38. package/package.json +3 -3
  39. package/dist/assets/SignInScreen-Dnv-RvHN.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-CgYLD2qf.js","assets/sentry-DD0HIvOH.js","assets/empty-Jc4qs5f9.js","assets/index-TuR64bb4.js","assets/index-Diyol4zO.js","assets/zeni-epic-state-BERB8zIa.js","assets/core-BDcFi_72.js","assets/utils-ZIql0v4_.js","assets/recharts-CCZEPeJr.js","assets/url-CP8T_H6Z.js","assets/index-BOz0wXfz.js","assets/index--ls1mnOQ.js","assets/url-BkXBPObc.js","assets/index-CoGs120j.js","assets/ScreenRoutes-BC9Q2kAr.js","assets/liveblocks-Dt6r-fcM.js","assets/analyticsHelper-YaLVWIG3.js","assets/mui-BElll8Xy.js","assets/SignInScreen-Dnv-RvHN.js","assets/analytics-mjW35rRf.js","assets/lottie-D9W-dgA5.js","assets/lexical-uzfcaaYd.js"])))=>i.map(i=>d[i]);
2
- import{a as g,R as $,e as tJe,b as D4,p as R0,r as Tc,g as eZ,d as vre,f as oJe,s as Cre,w as rJe,i as iJe,S as nJe,j as aJe,k as sJe,l as lJe,m as cJe}from"./sentry-DD0HIvOH.js";import{j as Co,_ as B$e,a as Cd,u as D$e,T as dJe,C as pJe,b as uJe,c as uj,d as hj,e as hJe,f as mJe,g as P$e,h as gJe,i as fJe,L as xJe,k as Are,l as yJe,m as bJe,n as wJe,P as vJe,o as CJe,p as AJe,q as T$e,r as $Je,s as kJe,I as $re,t as SJe,v as EJe,w as LJe,x as IJe,y as jJe,z as MJe,A as z$e,B as BJe,D as DJe,E as PJe}from"./liveblocks-Dt6r-fcM.js";import{f as R$e,R as o4,r as Fn,P as Pn,u as mj,g as yh,h as TJe,i as tZ,j as zJe,k as RJe,l as mT,N as FJe,m as OJe,n as NJe,B as HJe}from"./core-BDcFi_72.js";import{H as CE,ba as r4,bb as _Je,bc as kre,bd as X4,be as xr,bf as F$e,bg as Wr,bh as gj,bi as VJe,bj as Ph,bk as UJe,bl as QJe,bm as S8,bn as hg,bo as b9,bp as O$e,bq as WJe,br as Z1,bs as N$e,bt as GJe,bu as oZ,bv as H$e,bw as ln,bx as E8,by as Gu,bz as Sre,bA as YJe,bB as KJe,bC as _$e,bD as NW,bE as qJe,bF as ZJe,bG as JJe,bH as XJe,bI as rZ,bJ as V$e,bK as eXe,bL as qb,bM as tXe,bN as U$e,bO as HW,bP as Ere,bQ as Lre,bR as Ire,bS as zl,bT as iZ,bU as Q$e,bV as W$e,bW as nZ,bX as w9,bY as fj,bZ as aZ,b_ as sZ,b$ as lZ,c0 as cZ,c1 as oXe,c2 as xj,c3 as lp,c4 as cp,c5 as AE,c6 as G$e,c7 as Y$e,c8 as rXe,c9 as dZ,ca as pZ,cb as iXe,cc as nXe,cd as tp,ce as Pv,cf as Tv,cg as aXe,ch as sXe,ci as lXe,cj as cXe,ck as dXe,cl as pXe,cm as uXe,cn as yA,co as K$e,cp as q$e,cq as hXe,cr as mXe,cs as Z$e,ct as J$e,cu as gXe,cv as fXe,cw as xXe,cx as X$e,cy as eke,cz as yXe,cA as bXe,cB as tke,cC as oke,cD as wXe,cE as jre,cF as vXe,cG as CXe,cH as Iw,cI as AXe,cJ as rke,cK as $Xe,cL as ike,cM as kXe,cN as Mre,cO as SXe,cP as nke,cQ as ake,cR as ske,cS as lke,cT as cke,cU as EXe,cV as dke,cW as LXe,cX as IXe,cY as jXe,cZ as pke,c_ as _W,c$ as MXe,d0 as uke,d1 as hke,d2 as BXe,d3 as DXe,d4 as PXe,d5 as TXe,d6 as zXe,d7 as RXe,d8 as FXe,d9 as OXe,v as NXe,da as yj,db as VW,dc as UW,dd as HXe,de as _Xe,df as VXe,dg as UXe,dh as QXe,di as WXe,dj as GXe,dk as YXe,dl as KXe,dm as qXe,dn as Bre,dp as ZXe,dq as JXe,dr as XXe,ds as eet,dt as tet}from"./zeni-epic-state-BERB8zIa.js";import{T as mke,j as Qo,n as i,c as pe,k as _t,G as zv,C as gke,u as oet,a as ret}from"./mui-BElll8Xy.js";import{r as iet,m as Yu}from"./analytics-mjW35rRf.js";import{L as QW}from"./lottie-D9W-dgA5.js";import{r as Ta}from"./lexical-uzfcaaYd.js";import{E as en,c as bj,P as net,R as WW,F as $E,X as gd,Y as fd,G as k2,H as kE,I as wj,J as S2,K as fke,L as aet,M as set,N as e5,O as uZ,Q as hZ,S as Rv,U as cet}from"./recharts-CCZEPeJr.js";import{r as det}from"./utils-ZIql0v4_.js";(function(){try{var e=typeof window<"u"?window:typeof D4<"u"?D4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="257ef94c-5dd6-439f-b681-17d42d99a4fb",e._sentryDebugIdIdentifier="sentry-dbid-257ef94c-5dd6-439f-b681-17d42d99a4fb")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}})();var bA={},Dre;function pet(){if(Dre)return bA;Dre=1;var e=R$e();return bA.createRoot=e.createRoot,bA.hydrateRoot=e.hydrateRoot,bA}var uet=pet(),wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof D4<"u"?D4:typeof self<"u"?self:{};function Vr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pre={exports:{}},yx={},Tre;function het(){if(Tre)return yx;Tre=1;var e=$,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(d,p,u){var h,m={},f=null,x=null;u!==void 0&&(f=""+u),p.key!==void 0&&(f=""+p.key),p.ref!==void 0&&(x=p.ref);for(h in p)n.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(d&&d.defaultProps)for(h in p=d.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:d,key:f,ref:x,props:m,_owner:a.current}}return yx.Fragment=r,yx.jsx=c,yx.jsxs=c,yx}var zre;function xke(){return zre||(zre=1,Pre.exports=het()),Pre.exports}var s=xke();const met=g.createContext(null),gT={didCatch:!1,error:null};let get=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gT}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:a,reason:"imperative-api"}),this.setState(gT)}}componentDidCatch(e,t){var r,n;(r=(n=this.props).onError)===null||r===void 0||r.call(n,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&t.error!==null&&fet(e.resetKeys,n)){var a,l;(a=(l=this.props).onReset)===null||a===void 0||a.call(l,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(gT)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:a,error:l}=this.state;let c=e;if(a){const d={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")c=t(d);else if(r)c=g.createElement(r,d);else if(n!==void 0)c=n;else throw l}return g.createElement(met.Provider,{value:{didCatch:a,error:l,resetErrorBoundary:this.resetErrorBoundary}},c)}};function fet(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}var GW={exports:{}},xet=GW.exports,Rre;function yet(){return Rre||(Rre=1,(function(e){(function(t,r){e.exports?e.exports=r():t.numeral=r()})(xet,function(){var t,r,n="2.0.6",a={},l={},c={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},d={currentLocale:c.currentLocale,zeroFormat:c.zeroFormat,nullFormat:c.nullFormat,defaultFormat:c.defaultFormat,scalePercentBy100:c.scalePercentBy100};function p(u,h){this._input=u,this._value=h}return t=function(u){var h,m,f,x;if(t.isNumeral(u))h=u.value();else if(u===0||typeof u>"u")h=0;else if(u===null||r.isNaN(u))h=null;else if(typeof u=="string")if(d.zeroFormat&&u===d.zeroFormat)h=0;else if(d.nullFormat&&u===d.nullFormat||!u.replace(/[^0-9]+/g,"").length)h=null;else{for(m in a)if(x=typeof a[m].regexps.unformat=="function"?a[m].regexps.unformat():a[m].regexps.unformat,x&&u.match(x)){f=a[m].unformat;break}f=f||t._.stringToNumber,h=f(u)}else h=Number(u)||null;return new p(u,h)},t.version=n,t.isNumeral=function(u){return u instanceof p},t._=r={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,b=0,w="",v=1e12,A=1e9,S=1e6,E=1e3,I="",L=!1,B,D,P,T,R,N,K;if(u=u||0,D=Math.abs(u),t._.includes(h,"(")?(x=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(R=t._.includes(h,"+")?h.indexOf("+"):u<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(B=h.match(/a(k|m|b|t)?/),B=B?B[1]:!1,t._.includes(h," a")&&(w=" "),h=h.replace(new RegExp(w+"a[kmbt]?"),""),D>=v&&!B||B==="t"?(w+=f.abbreviations.trillion,u=u/v):D<v&&D>=A&&!B||B==="b"?(w+=f.abbreviations.billion,u=u/A):D<A&&D>=S&&!B||B==="m"?(w+=f.abbreviations.million,u=u/S):(D<S&&D>=E&&!B||B==="k")&&(w+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),P=u.toString().split(".")[0],T=h.split(".")[1],N=h.indexOf(","),b=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,T?(t._.includes(T,"[")?(T=T.replace("]",""),T=T.split("["),I=t._.toFixed(u,T[0].length+T[1].length,m,T[1].length)):I=t._.toFixed(u,T.length,m),P=I.split(".")[0],t._.includes(I,".")?I=f.delimiters.decimal+I.split(".")[1]:I="",y&&Number(I.slice(1))===0&&(I="")):P=t._.toFixed(u,0,m),w&&!B&&Number(P)>=1e3&&w!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),w){case f.abbreviations.thousand:w=f.abbreviations.million;break;case f.abbreviations.million:w=f.abbreviations.billion;break;case f.abbreviations.billion:w=f.abbreviations.trillion;break}if(t._.includes(P,"-")&&(P=P.slice(1),L=!0),P.length<b)for(var q=b-P.length;q>0;q--)P="0"+P;return N>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(P=""),K=P+I+(w||""),x?K=(x&&L?"(":"")+K+(x&&L?")":""):R>=0?K=R===0?(L?"-":"+")+K:K+(L?"-":"+"):L&&(K="-"+K),K},stringToNumber:function(u){var h=l[d.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,b;if(d.zeroFormat&&u===d.zeroFormat)y=0;else if(d.nullFormat&&u===d.nullFormat||!u.replace(/[^0-9]+/g,"").length)y=null;else{y=1,h.delimiters.decimal!=="."&&(u=u.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(x in f)if(b=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(b)){y*=Math.pow(10,f[x]);break}y*=(u.split("-").length+Math.min(u.split("(").length-1,u.split(")").length-1))%2?1:-1,u=u.replace(/[^0-9\.]+/g,""),y*=Number(u)}return y},isNaN:function(u){return typeof u=="number"&&isNaN(u)},includes:function(u,h){return u.indexOf(h)!==-1},insert:function(u,h,m){return u.slice(0,m)+h+u.slice(m)},reduce:function(u,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var m=Object(u),f=m.length>>>0,x=0,y;if(arguments.length===3)y=arguments[2];else{for(;x<f&&!(x in m);)x++;if(x>=f)throw new TypeError("Reduce of empty array with no initial value");y=m[x++]}for(;x<f;x++)x in m&&(y=h(y,m[x],x,m));return y},multiplier:function(u){var h=u.toString().split(".");return h.length<2?1:Math.pow(10,h[1].length)},correctionFactor:function(){var u=Array.prototype.slice.call(arguments);return u.reduce(function(h,m){var f=r.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),b,w,v,A;return x.length===2?b=Math.min(Math.max(x[1].length,y),h):b=y,v=Math.pow(10,b),A=(m(u+"e+"+b)/v).toFixed(b),f>h-b&&(w=new RegExp("\\.?0{1,"+(f-(h-b))+"}$"),A=A.replace(w,"")),A}},t.options=d,t.formats=a,t.locales=l,t.locale=function(u){return u&&(d.currentLocale=u.toLowerCase()),d.currentLocale},t.localeData=function(u){if(!u)return l[d.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in c)d[u]=c[u]},t.zeroFormat=function(u){d.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){d.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){d.defaultFormat=typeof u=="string"?u:"0.0"},t.register=function(u,h,m){if(h=h.toLowerCase(),this[u+"s"][h])throw new TypeError(h+" "+u+" already registered.");return this[u+"s"][h]=m,m},t.validate=function(u,h){var m,f,x,y,b,w,v,A;if(typeof u!="string"&&(u+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",u)),u=u.trim(),u.match(/^\d+$/))return!0;if(u==="")return!1;try{v=t.localeData(h)}catch{v=t.localeData(t.locale())}return x=v.currency.symbol,b=v.abbreviations,m=v.delimiters.decimal,v.delimiters.thousands==="."?f="\\.":f=v.delimiters.thousands,A=u.match(/^[^\d]+/),A!==null&&(u=u.substr(1),A[0]!==x)||(A=u.match(/[^\d]+$/),A!==null&&(u=u.slice(0,-1),A[0]!==b.thousand&&A[0]!==b.million&&A[0]!==b.billion&&A[0]!==b.trillion))?!1:(w=new RegExp(f+"{2}"),u.match(/[^\d.,]/g)?!1:(y=u.split(m),y.length>2?!1:y.length<2?!!y[0].match(/^\d+.*\d$/)&&!y[0].match(w):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||d.defaultFormat,x,y,b;if(h=h||Math.round,m===0&&d.zeroFormat!==null)y=d.zeroFormat;else if(m===null&&d.nullFormat!==null)y=d.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){b=a[x].format;break}b=b||t._.numberToFormat,y=b(m,f,h)}return y},value:function(){return this._value},input:function(){return this._input},set:function(u){return this._value=Number(u),this},add:function(u){var h=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f+Math.round(h*x)}return this._value=r.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f-Math.round(h*x)}return this._value=r.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)*Math.round(f*b)/Math.round(b*b)}return this._value=r.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)/Math.round(f*b)}return this._value=r.reduce([this._value,u],h),this},difference:function(u){return Math.abs(t(this._value).subtract(u).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(u){var h=u%10;return~~(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),(function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(u,h,m){var f=t._.includes(h," BPS")?" ":"",x;return u=u*1e4,h=h.replace(/\s?BPS/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"BPS"),x=x.join("")):x=x+f+"BPS",x},unformat:function(u){return+(t._.stringToNumber(u)*1e-4).toFixed(15)}})})(),(function(){var u={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},m=u.suffixes.concat(h.suffixes.filter(function(x){return u.suffixes.indexOf(x)<0})),f=m.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(x,y,b){var w,v=t._.includes(y,"ib")?h:u,A=t._.includes(y," b")||t._.includes(y," ib")?" ":"",S,E,I;for(y=y.replace(/\s?i?b/,""),S=0;S<=v.suffixes.length;S++)if(E=Math.pow(v.base,S),I=Math.pow(v.base,S+1),x===null||x===0||x>=E&&x<I){A+=v.suffixes[S],E>0&&(x=x/E);break}return w=t._.numberToFormat(x,y,b),w+A},unformat:function(x){var y=t._.stringToNumber(x),b,w;if(y){for(b=u.suffixes.length-1;b>=0;b--){if(t._.includes(x,u.suffixes[b])){w=Math.pow(u.base,b);break}if(t._.includes(x,h.suffixes[b])){w=Math.pow(h.base,b);break}}y*=w||1}return y}})})(),(function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},y,b,w;for(h=h.replace(/\s?\$\s?/,""),y=t._.numberToFormat(u,h,m),u>=0?(x.before=x.before.replace(/[\-\(]/,""),x.after=x.after.replace(/[\-\)]/,"")):u<0&&!t._.includes(x.before,"-")&&!t._.includes(x.before,"(")&&(x.before="-"+x.before),w=0;w<x.before.length;w++)switch(b=x.before[w],b){case"$":y=t._.insert(y,f.currency.symbol,w);break;case" ":y=t._.insert(y," ",w+f.currency.symbol.length-1);break}for(w=x.after.length-1;w>=0;w--)switch(b=x.after[w],b){case"$":y=w===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+w)));break;case" ":y=w===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+w)+f.currency.symbol.length-1));break}return y}})})(),(function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(u,h,m){var f,x=typeof u=="number"&&!t._.isNaN(u)?u.toExponential():"0e+0",y=x.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(y[0]),h,m),f+"e"+y[1]},unformat:function(u){var h=t._.includes(u,"e+")?u.split("e+"):u.split("e-"),m=Number(h[0]),f=Number(h[1]);f=t._.includes(u,"e-")?f*=-1:f;function x(y,b,w,v){var A=t._.correctionFactor(y,b),S=y*A*(b*A)/(A*A);return S}return t._.reduce([m,Math.pow(10,f)],x,1)}})})(),(function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x,y=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),y+=f.ordinal(u),x=t._.numberToFormat(u,h,m),x+y}})})(),(function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(u,h,m){var f=t._.includes(h," %")?" ":"",x;return t.options.scalePercentBy100&&(u=u*100),h=h.replace(/\s?\%/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"%"),x=x.join("")):x=x+f+"%",x},unformat:function(u){var h=t._.stringToNumber(u);return t.options.scalePercentBy100?h*.01:h}})})(),(function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(u,h,m){var f=Math.floor(u/60/60),x=Math.floor((u-f*60*60)/60),y=Math.round(u-f*60*60-x*60);return f+":"+(x<10?"0"+x:x)+":"+(y<10?"0"+y:y)},unformat:function(u){var h=u.split(":"),m=0;return h.length===3?(m=m+Number(h[0])*60*60,m=m+Number(h[1])*60,m=m+Number(h[2])):h.length===2&&(m=m+Number(h[0])*60,m=m+Number(h[1])),Number(m)}})})(),t})})(GW)),GW.exports}var bet=yet();const ap=Vr(bet);function m2(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const c2="$$material";function wet(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var vet={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Cet(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Aet=/[A-Z]|^ms/g,$et=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yke=function(e){return e.charCodeAt(1)===45},Fre=function(e){return e!=null&&typeof e!="boolean"},fT=Cet(function(e){return yke(e)?e:e.replace(Aet,"-$&").toLowerCase()}),Ore=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace($et,function(r,n,a){return Um={name:n,styles:a,next:Um},n})}return vet[e]!==1&&!yke(e)&&typeof t=="number"&&t!==0?t+"px":t};function SE(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return Um={name:a.name,styles:a.styles,next:Um},a.name;var l=r;if(l.styles!==void 0){var c=l.next;if(c!==void 0)for(;c!==void 0;)Um={name:c.name,styles:c.styles,next:Um},c=c.next;var d=l.styles+";";return d}return ket(e,t,r)}}var p=r;return p}function ket(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=SE(e,t,r[a])+";";else for(var l in r){var c=r[l];if(typeof c!="object"){var d=c;Fre(d)&&(n+=fT(l)+":"+Ore(l,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var p=0;p<c.length;p++)Fre(c[p])&&(n+=fT(l)+":"+Ore(l,c[p])+";");else{var u=SE(e,t,c);switch(l){case"animation":case"animationName":{n+=fT(l)+":"+u+";";break}default:n+=l+"{"+u+"}"}}}return n}var Nre=/label:\s*([^\s;{]+)\s*(;|$)/g,Um;function Eet(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";Um=void 0;var l=e[0];if(l==null||l.raw===void 0)n=!1,a+=SE(r,t,l);else{var c=l;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=SE(r,t,e[d]),n){var p=l;a+=p[d]}Nre.lastIndex=0;for(var u="",h;(h=Nre.exec(a))!==null;)u+="-"+h[1];var m=wet(a)+u;return{name:m,styles:a,next:Um}}var xT={exports:{}},yT,Hre;function Let(){if(Hre)return yT;Hre=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yT=e,yT}var bT,_re;function Iet(){if(_re)return bT;_re=1;var e=Let();function t(){}function r(){}return r.resetWarningCache=t,bT=function(){function n(c,d,p,u,h,m){if(m!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function a(){return n}var l={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return l.PropTypes=l,l},bT}var Vre;function mZ(){return Vre||(Vre=1,xT.exports=Iet()()),xT.exports}var jet=mZ();const Nt=Vr(jet);function Met(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Bet(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Det=(function(){function e(r){var n=this;this._insertTag=function(a){var l;n.tags.length===0?n.insertionPoint?l=n.insertionPoint.nextSibling:n.prepend?l=n.container.firstChild:l=n.before:l=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,l),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Bet(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Met(n);try{a.insertRule(r,a.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e})(),ol="-ms-",EE="-moz-",ki="-webkit-",bke="comm",gZ="rule",fZ="decl",Pet="@import",wke="@keyframes",Tet="@layer",zet=Math.abs,vj=String.fromCharCode,Ret=Object.assign;function Fet(e,t){return zs(e,0)^45?(((t<<2^zs(e,0))<<2^zs(e,1))<<2^zs(e,2))<<2^zs(e,3):0}function vke(e){return e.trim()}function Oet(e,t){return(e=t.exec(e))?e[0]:e}function Si(e,t,r){return e.replace(t,r)}function YW(e,t){return e.indexOf(t)}function zs(e,t){return e.charCodeAt(t)|0}function jw(e,t,r){return e.slice(t,r)}function Ku(e){return e.length}function xZ(e){return e.length}function wA(e,t){return t.push(e),e}function Net(e,t){return e.map(t).join("")}var Cj=1,L8=1,Cke=0,jc=0,Ia=0,v9="";function Aj(e,t,r,n,a,l,c){return{value:e,root:t,parent:r,type:n,props:a,children:l,line:Cj,column:L8,length:c,return:""}}function bx(e,t){return Ret(Aj("",null,null,"",null,null,0),e,{length:-e.length},t)}function Het(){return Ia}function _et(){return Ia=jc>0?zs(v9,--jc):0,L8--,Ia===10&&(L8=1,Cj--),Ia}function ud(){return Ia=jc<Cke?zs(v9,jc++):0,L8++,Ia===10&&(L8=1,Cj++),Ia}function kh(){return zs(v9,jc)}function OS(){return jc}function Fv(e,t){return jw(v9,e,t)}function Mw(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ake(e){return Cj=L8=1,Cke=Ku(v9=e),jc=0,[]}function $ke(e){return v9="",e}function NS(e){return vke(Fv(jc-1,KW(e===91?e+2:e===40?e+1:e)))}function Vet(e){for(;(Ia=kh())&&Ia<33;)ud();return Mw(e)>2||Mw(Ia)>3?"":" "}function Uet(e,t){for(;--t&&ud()&&!(Ia<48||Ia>102||Ia>57&&Ia<65||Ia>70&&Ia<97););return Fv(e,OS()+(t<6&&kh()==32&&ud()==32))}function KW(e){for(;ud();)switch(Ia){case e:return jc;case 34:case 39:e!==34&&e!==39&&KW(Ia);break;case 40:e===41&&KW(e);break;case 92:ud();break}return jc}function Qet(e,t){for(;ud()&&e+Ia!==57&&!(e+Ia===84&&kh()===47););return"/*"+Fv(t,jc-1)+"*"+vj(e===47?e:ud())}function Wet(e){for(;!Mw(kh());)ud();return Fv(e,jc)}function Get(e){return $ke(HS("",null,null,null,[""],e=Ake(e),0,[0],e))}function HS(e,t,r,n,a,l,c,d,p){for(var u=0,h=0,m=c,f=0,x=0,y=0,b=1,w=1,v=1,A=0,S="",E=a,I=l,L=n,B=S;w;)switch(y=A,A=ud()){case 40:if(y!=108&&zs(B,m-1)==58){YW(B+=Si(NS(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:B+=NS(A);break;case 9:case 10:case 13:case 32:B+=Vet(y);break;case 92:B+=Uet(OS()-1,7);continue;case 47:switch(kh()){case 42:case 47:wA(Yet(Qet(ud(),OS()),t,r),p);break;default:B+="/"}break;case 123*b:d[u++]=Ku(B)*v;case 125*b:case 59:case 0:switch(A){case 0:case 125:w=0;case 59+h:v==-1&&(B=Si(B,/\f/g,"")),x>0&&Ku(B)-m&&wA(x>32?Qre(B+";",n,r,m-1):Qre(Si(B," ","")+";",n,r,m-2),p);break;case 59:B+=";";default:if(wA(L=Ure(B,t,r,u,h,a,d,S,E=[],I=[],m),l),A===123)if(h===0)HS(B,t,L,L,E,l,m,d,I);else switch(f===99&&zs(B,3)===110?100:f){case 100:case 108:case 109:case 115:HS(e,L,L,n&&wA(Ure(e,L,L,0,0,a,d,S,a,E=[],m),I),a,I,m,d,n?E:I);break;default:HS(B,L,L,L,[""],I,0,d,I)}}u=h=x=0,b=v=1,S=B="",m=c;break;case 58:m=1+Ku(B),x=y;default:if(b<1){if(A==123)--b;else if(A==125&&b++==0&&_et()==125)continue}switch(B+=vj(A),A*b){case 38:v=h>0?1:(B+="\f",-1);break;case 44:d[u++]=(Ku(B)-1)*v,v=1;break;case 64:kh()===45&&(B+=NS(ud())),f=kh(),h=m=Ku(S=B+=Wet(OS())),A++;break;case 45:y===45&&Ku(B)==2&&(b=0)}}return l}function Ure(e,t,r,n,a,l,c,d,p,u,h){for(var m=a-1,f=a===0?l:[""],x=xZ(f),y=0,b=0,w=0;y<n;++y)for(var v=0,A=jw(e,m+1,m=zet(b=c[y])),S=e;v<x;++v)(S=vke(b>0?f[v]+" "+A:Si(A,/&\f/g,f[v])))&&(p[w++]=S);return Aj(e,t,r,a===0?gZ:d,p,u,h)}function Yet(e,t,r){return Aj(e,t,r,bke,vj(Het()),jw(e,2,-2),0)}function Qre(e,t,r,n){return Aj(e,t,r,fZ,jw(e,0,n),jw(e,n+1,-1),n)}function r8(e,t){for(var r="",n=xZ(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function Ket(e,t,r,n){switch(e.type){case Tet:if(e.children.length)break;case Pet:case fZ:return e.return=e.return||e.value;case bke:return"";case wke:return e.return=e.value+"{"+r8(e.children,n)+"}";case gZ:e.value=e.props.join(",")}return Ku(r=r8(e.children,n))?e.return=e.value+"{"+r+"}":""}function qet(e){var t=xZ(e);return function(r,n,a,l){for(var c="",d=0;d<t;d++)c+=e[d](r,n,a,l)||"";return c}}function Zet(e){return function(t){t.root||(t=t.return)&&e(t)}}var Jet=function(e,t,r){for(var n=0,a=0;n=a,a=kh(),n===38&&a===12&&(t[r]=1),!Mw(a);)ud();return Fv(e,jc)},Xet=function(e,t){var r=-1,n=44;do switch(Mw(n)){case 0:n===38&&kh()===12&&(t[r]=1),e[r]+=Jet(jc-1,t,r);break;case 2:e[r]+=NS(n);break;case 4:if(n===44){e[++r]=kh()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=vj(n)}while(n=ud());return e},ett=function(e,t){return $ke(Xet(Ake(e),t))},Wre=new WeakMap,ttt=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Wre.get(r))&&!n){Wre.set(e,!0);for(var a=[],l=ett(t,a),c=r.props,d=0,p=0;d<l.length;d++)for(var u=0;u<c.length;u++,p++)e.props[p]=a[d]?l[d].replace(/&\f/g,c[u]):c[u]+" "+l[d]}}},ott=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function kke(e,t){switch(Fet(e,t)){case 5103:return ki+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ki+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ki+e+EE+e+ol+e+e;case 6828:case 4268:return ki+e+ol+e+e;case 6165:return ki+e+ol+"flex-"+e+e;case 5187:return ki+e+Si(e,/(\w+).+(:[^]+)/,ki+"box-$1$2"+ol+"flex-$1$2")+e;case 5443:return ki+e+ol+"flex-item-"+Si(e,/flex-|-self/,"")+e;case 4675:return ki+e+ol+"flex-line-pack"+Si(e,/align-content|flex-|-self/,"")+e;case 5548:return ki+e+ol+Si(e,"shrink","negative")+e;case 5292:return ki+e+ol+Si(e,"basis","preferred-size")+e;case 6060:return ki+"box-"+Si(e,"-grow","")+ki+e+ol+Si(e,"grow","positive")+e;case 4554:return ki+Si(e,/([^-])(transform)/g,"$1"+ki+"$2")+e;case 6187:return Si(Si(Si(e,/(zoom-|grab)/,ki+"$1"),/(image-set)/,ki+"$1"),e,"")+e;case 5495:case 3959:return Si(e,/(image-set\([^]*)/,ki+"$1$`$1");case 4968:return Si(Si(e,/(.+:)(flex-)?(.*)/,ki+"box-pack:$3"+ol+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ki+e+e;case 4095:case 3583:case 4068:case 2532:return Si(e,/(.+)-inline(.+)/,ki+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ku(e)-1-t>6)switch(zs(e,t+1)){case 109:if(zs(e,t+4)!==45)break;case 102:return Si(e,/(.+:)(.+)-([^]+)/,"$1"+ki+"$2-$3$1"+EE+(zs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~YW(e,"stretch")?kke(Si(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zs(e,t+1)!==115)break;case 6444:switch(zs(e,Ku(e)-3-(~YW(e,"!important")&&10))){case 107:return Si(e,":",":"+ki)+e;case 101:return Si(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ki+(zs(e,14)===45?"inline-":"")+"box$3$1"+ki+"$2$3$1"+ol+"$2box$3")+e}break;case 5936:switch(zs(e,t+11)){case 114:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ki+e+ol+e+e}return e}var rtt=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case fZ:e.return=kke(e.value,e.length);break;case wke:return r8([bx(e,{value:Si(e.value,"@","@"+ki)})],n);case gZ:if(e.length)return Net(e.props,function(a){switch(Oet(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return r8([bx(e,{props:[Si(a,/:(read-\w+)/,":"+EE+"$1")]})],n);case"::placeholder":return r8([bx(e,{props:[Si(a,/:(plac\w+)/,":"+ki+"input-$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,":"+EE+"$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,ol+"input-$1")]})],n)}return""})}},itt=[rtt],Ske=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var b=y.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var n=e.stylisPlugins||itt,a={},l,c=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var b=y.getAttribute("data-emotion").split(" "),w=1;w<b.length;w++)a[b[w]]=!0;c.push(y)});var d,p=[ttt,ott];{var u,h=[Ket,Zet(function(y){u.insert(y)})],m=qet(p.concat(n,h)),f=function(y){return r8(Get(y),m)};d=function(y,b,w,v){u=w,f(y?y+"{"+b.styles+"}":b.styles),v&&(x.inserted[b.name]=!0)}}var x={key:t,sheet:new Det({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:d};return x.sheet.hydrate(c),x};function ntt(e){return e==null||Object.keys(e).length===0}function Eke(e){const{styles:t,defaultTheme:r={}}=e,n=typeof t=="function"?a=>t(ntt(a)?r:a):t;return s.jsx(zv,{styles:n})}function att(e,t){return i(e,t)}function stt(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Gre=[];function rg(e){return Gre[0]=e,Eet(Gre)}var Yre={exports:{}},Ui={},Kre;function ltt(){if(Kre)return Ui;Kre=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(b){if(typeof b=="object"&&b!==null){var w=b.$$typeof;switch(w){case e:switch(b=b.type,b){case r:case a:case n:case p:case u:case f:return b;default:switch(b=b&&b.$$typeof,b){case c:case d:case m:case h:return b;case l:return b;default:return w}}case t:return w}}}return Ui.ContextConsumer=l,Ui.ContextProvider=c,Ui.Element=e,Ui.ForwardRef=d,Ui.Fragment=r,Ui.Lazy=m,Ui.Memo=h,Ui.Portal=t,Ui.Profiler=a,Ui.StrictMode=n,Ui.Suspense=p,Ui.SuspenseList=u,Ui.isContextConsumer=function(b){return y(b)===l},Ui.isContextProvider=function(b){return y(b)===c},Ui.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Ui.isForwardRef=function(b){return y(b)===d},Ui.isFragment=function(b){return y(b)===r},Ui.isLazy=function(b){return y(b)===m},Ui.isMemo=function(b){return y(b)===h},Ui.isPortal=function(b){return y(b)===t},Ui.isProfiler=function(b){return y(b)===a},Ui.isStrictMode=function(b){return y(b)===n},Ui.isSuspense=function(b){return y(b)===p},Ui.isSuspenseList=function(b){return y(b)===u},Ui.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===a||b===n||b===p||b===u||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===c||b.$$typeof===l||b.$$typeof===d||b.$$typeof===x||b.getModuleId!==void 0)},Ui.typeOf=y,Ui}var qre;function ctt(){return qre||(qre=1,Yre.exports=ltt()),Yre.exports}var Lke=ctt();function G0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ike(e){if(g.isValidElement(e)||Lke.isValidElementType(e)||!G0(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ike(e[r])}),t}function ml(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return G0(e)&&G0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||Lke.isValidElementType(t[a])?n[a]=t[a]:G0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&G0(e[a])?n[a]=ml(e[a],t[a],r):r.clone?n[a]=G0(t[a])?Ike(t[a]):t[a]:n[a]=t[a]}),n}const dtt=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function ptt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...a}=e,l=dtt(t),c=Object.keys(l);function d(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function u(f,x){const y=c.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(y!==-1&&typeof t[c[y]]=="number"?t[c[y]]:x)-n/100}${r})`}function h(f){return c.indexOf(f)+1<c.length?u(f,c[c.indexOf(f)+1]):d(f)}function m(f){const x=c.indexOf(f);return x===0?d(c[1]):x===c.length-1?p(c[x]):u(f,c[c.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:c,values:l,up:d,down:p,between:u,only:h,not:m,unit:r,...a}}function Zre(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(n.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return r.length?r.reduce((n,a)=>{const l=t[a];return delete n[a],n[a]=l,n},{...t}):t}function utt(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function htt(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,a]=r,l=Number.isNaN(+n)?n||0:+n;return e.containerQueries(a).up(l)}function mtt(e){const t=(l,c)=>l.replace("@media",c?`@container ${c}`:"@container");function r(l,c){l.up=(...d)=>t(e.breakpoints.up(...d),c),l.down=(...d)=>t(e.breakpoints.down(...d),c),l.between=(...d)=>t(e.breakpoints.between(...d),c),l.only=(...d)=>t(e.breakpoints.only(...d),c),l.not=(...d)=>{const p=t(e.breakpoints.not(...d),c);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const n={},a=l=>(r(n,l),n);return r(a),{...e,containerQueries:a}}const gtt={borderRadius:4};function Zb(e,t){return t?ml(e,t,{clone:!1}):e}const $j={xs:0,sm:600,md:900,lg:1200,xl:1536},Jre={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${$j[e]}px)`},ftt={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:$j[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function g2(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const a=n.breakpoints||Jre;return t.reduce((l,c,d)=>(l[a.up(a.keys[d])]=r(t[d]),l),{})}if(typeof t=="object"){const a=n.breakpoints||Jre;return Object.keys(t).reduce((l,c)=>{if(utt(a.keys,c)){const d=htt(n.containerQueries?n:ftt,c);d&&(l[d]=r(t[c],c))}else if(Object.keys(a.values||$j).includes(c)){const d=a.up(c);l[d]=r(t[c],c)}else{const d=c;l[d]=t[d]}return l},{})}return r(t)}function xtt(e={}){return e.keys?.reduce((t,r)=>{const n=e.up(r);return t[n]={},t},{})||{}}function Xre(e,t){return e.reduce((r,n)=>{const a=r[n];return(!a||Object.keys(a).length===0)&&delete r[n],r},t)}function mr(e){if(typeof e!="string")throw new Error(m2(7));return e.charAt(0).toUpperCase()+e.slice(1)}function kj(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(n!=null)return n}return t.split(".").reduce((n,a)=>n&&n[a]!=null?n[a]:null,e)}function LE(e,t,r,n=r){let a;return typeof e=="function"?a=e(r):Array.isArray(e)?a=e[r]||n:a=kj(e,r)||n,t&&(a=t(a,n,e)),a}function ha(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:a}=e,l=c=>{if(c[t]==null)return null;const d=c[t],p=c.theme,u=kj(p,n)||{};return g2(c,d,h=>{let m=LE(u,a,h);return h===m&&typeof h=="string"&&(m=LE(u,a,`${t}${h==="default"?"":mr(h)}`,h)),r===!1?m:{[r]:m}})};return l.propTypes={},l.filterProps=[t],l}function ytt(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const btt={m:"margin",p:"padding"},wtt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},eie={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},vtt=ytt(e=>{if(e.length>2)if(eie[e])e=eie[e];else return[e];const[t,r]=e.split(""),n=btt[t],a=wtt[r]||"";return Array.isArray(a)?a.map(l=>n+l):[n+a]}),yZ=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],bZ=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...yZ,...bZ];function Ov(e,t,r,n){const a=kj(e,t,!0)??r;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?a.startsWith("var(")&&l===0?0:a.startsWith("var(")&&l===1?a:`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const c=Math.abs(l),d=a[c];return l>=0?d:typeof d=="number"?-d:typeof d=="string"&&d.startsWith("var(")?`calc(-1 * ${d})`:`-${d}`}:typeof a=="function"?a:(()=>{})}function wZ(e){return Ov(e,"spacing",8)}function Nv(e,t){return typeof t=="string"||t==null?t:e(t)}function Ctt(e,t){return r=>e.reduce((n,a)=>(n[a]=Nv(t,r),n),{})}function Att(e,t,r,n){if(!t.includes(r))return null;const a=vtt(r),l=Ctt(a,n),c=e[r];return g2(e,c,l)}function jke(e,t){const r=wZ(e.theme);return Object.keys(e).map(n=>Att(e,t,n,r)).reduce(Zb,{})}function Hn(e){return jke(e,yZ)}Hn.propTypes={};Hn.filterProps=yZ;function _n(e){return jke(e,bZ)}_n.propTypes={};_n.filterProps=bZ;function Mke(e=8,t=wZ({spacing:e})){if(e.mui)return e;const r=(...n)=>(n.length===0?[1]:n).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return r.mui=!0,r}function Sj(...e){const t=e.reduce((n,a)=>(a.filterProps.forEach(l=>{n[l]=a}),n),{}),r=n=>Object.keys(n).reduce((a,l)=>t[l]?Zb(a,t[l](n)):a,{});return r.propTypes={},r.filterProps=e.reduce((n,a)=>n.concat(a.filterProps),[]),r}function Gd(e){return typeof e!="number"?e:`${e}px solid`}function g1(e,t){return ha({prop:e,themeKey:"borders",transform:t})}const $tt=g1("border",Gd),ktt=g1("borderTop",Gd),Stt=g1("borderRight",Gd),Ett=g1("borderBottom",Gd),Ltt=g1("borderLeft",Gd),Itt=g1("borderColor"),jtt=g1("borderTopColor"),Mtt=g1("borderRightColor"),Btt=g1("borderBottomColor"),Dtt=g1("borderLeftColor"),Ptt=g1("outline",Gd),Ttt=g1("outlineColor"),Ej=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ov(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:Nv(t,n)});return g2(e,e.borderRadius,r)}return null};Ej.propTypes={};Ej.filterProps=["borderRadius"];Sj($tt,ktt,Stt,Ett,Ltt,Itt,jtt,Mtt,Btt,Dtt,Ej,Ptt,Ttt);const Lj=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({gap:Nv(t,n)});return g2(e,e.gap,r)}return null};Lj.propTypes={};Lj.filterProps=["gap"];const Ij=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({columnGap:Nv(t,n)});return g2(e,e.columnGap,r)}return null};Ij.propTypes={};Ij.filterProps=["columnGap"];const jj=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({rowGap:Nv(t,n)});return g2(e,e.rowGap,r)}return null};jj.propTypes={};jj.filterProps=["rowGap"];const ztt=ha({prop:"gridColumn"}),Rtt=ha({prop:"gridRow"}),Ftt=ha({prop:"gridAutoFlow"}),Ott=ha({prop:"gridAutoColumns"}),Ntt=ha({prop:"gridAutoRows"}),Htt=ha({prop:"gridTemplateColumns"}),_tt=ha({prop:"gridTemplateRows"}),Vtt=ha({prop:"gridTemplateAreas"}),Utt=ha({prop:"gridArea"});Sj(Lj,Ij,jj,ztt,Rtt,Ftt,Ott,Ntt,Htt,_tt,Vtt,Utt);function i8(e,t){return t==="grey"?t:e}const Qtt=ha({prop:"color",themeKey:"palette",transform:i8}),Wtt=ha({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:i8}),Gtt=ha({prop:"backgroundColor",themeKey:"palette",transform:i8});Sj(Qtt,Wtt,Gtt);function nd(e){return e<=1&&e!==0?`${e*100}%`:e}const Ytt=ha({prop:"width",transform:nd}),vZ=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{const n=e.theme?.breakpoints?.values?.[r]||$j[r];return n?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:nd(r)}};return g2(e,e.maxWidth,t)}return null};vZ.filterProps=["maxWidth"];const Ktt=ha({prop:"minWidth",transform:nd}),qtt=ha({prop:"height",transform:nd}),Ztt=ha({prop:"maxHeight",transform:nd}),Jtt=ha({prop:"minHeight",transform:nd});ha({prop:"size",cssProperty:"width",transform:nd});ha({prop:"size",cssProperty:"height",transform:nd});const Xtt=ha({prop:"boxSizing"});Sj(Ytt,vZ,Ktt,qtt,Ztt,Jtt,Xtt);const Mj={border:{themeKey:"borders",transform:Gd},borderTop:{themeKey:"borders",transform:Gd},borderRight:{themeKey:"borders",transform:Gd},borderBottom:{themeKey:"borders",transform:Gd},borderLeft:{themeKey:"borders",transform:Gd},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Gd},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ej},color:{themeKey:"palette",transform:i8},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:i8},backgroundColor:{themeKey:"palette",transform:i8},p:{style:_n},pt:{style:_n},pr:{style:_n},pb:{style:_n},pl:{style:_n},px:{style:_n},py:{style:_n},padding:{style:_n},paddingTop:{style:_n},paddingRight:{style:_n},paddingBottom:{style:_n},paddingLeft:{style:_n},paddingX:{style:_n},paddingY:{style:_n},paddingInline:{style:_n},paddingInlineStart:{style:_n},paddingInlineEnd:{style:_n},paddingBlock:{style:_n},paddingBlockStart:{style:_n},paddingBlockEnd:{style:_n},m:{style:Hn},mt:{style:Hn},mr:{style:Hn},mb:{style:Hn},ml:{style:Hn},mx:{style:Hn},my:{style:Hn},margin:{style:Hn},marginTop:{style:Hn},marginRight:{style:Hn},marginBottom:{style:Hn},marginLeft:{style:Hn},marginX:{style:Hn},marginY:{style:Hn},marginInline:{style:Hn},marginInlineStart:{style:Hn},marginInlineEnd:{style:Hn},marginBlock:{style:Hn},marginBlockStart:{style:Hn},marginBlockEnd:{style:Hn},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Lj},rowGap:{style:jj},columnGap:{style:Ij},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:nd},maxWidth:{style:vZ},minWidth:{transform:nd},height:{transform:nd},maxHeight:{transform:nd},minHeight:{transform:nd},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function eot(...e){const t=e.reduce((n,a)=>n.concat(Object.keys(a)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function tot(e,t){return typeof e=="function"?e(t):e}function oot(){function e(r,n,a,l){const c={[r]:n,theme:a},d=l[r];if(!d)return{[r]:n};const{cssProperty:p=r,themeKey:u,transform:h,style:m}=d;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};const f=kj(a,u)||{};return m?m(c):g2(c,n,x=>{let y=LE(f,h,x);return x===y&&typeof x=="string"&&(y=LE(f,h,`${r}${x==="default"?"":mr(x)}`,x)),p===!1?y:{[p]:y}})}function t(r){const{sx:n,theme:a={},nested:l}=r||{};if(!n)return null;const c=a.unstable_sxConfig??Mj;function d(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=xtt(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=tot(u[x],a);if(y!=null)if(typeof y=="object")if(c[x])f=Zb(f,e(x,y,a,c));else{const b=g2({theme:a},y,w=>({[x]:w}));eot(b,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=Zb(f,b)}else f=Zb(f,e(x,y,a,c))}),!l&&a.modularCssLayers?{"@layer sx":Zre(a,Xre(m,f))}:Zre(a,Xre(m,f))}return Array.isArray(n)?n.map(d):d(n)}return t}const P4=oot();P4.filterProps=["sx"];function rot(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||typeof r.getColorSchemeSelector!="function")return{};let n=r.getColorSchemeSelector(e);return n==="&"?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}function CZ(e={},...t){const{breakpoints:r={},palette:n={},spacing:a,shape:l={},...c}=e,d=ptt(r),p=Mke(a);let u=ml({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:p,shape:{...gtt,...l}},c);return u=mtt(u),u.applyStyles=rot,u=t.reduce((h,m)=>ml(h,m),u),u.unstable_sxConfig={...Mj,...c?.unstable_sxConfig},u.unstable_sx=function(h){return P4({sx:h,theme:this})},u}function iot(e){return Object.keys(e).length===0}function AZ(e=null){const t=g.useContext(mke);return!t||iot(t)?e:t}const not=CZ();function Bke(e=not){return AZ(e)}function tie(e){const t=rg(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Dke({styles:e,themeId:t,defaultTheme:r={}}){const n=Bke(r),a=t&&n[t]||n;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(c=>tie(typeof c=="function"?c(a):c)):l=tie(l)),s.jsx(Eke,{styles:l})}const oie=e=>e,aot=()=>{let e=oie;return{configure(t){e=t},generate(t){return e(t)},reset(){e=oie}}},sot=aot();function Pke(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Pke(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ko(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Pke(e))&&(n&&(n+=" "),n+=t);return n}const lot={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function vi(e,t,r="Mui"){const n=lot[t];return n?`${r}-${n}`:`${sot.generate(e)}-${t}`}function ci(e,t,r="Mui"){const n={};return t.forEach(a=>{n[a]=vi(e,a,r)}),n}function Tke(e){const{variants:t,...r}=e,n={variants:t,style:rg(r),isProcessed:!0};return n.style===r||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=rg(a.style))}),n}const cot=CZ();function wT(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function i4(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function dot(e){return e?(t,r)=>r[e]:null}function pot(e,t,r){e.theme=mot(e.theme)?r:e.theme[t]||e.theme}function _S(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(a=>_S(e,a,r));if(Array.isArray(n?.variants)){let a;if(n.isProcessed)a=r?i4(n.style,r):n.style;else{const{variants:l,...c}=n;a=r?i4(rg(c),r):c}return zke(e,n.variants,[a],r)}return n?.isProcessed?r?i4(rg(n.style),r):n.style:r?i4(rg(n),r):n}function zke(e,t,r=[],n=void 0){let a;e:for(let l=0;l<t.length;l+=1){const c=t[l];if(typeof c.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!c.props(a))continue}else for(const d in c.props)if(e[d]!==c.props[d]&&e.ownerState?.[d]!==c.props[d])continue e;typeof c.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?i4(rg(c.style(a)),n):c.style(a))):r.push(n?i4(rg(c.style),n):c.style)}return r}function uot(e={}){const{themeId:t,defaultTheme:r=cot,rootShouldForwardProp:n=wT,slotShouldForwardProp:a=wT}=e;function l(c){pot(c,t,r)}return(c,d={})=>{stt(c,I=>I.filter(L=>L!==P4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=dot(fot(u)),...x}=d,y=p&&p.startsWith("Mui")||u?"components":"custom",b=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,w=m||!1;let v=wT;u==="Root"||u==="root"?v=n:u?v=a:got(c)&&(v=void 0);const A=att(c,{shouldForwardProp:v,label:hot(),...x}),S=I=>{if(I.__emotion_real===I)return I;if(typeof I=="function")return function(L){return _S(L,I,L.theme.modularCssLayers?y:void 0)};if(G0(I)){const L=Tke(I);return function(B){return L.variants?_S(B,L,B.theme.modularCssLayers?y:void 0):B.theme.modularCssLayers?i4(L.style,y):L.style}}return I},E=(...I)=>{const L=[],B=I.map(S),D=[];if(L.push(l),p&&f&&D.push(function(R){const N=R.theme.components?.[p]?.styleOverrides;if(!N)return null;const K={};for(const q in N)K[q]=_S(R,N[q],R.theme.modularCssLayers?"theme":void 0);return f(R,K)}),p&&!b&&D.push(function(R){const N=R.theme?.components?.[p]?.variants;return N?zke(R,N,[],R.theme.modularCssLayers?"theme":void 0):null}),w||D.push(P4),Array.isArray(B[0])){const R=B.shift(),N=new Array(L.length).fill(""),K=new Array(D.length).fill("");let q;q=[...N,...R,...K],q.raw=[...N,...R.raw,...K],L.unshift(q)}const P=[...L,...B,...D],T=A(...P);return c.muiName&&(T.muiName=c.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function hot(e,t){return void 0}function mot(e){for(const t in e)return!1;return!0}function got(e){return typeof e=="string"&&e.charCodeAt(0)>96}function fot(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function qW(e,t,r=!1){const n={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")n[l]={...e[l],...n[l]};else if(l==="componentsProps"||l==="slotProps"){const c=e[l],d=t[l];if(!d)n[l]=c||{};else if(!c)n[l]=d;else{n[l]={...d};for(const p in c)if(Object.prototype.hasOwnProperty.call(c,p)){const u=p;n[l][u]=qW(c[u],d[u],r)}}}else l==="className"&&r&&t.className?n.className=Ko(e?.className,t?.className):l==="style"&&r&&t.style?n.style={...e?.style,...t?.style}:n[l]===void 0&&(n[l]=e[l])}return n}const xd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function xot(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function $Z(e,t=0,r=1){return xot(e,t,r)}function yot(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,a)=>a<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function mg(e){if(e.type)return e;if(e.charAt(0)==="#")return mg(yot(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(m2(9,e));let n=e.substring(t+1,e.length-1),a;if(r==="color"){if(n=n.split(" "),a=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(m2(10,a))}else n=n.split(",");return n=n.map(l=>parseFloat(l)),{type:r,values:n,colorSpace:a}}const bot=e=>{const t=mg(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},mb=(e,t)=>{try{return bot(e)}catch{return e}};function Bj(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function Rke(e){e=mg(e);const{values:t}=e,r=t[0],n=t[1]/100,a=t[2]/100,l=n*Math.min(a,1-a),c=(u,h=(u+r/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let d="rgb";const p=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(d+="a",p.push(t[3])),Bj({type:d,values:p})}function ZW(e){e=mg(e);let t=e.type==="hsl"||e.type==="hsla"?mg(Rke(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function wot(e,t){const r=ZW(e),n=ZW(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function IE(e,t){return e=mg(e),t=$Z(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Bj(e)}function N3(e,t,r){try{return IE(e,t)}catch{return e}}function Dj(e,t){if(e=mg(e),t=$Z(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Bj(e)}function Di(e,t,r){try{return Dj(e,t)}catch{return e}}function Pj(e,t){if(e=mg(e),t=$Z(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Bj(e)}function Pi(e,t,r){try{return Pj(e,t)}catch{return e}}function vot(e,t=.15){return ZW(e)>.5?Dj(e,t):Pj(e,t)}function vA(e,t,r){try{return vot(e,t)}catch{return e}}const Fke=g.createContext(null);function kZ(){return g.useContext(Fke)}const Cot=typeof Symbol=="function"&&Symbol.for,Aot=Cot?Symbol.for("mui.nested"):"__THEME_NESTED__";function $ot(e,t){return typeof t=="function"?t(e):{...e,...t}}function kot(e){const{children:t,theme:r}=e,n=kZ(),a=g.useMemo(()=>{const l=n===null?{...r}:$ot(n,r);return l!=null&&(l[Aot]=n!==null),l},[r,n]);return s.jsx(Fke.Provider,{value:a,children:t})}const Oke=g.createContext();function Sot({value:e,...t}){return s.jsx(Oke.Provider,{value:e??!0,...t})}const C9=()=>g.useContext(Oke)??!1,Nke=g.createContext(void 0);function Eot({value:e,children:t}){return s.jsx(Nke.Provider,{value:e,children:t})}function Lot(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const a=t.components[r];return a.defaultProps?qW(a.defaultProps,n,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?qW(a,n,t.components.mergeClassNameAndStyle):n}function Iot({props:e,name:t}){const r=g.useContext(Nke);return Lot({props:e,name:t,theme:{components:r}})}let rie=0;function jot(e){const[t,r]=g.useState(e),n=e||t;return g.useEffect(()=>{t==null&&(rie+=1,r(`mui-${rie}`))},[t]),n}const Mot={...tJe},iie=Mot.useId;function Tj(e){if(iie!==void 0){const t=iie();return e??t}return jot(e)}function Bot(e){const t=AZ(),r=Tj()||"",{modularCssLayers:n}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!n||t!==null?a="":typeof n=="string"?a=n.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,xd(()=>{const l=document.querySelector("head");if(!l)return;const c=l.firstChild;if(a){if(c&&c.hasAttribute?.("data-mui-layer-order")&&c.getAttribute("data-mui-layer-order")===r)return;const d=document.createElement("style");d.setAttribute("data-mui-layer-order",r),d.textContent=a,l.prepend(d)}else l.querySelector(`style[data-mui-layer-order="${r}"]`)?.remove()},[a,r]),a?s.jsx(Dke,{styles:a}):null}const nie={};function aie(e,t,r,n=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof r=="function"){const l=r(a),c=e?{...t,[e]:l}:l;return n?()=>c:c}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,n])}function Hke(e){const{children:t,theme:r,themeId:n}=e,a=AZ(nie),l=kZ()||nie,c=aie(n,a,r),d=aie(n,l,r,!0),p=(n?c[n]:c).direction==="rtl",u=Bot(c);return s.jsx(kot,{theme:d,children:s.jsx(mke.Provider,{value:c,children:s.jsx(Sot,{value:p,children:s.jsxs(Eot,{value:n?c[n].components:c.components,children:[u,t]})})})})}const sie={theme:void 0};function Dot(e){let t,r;return function(n){let a=t;return(a===void 0||n.theme!==r)&&(sie.theme=n.theme,a=Tke(e(sie)),t=a,r=n.theme),a}}const SZ="mode",EZ="color-scheme",Pot="data-color-scheme";function Tot(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:a=SZ,colorSchemeStorageKey:l=EZ,attribute:c=Pot,colorSchemeNode:d="document.documentElement",nonce:p}=e||{};let u="",h=c;if(c==="class"&&(h=".%s"),c==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${d}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-Bnn0zo5b.js","assets/sentry-CrFvlFGm.js","assets/empty-CdLmUDrM.js","assets/index-DlGmElBC.js","assets/index-fXjCjw6w.js","assets/zeni-epic-state-CusYXz9D.js","assets/core-kDzcwErP.js","assets/utils-ueB_tslp.js","assets/recharts-BEzCLGEF.js","assets/url-BwZimkA1.js","assets/index-Cy6_UeJ6.js","assets/index-DP1J6R69.js","assets/url-DtZG2OD7.js","assets/index-DzHZDGWq.js","assets/ScreenRoutes-CE-2Tj1d.js","assets/liveblocks-DySvlCFz.js","assets/analyticsHelper-CibxtJqd.js","assets/mui-DaMtXmvv.js","assets/SignInScreen-BSc5qqTv.js","assets/analytics-qjKu72CP.js","assets/lottie-BeYaqM3r.js","assets/lexical-BSGlB8Tt.js"])))=>i.map(i=>d[i]);
2
+ import{a as g,R as $,e as tJe,b as D4,p as R0,r as Tc,g as eZ,d as vre,f as oJe,s as Cre,w as rJe,i as iJe,S as nJe,j as aJe,k as sJe,l as lJe,m as cJe}from"./sentry-CrFvlFGm.js";import{j as Co,_ as B$e,a as Cd,u as D$e,T as dJe,C as pJe,b as uJe,c as uj,d as hj,e as hJe,f as mJe,g as P$e,h as gJe,i as fJe,L as xJe,k as Are,l as yJe,m as bJe,n as wJe,P as vJe,o as CJe,p as AJe,q as T$e,r as $Je,s as kJe,I as $re,t as SJe,v as EJe,w as LJe,x as IJe,y as jJe,z as MJe,A as z$e,B as BJe,D as DJe,E as PJe}from"./liveblocks-DySvlCFz.js";import{f as R$e,R as o4,r as Fn,P as Pn,u as mj,g as yh,h as TJe,i as tZ,j as zJe,k as RJe,l as mT,N as FJe,m as OJe,n as NJe,B as HJe}from"./core-kDzcwErP.js";import{H as CE,ba as r4,bb as _Je,bc as kre,bd as X4,be as xr,bf as F$e,bg as Wr,bh as gj,bi as VJe,bj as Ph,bk as UJe,bl as QJe,bm as S8,bn as hg,bo as b9,bp as O$e,bq as WJe,br as Z1,bs as N$e,bt as GJe,bu as oZ,bv as H$e,bw as ln,bx as E8,by as Gu,bz as Sre,bA as YJe,bB as KJe,bC as _$e,bD as NW,bE as qJe,bF as ZJe,bG as JJe,bH as XJe,bI as rZ,bJ as V$e,bK as eXe,bL as qb,bM as tXe,bN as U$e,bO as HW,bP as Ere,bQ as Lre,bR as Ire,bS as zl,bT as iZ,bU as Q$e,bV as W$e,bW as nZ,bX as w9,bY as fj,bZ as aZ,b_ as sZ,b$ as lZ,c0 as cZ,c1 as oXe,c2 as xj,c3 as lp,c4 as cp,c5 as AE,c6 as G$e,c7 as Y$e,c8 as rXe,c9 as dZ,ca as pZ,cb as iXe,cc as nXe,cd as tp,ce as Pv,cf as Tv,cg as aXe,ch as sXe,ci as lXe,cj as cXe,ck as dXe,cl as pXe,cm as uXe,cn as yA,co as K$e,cp as q$e,cq as hXe,cr as mXe,cs as Z$e,ct as J$e,cu as gXe,cv as fXe,cw as xXe,cx as X$e,cy as eke,cz as yXe,cA as bXe,cB as tke,cC as oke,cD as wXe,cE as jre,cF as vXe,cG as CXe,cH as Iw,cI as AXe,cJ as rke,cK as $Xe,cL as ike,cM as kXe,cN as Mre,cO as SXe,cP as nke,cQ as ake,cR as ske,cS as lke,cT as cke,cU as EXe,cV as dke,cW as LXe,cX as IXe,cY as jXe,cZ as pke,c_ as _W,c$ as MXe,d0 as uke,d1 as hke,d2 as BXe,d3 as DXe,d4 as PXe,d5 as TXe,d6 as zXe,d7 as RXe,d8 as FXe,d9 as OXe,v as NXe,da as yj,db as VW,dc as UW,dd as HXe,de as _Xe,df as VXe,dg as UXe,dh as QXe,di as WXe,dj as GXe,dk as YXe,dl as KXe,dm as qXe,dn as Bre,dp as ZXe,dq as JXe,dr as XXe,ds as eet,dt as tet}from"./zeni-epic-state-CusYXz9D.js";import{T as mke,j as Qo,n as i,c as pe,k as _t,G as zv,C as gke,u as oet,a as ret}from"./mui-DaMtXmvv.js";import{r as iet,m as Yu}from"./analytics-qjKu72CP.js";import{L as QW}from"./lottie-BeYaqM3r.js";import{r as Ta}from"./lexical-BSGlB8Tt.js";import{E as en,c as bj,P as net,R as WW,F as $E,X as gd,Y as fd,G as k2,H as kE,I as wj,J as S2,K as fke,L as aet,M as set,N as e5,O as uZ,Q as hZ,S as Rv,U as cet}from"./recharts-BEzCLGEF.js";import{r as det}from"./utils-ueB_tslp.js";(function(){try{var e=typeof window<"u"?window:typeof D4<"u"?D4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="40de4d38-e205-480f-97a6-85f6d64391d8",e._sentryDebugIdIdentifier="sentry-dbid-40de4d38-e205-480f-97a6-85f6d64391d8")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}})();var bA={},Dre;function pet(){if(Dre)return bA;Dre=1;var e=R$e();return bA.createRoot=e.createRoot,bA.hydrateRoot=e.hydrateRoot,bA}var uet=pet(),wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof D4<"u"?D4:typeof self<"u"?self:{};function Vr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pre={exports:{}},yx={},Tre;function het(){if(Tre)return yx;Tre=1;var e=$,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(d,p,u){var h,m={},f=null,x=null;u!==void 0&&(f=""+u),p.key!==void 0&&(f=""+p.key),p.ref!==void 0&&(x=p.ref);for(h in p)n.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(d&&d.defaultProps)for(h in p=d.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:d,key:f,ref:x,props:m,_owner:a.current}}return yx.Fragment=r,yx.jsx=c,yx.jsxs=c,yx}var zre;function xke(){return zre||(zre=1,Pre.exports=het()),Pre.exports}var s=xke();const met=g.createContext(null),gT={didCatch:!1,error:null};let get=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gT}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:a,reason:"imperative-api"}),this.setState(gT)}}componentDidCatch(e,t){var r,n;(r=(n=this.props).onError)===null||r===void 0||r.call(n,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&t.error!==null&&fet(e.resetKeys,n)){var a,l;(a=(l=this.props).onReset)===null||a===void 0||a.call(l,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(gT)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:a,error:l}=this.state;let c=e;if(a){const d={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")c=t(d);else if(r)c=g.createElement(r,d);else if(n!==void 0)c=n;else throw l}return g.createElement(met.Provider,{value:{didCatch:a,error:l,resetErrorBoundary:this.resetErrorBoundary}},c)}};function fet(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}var GW={exports:{}},xet=GW.exports,Rre;function yet(){return Rre||(Rre=1,(function(e){(function(t,r){e.exports?e.exports=r():t.numeral=r()})(xet,function(){var t,r,n="2.0.6",a={},l={},c={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},d={currentLocale:c.currentLocale,zeroFormat:c.zeroFormat,nullFormat:c.nullFormat,defaultFormat:c.defaultFormat,scalePercentBy100:c.scalePercentBy100};function p(u,h){this._input=u,this._value=h}return t=function(u){var h,m,f,x;if(t.isNumeral(u))h=u.value();else if(u===0||typeof u>"u")h=0;else if(u===null||r.isNaN(u))h=null;else if(typeof u=="string")if(d.zeroFormat&&u===d.zeroFormat)h=0;else if(d.nullFormat&&u===d.nullFormat||!u.replace(/[^0-9]+/g,"").length)h=null;else{for(m in a)if(x=typeof a[m].regexps.unformat=="function"?a[m].regexps.unformat():a[m].regexps.unformat,x&&u.match(x)){f=a[m].unformat;break}f=f||t._.stringToNumber,h=f(u)}else h=Number(u)||null;return new p(u,h)},t.version=n,t.isNumeral=function(u){return u instanceof p},t._=r={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,b=0,w="",v=1e12,A=1e9,S=1e6,E=1e3,I="",L=!1,B,D,P,T,R,N,K;if(u=u||0,D=Math.abs(u),t._.includes(h,"(")?(x=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(R=t._.includes(h,"+")?h.indexOf("+"):u<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(B=h.match(/a(k|m|b|t)?/),B=B?B[1]:!1,t._.includes(h," a")&&(w=" "),h=h.replace(new RegExp(w+"a[kmbt]?"),""),D>=v&&!B||B==="t"?(w+=f.abbreviations.trillion,u=u/v):D<v&&D>=A&&!B||B==="b"?(w+=f.abbreviations.billion,u=u/A):D<A&&D>=S&&!B||B==="m"?(w+=f.abbreviations.million,u=u/S):(D<S&&D>=E&&!B||B==="k")&&(w+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),P=u.toString().split(".")[0],T=h.split(".")[1],N=h.indexOf(","),b=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,T?(t._.includes(T,"[")?(T=T.replace("]",""),T=T.split("["),I=t._.toFixed(u,T[0].length+T[1].length,m,T[1].length)):I=t._.toFixed(u,T.length,m),P=I.split(".")[0],t._.includes(I,".")?I=f.delimiters.decimal+I.split(".")[1]:I="",y&&Number(I.slice(1))===0&&(I="")):P=t._.toFixed(u,0,m),w&&!B&&Number(P)>=1e3&&w!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),w){case f.abbreviations.thousand:w=f.abbreviations.million;break;case f.abbreviations.million:w=f.abbreviations.billion;break;case f.abbreviations.billion:w=f.abbreviations.trillion;break}if(t._.includes(P,"-")&&(P=P.slice(1),L=!0),P.length<b)for(var q=b-P.length;q>0;q--)P="0"+P;return N>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(P=""),K=P+I+(w||""),x?K=(x&&L?"(":"")+K+(x&&L?")":""):R>=0?K=R===0?(L?"-":"+")+K:K+(L?"-":"+"):L&&(K="-"+K),K},stringToNumber:function(u){var h=l[d.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,b;if(d.zeroFormat&&u===d.zeroFormat)y=0;else if(d.nullFormat&&u===d.nullFormat||!u.replace(/[^0-9]+/g,"").length)y=null;else{y=1,h.delimiters.decimal!=="."&&(u=u.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(x in f)if(b=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(b)){y*=Math.pow(10,f[x]);break}y*=(u.split("-").length+Math.min(u.split("(").length-1,u.split(")").length-1))%2?1:-1,u=u.replace(/[^0-9\.]+/g,""),y*=Number(u)}return y},isNaN:function(u){return typeof u=="number"&&isNaN(u)},includes:function(u,h){return u.indexOf(h)!==-1},insert:function(u,h,m){return u.slice(0,m)+h+u.slice(m)},reduce:function(u,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var m=Object(u),f=m.length>>>0,x=0,y;if(arguments.length===3)y=arguments[2];else{for(;x<f&&!(x in m);)x++;if(x>=f)throw new TypeError("Reduce of empty array with no initial value");y=m[x++]}for(;x<f;x++)x in m&&(y=h(y,m[x],x,m));return y},multiplier:function(u){var h=u.toString().split(".");return h.length<2?1:Math.pow(10,h[1].length)},correctionFactor:function(){var u=Array.prototype.slice.call(arguments);return u.reduce(function(h,m){var f=r.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),b,w,v,A;return x.length===2?b=Math.min(Math.max(x[1].length,y),h):b=y,v=Math.pow(10,b),A=(m(u+"e+"+b)/v).toFixed(b),f>h-b&&(w=new RegExp("\\.?0{1,"+(f-(h-b))+"}$"),A=A.replace(w,"")),A}},t.options=d,t.formats=a,t.locales=l,t.locale=function(u){return u&&(d.currentLocale=u.toLowerCase()),d.currentLocale},t.localeData=function(u){if(!u)return l[d.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in c)d[u]=c[u]},t.zeroFormat=function(u){d.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){d.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){d.defaultFormat=typeof u=="string"?u:"0.0"},t.register=function(u,h,m){if(h=h.toLowerCase(),this[u+"s"][h])throw new TypeError(h+" "+u+" already registered.");return this[u+"s"][h]=m,m},t.validate=function(u,h){var m,f,x,y,b,w,v,A;if(typeof u!="string"&&(u+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",u)),u=u.trim(),u.match(/^\d+$/))return!0;if(u==="")return!1;try{v=t.localeData(h)}catch{v=t.localeData(t.locale())}return x=v.currency.symbol,b=v.abbreviations,m=v.delimiters.decimal,v.delimiters.thousands==="."?f="\\.":f=v.delimiters.thousands,A=u.match(/^[^\d]+/),A!==null&&(u=u.substr(1),A[0]!==x)||(A=u.match(/[^\d]+$/),A!==null&&(u=u.slice(0,-1),A[0]!==b.thousand&&A[0]!==b.million&&A[0]!==b.billion&&A[0]!==b.trillion))?!1:(w=new RegExp(f+"{2}"),u.match(/[^\d.,]/g)?!1:(y=u.split(m),y.length>2?!1:y.length<2?!!y[0].match(/^\d+.*\d$/)&&!y[0].match(w):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||d.defaultFormat,x,y,b;if(h=h||Math.round,m===0&&d.zeroFormat!==null)y=d.zeroFormat;else if(m===null&&d.nullFormat!==null)y=d.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){b=a[x].format;break}b=b||t._.numberToFormat,y=b(m,f,h)}return y},value:function(){return this._value},input:function(){return this._input},set:function(u){return this._value=Number(u),this},add:function(u){var h=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f+Math.round(h*x)}return this._value=r.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f-Math.round(h*x)}return this._value=r.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)*Math.round(f*b)/Math.round(b*b)}return this._value=r.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)/Math.round(f*b)}return this._value=r.reduce([this._value,u],h),this},difference:function(u){return Math.abs(t(this._value).subtract(u).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(u){var h=u%10;return~~(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),(function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(u,h,m){var f=t._.includes(h," BPS")?" ":"",x;return u=u*1e4,h=h.replace(/\s?BPS/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"BPS"),x=x.join("")):x=x+f+"BPS",x},unformat:function(u){return+(t._.stringToNumber(u)*1e-4).toFixed(15)}})})(),(function(){var u={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},m=u.suffixes.concat(h.suffixes.filter(function(x){return u.suffixes.indexOf(x)<0})),f=m.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(x,y,b){var w,v=t._.includes(y,"ib")?h:u,A=t._.includes(y," b")||t._.includes(y," ib")?" ":"",S,E,I;for(y=y.replace(/\s?i?b/,""),S=0;S<=v.suffixes.length;S++)if(E=Math.pow(v.base,S),I=Math.pow(v.base,S+1),x===null||x===0||x>=E&&x<I){A+=v.suffixes[S],E>0&&(x=x/E);break}return w=t._.numberToFormat(x,y,b),w+A},unformat:function(x){var y=t._.stringToNumber(x),b,w;if(y){for(b=u.suffixes.length-1;b>=0;b--){if(t._.includes(x,u.suffixes[b])){w=Math.pow(u.base,b);break}if(t._.includes(x,h.suffixes[b])){w=Math.pow(h.base,b);break}}y*=w||1}return y}})})(),(function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},y,b,w;for(h=h.replace(/\s?\$\s?/,""),y=t._.numberToFormat(u,h,m),u>=0?(x.before=x.before.replace(/[\-\(]/,""),x.after=x.after.replace(/[\-\)]/,"")):u<0&&!t._.includes(x.before,"-")&&!t._.includes(x.before,"(")&&(x.before="-"+x.before),w=0;w<x.before.length;w++)switch(b=x.before[w],b){case"$":y=t._.insert(y,f.currency.symbol,w);break;case" ":y=t._.insert(y," ",w+f.currency.symbol.length-1);break}for(w=x.after.length-1;w>=0;w--)switch(b=x.after[w],b){case"$":y=w===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+w)));break;case" ":y=w===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+w)+f.currency.symbol.length-1));break}return y}})})(),(function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(u,h,m){var f,x=typeof u=="number"&&!t._.isNaN(u)?u.toExponential():"0e+0",y=x.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(y[0]),h,m),f+"e"+y[1]},unformat:function(u){var h=t._.includes(u,"e+")?u.split("e+"):u.split("e-"),m=Number(h[0]),f=Number(h[1]);f=t._.includes(u,"e-")?f*=-1:f;function x(y,b,w,v){var A=t._.correctionFactor(y,b),S=y*A*(b*A)/(A*A);return S}return t._.reduce([m,Math.pow(10,f)],x,1)}})})(),(function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x,y=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),y+=f.ordinal(u),x=t._.numberToFormat(u,h,m),x+y}})})(),(function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(u,h,m){var f=t._.includes(h," %")?" ":"",x;return t.options.scalePercentBy100&&(u=u*100),h=h.replace(/\s?\%/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"%"),x=x.join("")):x=x+f+"%",x},unformat:function(u){var h=t._.stringToNumber(u);return t.options.scalePercentBy100?h*.01:h}})})(),(function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(u,h,m){var f=Math.floor(u/60/60),x=Math.floor((u-f*60*60)/60),y=Math.round(u-f*60*60-x*60);return f+":"+(x<10?"0"+x:x)+":"+(y<10?"0"+y:y)},unformat:function(u){var h=u.split(":"),m=0;return h.length===3?(m=m+Number(h[0])*60*60,m=m+Number(h[1])*60,m=m+Number(h[2])):h.length===2&&(m=m+Number(h[0])*60,m=m+Number(h[1])),Number(m)}})})(),t})})(GW)),GW.exports}var bet=yet();const ap=Vr(bet);function m2(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const c2="$$material";function wet(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var vet={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Cet(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Aet=/[A-Z]|^ms/g,$et=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yke=function(e){return e.charCodeAt(1)===45},Fre=function(e){return e!=null&&typeof e!="boolean"},fT=Cet(function(e){return yke(e)?e:e.replace(Aet,"-$&").toLowerCase()}),Ore=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace($et,function(r,n,a){return Um={name:n,styles:a,next:Um},n})}return vet[e]!==1&&!yke(e)&&typeof t=="number"&&t!==0?t+"px":t};function SE(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return Um={name:a.name,styles:a.styles,next:Um},a.name;var l=r;if(l.styles!==void 0){var c=l.next;if(c!==void 0)for(;c!==void 0;)Um={name:c.name,styles:c.styles,next:Um},c=c.next;var d=l.styles+";";return d}return ket(e,t,r)}}var p=r;return p}function ket(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=SE(e,t,r[a])+";";else for(var l in r){var c=r[l];if(typeof c!="object"){var d=c;Fre(d)&&(n+=fT(l)+":"+Ore(l,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var p=0;p<c.length;p++)Fre(c[p])&&(n+=fT(l)+":"+Ore(l,c[p])+";");else{var u=SE(e,t,c);switch(l){case"animation":case"animationName":{n+=fT(l)+":"+u+";";break}default:n+=l+"{"+u+"}"}}}return n}var Nre=/label:\s*([^\s;{]+)\s*(;|$)/g,Um;function Eet(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";Um=void 0;var l=e[0];if(l==null||l.raw===void 0)n=!1,a+=SE(r,t,l);else{var c=l;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=SE(r,t,e[d]),n){var p=l;a+=p[d]}Nre.lastIndex=0;for(var u="",h;(h=Nre.exec(a))!==null;)u+="-"+h[1];var m=wet(a)+u;return{name:m,styles:a,next:Um}}var xT={exports:{}},yT,Hre;function Let(){if(Hre)return yT;Hre=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yT=e,yT}var bT,_re;function Iet(){if(_re)return bT;_re=1;var e=Let();function t(){}function r(){}return r.resetWarningCache=t,bT=function(){function n(c,d,p,u,h,m){if(m!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function a(){return n}var l={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return l.PropTypes=l,l},bT}var Vre;function mZ(){return Vre||(Vre=1,xT.exports=Iet()()),xT.exports}var jet=mZ();const Nt=Vr(jet);function Met(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Bet(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Det=(function(){function e(r){var n=this;this._insertTag=function(a){var l;n.tags.length===0?n.insertionPoint?l=n.insertionPoint.nextSibling:n.prepend?l=n.container.firstChild:l=n.before:l=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,l),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Bet(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Met(n);try{a.insertRule(r,a.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e})(),ol="-ms-",EE="-moz-",ki="-webkit-",bke="comm",gZ="rule",fZ="decl",Pet="@import",wke="@keyframes",Tet="@layer",zet=Math.abs,vj=String.fromCharCode,Ret=Object.assign;function Fet(e,t){return zs(e,0)^45?(((t<<2^zs(e,0))<<2^zs(e,1))<<2^zs(e,2))<<2^zs(e,3):0}function vke(e){return e.trim()}function Oet(e,t){return(e=t.exec(e))?e[0]:e}function Si(e,t,r){return e.replace(t,r)}function YW(e,t){return e.indexOf(t)}function zs(e,t){return e.charCodeAt(t)|0}function jw(e,t,r){return e.slice(t,r)}function Ku(e){return e.length}function xZ(e){return e.length}function wA(e,t){return t.push(e),e}function Net(e,t){return e.map(t).join("")}var Cj=1,L8=1,Cke=0,jc=0,Ia=0,v9="";function Aj(e,t,r,n,a,l,c){return{value:e,root:t,parent:r,type:n,props:a,children:l,line:Cj,column:L8,length:c,return:""}}function bx(e,t){return Ret(Aj("",null,null,"",null,null,0),e,{length:-e.length},t)}function Het(){return Ia}function _et(){return Ia=jc>0?zs(v9,--jc):0,L8--,Ia===10&&(L8=1,Cj--),Ia}function ud(){return Ia=jc<Cke?zs(v9,jc++):0,L8++,Ia===10&&(L8=1,Cj++),Ia}function kh(){return zs(v9,jc)}function OS(){return jc}function Fv(e,t){return jw(v9,e,t)}function Mw(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ake(e){return Cj=L8=1,Cke=Ku(v9=e),jc=0,[]}function $ke(e){return v9="",e}function NS(e){return vke(Fv(jc-1,KW(e===91?e+2:e===40?e+1:e)))}function Vet(e){for(;(Ia=kh())&&Ia<33;)ud();return Mw(e)>2||Mw(Ia)>3?"":" "}function Uet(e,t){for(;--t&&ud()&&!(Ia<48||Ia>102||Ia>57&&Ia<65||Ia>70&&Ia<97););return Fv(e,OS()+(t<6&&kh()==32&&ud()==32))}function KW(e){for(;ud();)switch(Ia){case e:return jc;case 34:case 39:e!==34&&e!==39&&KW(Ia);break;case 40:e===41&&KW(e);break;case 92:ud();break}return jc}function Qet(e,t){for(;ud()&&e+Ia!==57&&!(e+Ia===84&&kh()===47););return"/*"+Fv(t,jc-1)+"*"+vj(e===47?e:ud())}function Wet(e){for(;!Mw(kh());)ud();return Fv(e,jc)}function Get(e){return $ke(HS("",null,null,null,[""],e=Ake(e),0,[0],e))}function HS(e,t,r,n,a,l,c,d,p){for(var u=0,h=0,m=c,f=0,x=0,y=0,b=1,w=1,v=1,A=0,S="",E=a,I=l,L=n,B=S;w;)switch(y=A,A=ud()){case 40:if(y!=108&&zs(B,m-1)==58){YW(B+=Si(NS(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:B+=NS(A);break;case 9:case 10:case 13:case 32:B+=Vet(y);break;case 92:B+=Uet(OS()-1,7);continue;case 47:switch(kh()){case 42:case 47:wA(Yet(Qet(ud(),OS()),t,r),p);break;default:B+="/"}break;case 123*b:d[u++]=Ku(B)*v;case 125*b:case 59:case 0:switch(A){case 0:case 125:w=0;case 59+h:v==-1&&(B=Si(B,/\f/g,"")),x>0&&Ku(B)-m&&wA(x>32?Qre(B+";",n,r,m-1):Qre(Si(B," ","")+";",n,r,m-2),p);break;case 59:B+=";";default:if(wA(L=Ure(B,t,r,u,h,a,d,S,E=[],I=[],m),l),A===123)if(h===0)HS(B,t,L,L,E,l,m,d,I);else switch(f===99&&zs(B,3)===110?100:f){case 100:case 108:case 109:case 115:HS(e,L,L,n&&wA(Ure(e,L,L,0,0,a,d,S,a,E=[],m),I),a,I,m,d,n?E:I);break;default:HS(B,L,L,L,[""],I,0,d,I)}}u=h=x=0,b=v=1,S=B="",m=c;break;case 58:m=1+Ku(B),x=y;default:if(b<1){if(A==123)--b;else if(A==125&&b++==0&&_et()==125)continue}switch(B+=vj(A),A*b){case 38:v=h>0?1:(B+="\f",-1);break;case 44:d[u++]=(Ku(B)-1)*v,v=1;break;case 64:kh()===45&&(B+=NS(ud())),f=kh(),h=m=Ku(S=B+=Wet(OS())),A++;break;case 45:y===45&&Ku(B)==2&&(b=0)}}return l}function Ure(e,t,r,n,a,l,c,d,p,u,h){for(var m=a-1,f=a===0?l:[""],x=xZ(f),y=0,b=0,w=0;y<n;++y)for(var v=0,A=jw(e,m+1,m=zet(b=c[y])),S=e;v<x;++v)(S=vke(b>0?f[v]+" "+A:Si(A,/&\f/g,f[v])))&&(p[w++]=S);return Aj(e,t,r,a===0?gZ:d,p,u,h)}function Yet(e,t,r){return Aj(e,t,r,bke,vj(Het()),jw(e,2,-2),0)}function Qre(e,t,r,n){return Aj(e,t,r,fZ,jw(e,0,n),jw(e,n+1,-1),n)}function r8(e,t){for(var r="",n=xZ(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function Ket(e,t,r,n){switch(e.type){case Tet:if(e.children.length)break;case Pet:case fZ:return e.return=e.return||e.value;case bke:return"";case wke:return e.return=e.value+"{"+r8(e.children,n)+"}";case gZ:e.value=e.props.join(",")}return Ku(r=r8(e.children,n))?e.return=e.value+"{"+r+"}":""}function qet(e){var t=xZ(e);return function(r,n,a,l){for(var c="",d=0;d<t;d++)c+=e[d](r,n,a,l)||"";return c}}function Zet(e){return function(t){t.root||(t=t.return)&&e(t)}}var Jet=function(e,t,r){for(var n=0,a=0;n=a,a=kh(),n===38&&a===12&&(t[r]=1),!Mw(a);)ud();return Fv(e,jc)},Xet=function(e,t){var r=-1,n=44;do switch(Mw(n)){case 0:n===38&&kh()===12&&(t[r]=1),e[r]+=Jet(jc-1,t,r);break;case 2:e[r]+=NS(n);break;case 4:if(n===44){e[++r]=kh()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=vj(n)}while(n=ud());return e},ett=function(e,t){return $ke(Xet(Ake(e),t))},Wre=new WeakMap,ttt=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Wre.get(r))&&!n){Wre.set(e,!0);for(var a=[],l=ett(t,a),c=r.props,d=0,p=0;d<l.length;d++)for(var u=0;u<c.length;u++,p++)e.props[p]=a[d]?l[d].replace(/&\f/g,c[u]):c[u]+" "+l[d]}}},ott=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function kke(e,t){switch(Fet(e,t)){case 5103:return ki+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ki+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ki+e+EE+e+ol+e+e;case 6828:case 4268:return ki+e+ol+e+e;case 6165:return ki+e+ol+"flex-"+e+e;case 5187:return ki+e+Si(e,/(\w+).+(:[^]+)/,ki+"box-$1$2"+ol+"flex-$1$2")+e;case 5443:return ki+e+ol+"flex-item-"+Si(e,/flex-|-self/,"")+e;case 4675:return ki+e+ol+"flex-line-pack"+Si(e,/align-content|flex-|-self/,"")+e;case 5548:return ki+e+ol+Si(e,"shrink","negative")+e;case 5292:return ki+e+ol+Si(e,"basis","preferred-size")+e;case 6060:return ki+"box-"+Si(e,"-grow","")+ki+e+ol+Si(e,"grow","positive")+e;case 4554:return ki+Si(e,/([^-])(transform)/g,"$1"+ki+"$2")+e;case 6187:return Si(Si(Si(e,/(zoom-|grab)/,ki+"$1"),/(image-set)/,ki+"$1"),e,"")+e;case 5495:case 3959:return Si(e,/(image-set\([^]*)/,ki+"$1$`$1");case 4968:return Si(Si(e,/(.+:)(flex-)?(.*)/,ki+"box-pack:$3"+ol+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ki+e+e;case 4095:case 3583:case 4068:case 2532:return Si(e,/(.+)-inline(.+)/,ki+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ku(e)-1-t>6)switch(zs(e,t+1)){case 109:if(zs(e,t+4)!==45)break;case 102:return Si(e,/(.+:)(.+)-([^]+)/,"$1"+ki+"$2-$3$1"+EE+(zs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~YW(e,"stretch")?kke(Si(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zs(e,t+1)!==115)break;case 6444:switch(zs(e,Ku(e)-3-(~YW(e,"!important")&&10))){case 107:return Si(e,":",":"+ki)+e;case 101:return Si(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ki+(zs(e,14)===45?"inline-":"")+"box$3$1"+ki+"$2$3$1"+ol+"$2box$3")+e}break;case 5936:switch(zs(e,t+11)){case 114:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ki+e+ol+e+e}return e}var rtt=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case fZ:e.return=kke(e.value,e.length);break;case wke:return r8([bx(e,{value:Si(e.value,"@","@"+ki)})],n);case gZ:if(e.length)return Net(e.props,function(a){switch(Oet(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return r8([bx(e,{props:[Si(a,/:(read-\w+)/,":"+EE+"$1")]})],n);case"::placeholder":return r8([bx(e,{props:[Si(a,/:(plac\w+)/,":"+ki+"input-$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,":"+EE+"$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,ol+"input-$1")]})],n)}return""})}},itt=[rtt],Ske=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var b=y.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var n=e.stylisPlugins||itt,a={},l,c=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var b=y.getAttribute("data-emotion").split(" "),w=1;w<b.length;w++)a[b[w]]=!0;c.push(y)});var d,p=[ttt,ott];{var u,h=[Ket,Zet(function(y){u.insert(y)})],m=qet(p.concat(n,h)),f=function(y){return r8(Get(y),m)};d=function(y,b,w,v){u=w,f(y?y+"{"+b.styles+"}":b.styles),v&&(x.inserted[b.name]=!0)}}var x={key:t,sheet:new Det({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:d};return x.sheet.hydrate(c),x};function ntt(e){return e==null||Object.keys(e).length===0}function Eke(e){const{styles:t,defaultTheme:r={}}=e,n=typeof t=="function"?a=>t(ntt(a)?r:a):t;return s.jsx(zv,{styles:n})}function att(e,t){return i(e,t)}function stt(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Gre=[];function rg(e){return Gre[0]=e,Eet(Gre)}var Yre={exports:{}},Ui={},Kre;function ltt(){if(Kre)return Ui;Kre=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(b){if(typeof b=="object"&&b!==null){var w=b.$$typeof;switch(w){case e:switch(b=b.type,b){case r:case a:case n:case p:case u:case f:return b;default:switch(b=b&&b.$$typeof,b){case c:case d:case m:case h:return b;case l:return b;default:return w}}case t:return w}}}return Ui.ContextConsumer=l,Ui.ContextProvider=c,Ui.Element=e,Ui.ForwardRef=d,Ui.Fragment=r,Ui.Lazy=m,Ui.Memo=h,Ui.Portal=t,Ui.Profiler=a,Ui.StrictMode=n,Ui.Suspense=p,Ui.SuspenseList=u,Ui.isContextConsumer=function(b){return y(b)===l},Ui.isContextProvider=function(b){return y(b)===c},Ui.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Ui.isForwardRef=function(b){return y(b)===d},Ui.isFragment=function(b){return y(b)===r},Ui.isLazy=function(b){return y(b)===m},Ui.isMemo=function(b){return y(b)===h},Ui.isPortal=function(b){return y(b)===t},Ui.isProfiler=function(b){return y(b)===a},Ui.isStrictMode=function(b){return y(b)===n},Ui.isSuspense=function(b){return y(b)===p},Ui.isSuspenseList=function(b){return y(b)===u},Ui.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===a||b===n||b===p||b===u||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===c||b.$$typeof===l||b.$$typeof===d||b.$$typeof===x||b.getModuleId!==void 0)},Ui.typeOf=y,Ui}var qre;function ctt(){return qre||(qre=1,Yre.exports=ltt()),Yre.exports}var Lke=ctt();function G0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ike(e){if(g.isValidElement(e)||Lke.isValidElementType(e)||!G0(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ike(e[r])}),t}function ml(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return G0(e)&&G0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||Lke.isValidElementType(t[a])?n[a]=t[a]:G0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&G0(e[a])?n[a]=ml(e[a],t[a],r):r.clone?n[a]=G0(t[a])?Ike(t[a]):t[a]:n[a]=t[a]}),n}const dtt=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function ptt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...a}=e,l=dtt(t),c=Object.keys(l);function d(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function u(f,x){const y=c.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(y!==-1&&typeof t[c[y]]=="number"?t[c[y]]:x)-n/100}${r})`}function h(f){return c.indexOf(f)+1<c.length?u(f,c[c.indexOf(f)+1]):d(f)}function m(f){const x=c.indexOf(f);return x===0?d(c[1]):x===c.length-1?p(c[x]):u(f,c[c.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:c,values:l,up:d,down:p,between:u,only:h,not:m,unit:r,...a}}function Zre(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(n.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return r.length?r.reduce((n,a)=>{const l=t[a];return delete n[a],n[a]=l,n},{...t}):t}function utt(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function htt(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,a]=r,l=Number.isNaN(+n)?n||0:+n;return e.containerQueries(a).up(l)}function mtt(e){const t=(l,c)=>l.replace("@media",c?`@container ${c}`:"@container");function r(l,c){l.up=(...d)=>t(e.breakpoints.up(...d),c),l.down=(...d)=>t(e.breakpoints.down(...d),c),l.between=(...d)=>t(e.breakpoints.between(...d),c),l.only=(...d)=>t(e.breakpoints.only(...d),c),l.not=(...d)=>{const p=t(e.breakpoints.not(...d),c);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const n={},a=l=>(r(n,l),n);return r(a),{...e,containerQueries:a}}const gtt={borderRadius:4};function Zb(e,t){return t?ml(e,t,{clone:!1}):e}const $j={xs:0,sm:600,md:900,lg:1200,xl:1536},Jre={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${$j[e]}px)`},ftt={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:$j[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function g2(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const a=n.breakpoints||Jre;return t.reduce((l,c,d)=>(l[a.up(a.keys[d])]=r(t[d]),l),{})}if(typeof t=="object"){const a=n.breakpoints||Jre;return Object.keys(t).reduce((l,c)=>{if(utt(a.keys,c)){const d=htt(n.containerQueries?n:ftt,c);d&&(l[d]=r(t[c],c))}else if(Object.keys(a.values||$j).includes(c)){const d=a.up(c);l[d]=r(t[c],c)}else{const d=c;l[d]=t[d]}return l},{})}return r(t)}function xtt(e={}){return e.keys?.reduce((t,r)=>{const n=e.up(r);return t[n]={},t},{})||{}}function Xre(e,t){return e.reduce((r,n)=>{const a=r[n];return(!a||Object.keys(a).length===0)&&delete r[n],r},t)}function mr(e){if(typeof e!="string")throw new Error(m2(7));return e.charAt(0).toUpperCase()+e.slice(1)}function kj(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(n!=null)return n}return t.split(".").reduce((n,a)=>n&&n[a]!=null?n[a]:null,e)}function LE(e,t,r,n=r){let a;return typeof e=="function"?a=e(r):Array.isArray(e)?a=e[r]||n:a=kj(e,r)||n,t&&(a=t(a,n,e)),a}function ha(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:a}=e,l=c=>{if(c[t]==null)return null;const d=c[t],p=c.theme,u=kj(p,n)||{};return g2(c,d,h=>{let m=LE(u,a,h);return h===m&&typeof h=="string"&&(m=LE(u,a,`${t}${h==="default"?"":mr(h)}`,h)),r===!1?m:{[r]:m}})};return l.propTypes={},l.filterProps=[t],l}function ytt(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const btt={m:"margin",p:"padding"},wtt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},eie={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},vtt=ytt(e=>{if(e.length>2)if(eie[e])e=eie[e];else return[e];const[t,r]=e.split(""),n=btt[t],a=wtt[r]||"";return Array.isArray(a)?a.map(l=>n+l):[n+a]}),yZ=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],bZ=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...yZ,...bZ];function Ov(e,t,r,n){const a=kj(e,t,!0)??r;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?a.startsWith("var(")&&l===0?0:a.startsWith("var(")&&l===1?a:`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const c=Math.abs(l),d=a[c];return l>=0?d:typeof d=="number"?-d:typeof d=="string"&&d.startsWith("var(")?`calc(-1 * ${d})`:`-${d}`}:typeof a=="function"?a:(()=>{})}function wZ(e){return Ov(e,"spacing",8)}function Nv(e,t){return typeof t=="string"||t==null?t:e(t)}function Ctt(e,t){return r=>e.reduce((n,a)=>(n[a]=Nv(t,r),n),{})}function Att(e,t,r,n){if(!t.includes(r))return null;const a=vtt(r),l=Ctt(a,n),c=e[r];return g2(e,c,l)}function jke(e,t){const r=wZ(e.theme);return Object.keys(e).map(n=>Att(e,t,n,r)).reduce(Zb,{})}function Hn(e){return jke(e,yZ)}Hn.propTypes={};Hn.filterProps=yZ;function _n(e){return jke(e,bZ)}_n.propTypes={};_n.filterProps=bZ;function Mke(e=8,t=wZ({spacing:e})){if(e.mui)return e;const r=(...n)=>(n.length===0?[1]:n).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return r.mui=!0,r}function Sj(...e){const t=e.reduce((n,a)=>(a.filterProps.forEach(l=>{n[l]=a}),n),{}),r=n=>Object.keys(n).reduce((a,l)=>t[l]?Zb(a,t[l](n)):a,{});return r.propTypes={},r.filterProps=e.reduce((n,a)=>n.concat(a.filterProps),[]),r}function Gd(e){return typeof e!="number"?e:`${e}px solid`}function g1(e,t){return ha({prop:e,themeKey:"borders",transform:t})}const $tt=g1("border",Gd),ktt=g1("borderTop",Gd),Stt=g1("borderRight",Gd),Ett=g1("borderBottom",Gd),Ltt=g1("borderLeft",Gd),Itt=g1("borderColor"),jtt=g1("borderTopColor"),Mtt=g1("borderRightColor"),Btt=g1("borderBottomColor"),Dtt=g1("borderLeftColor"),Ptt=g1("outline",Gd),Ttt=g1("outlineColor"),Ej=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ov(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:Nv(t,n)});return g2(e,e.borderRadius,r)}return null};Ej.propTypes={};Ej.filterProps=["borderRadius"];Sj($tt,ktt,Stt,Ett,Ltt,Itt,jtt,Mtt,Btt,Dtt,Ej,Ptt,Ttt);const Lj=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({gap:Nv(t,n)});return g2(e,e.gap,r)}return null};Lj.propTypes={};Lj.filterProps=["gap"];const Ij=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({columnGap:Nv(t,n)});return g2(e,e.columnGap,r)}return null};Ij.propTypes={};Ij.filterProps=["columnGap"];const jj=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({rowGap:Nv(t,n)});return g2(e,e.rowGap,r)}return null};jj.propTypes={};jj.filterProps=["rowGap"];const ztt=ha({prop:"gridColumn"}),Rtt=ha({prop:"gridRow"}),Ftt=ha({prop:"gridAutoFlow"}),Ott=ha({prop:"gridAutoColumns"}),Ntt=ha({prop:"gridAutoRows"}),Htt=ha({prop:"gridTemplateColumns"}),_tt=ha({prop:"gridTemplateRows"}),Vtt=ha({prop:"gridTemplateAreas"}),Utt=ha({prop:"gridArea"});Sj(Lj,Ij,jj,ztt,Rtt,Ftt,Ott,Ntt,Htt,_tt,Vtt,Utt);function i8(e,t){return t==="grey"?t:e}const Qtt=ha({prop:"color",themeKey:"palette",transform:i8}),Wtt=ha({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:i8}),Gtt=ha({prop:"backgroundColor",themeKey:"palette",transform:i8});Sj(Qtt,Wtt,Gtt);function nd(e){return e<=1&&e!==0?`${e*100}%`:e}const Ytt=ha({prop:"width",transform:nd}),vZ=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{const n=e.theme?.breakpoints?.values?.[r]||$j[r];return n?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:nd(r)}};return g2(e,e.maxWidth,t)}return null};vZ.filterProps=["maxWidth"];const Ktt=ha({prop:"minWidth",transform:nd}),qtt=ha({prop:"height",transform:nd}),Ztt=ha({prop:"maxHeight",transform:nd}),Jtt=ha({prop:"minHeight",transform:nd});ha({prop:"size",cssProperty:"width",transform:nd});ha({prop:"size",cssProperty:"height",transform:nd});const Xtt=ha({prop:"boxSizing"});Sj(Ytt,vZ,Ktt,qtt,Ztt,Jtt,Xtt);const Mj={border:{themeKey:"borders",transform:Gd},borderTop:{themeKey:"borders",transform:Gd},borderRight:{themeKey:"borders",transform:Gd},borderBottom:{themeKey:"borders",transform:Gd},borderLeft:{themeKey:"borders",transform:Gd},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Gd},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ej},color:{themeKey:"palette",transform:i8},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:i8},backgroundColor:{themeKey:"palette",transform:i8},p:{style:_n},pt:{style:_n},pr:{style:_n},pb:{style:_n},pl:{style:_n},px:{style:_n},py:{style:_n},padding:{style:_n},paddingTop:{style:_n},paddingRight:{style:_n},paddingBottom:{style:_n},paddingLeft:{style:_n},paddingX:{style:_n},paddingY:{style:_n},paddingInline:{style:_n},paddingInlineStart:{style:_n},paddingInlineEnd:{style:_n},paddingBlock:{style:_n},paddingBlockStart:{style:_n},paddingBlockEnd:{style:_n},m:{style:Hn},mt:{style:Hn},mr:{style:Hn},mb:{style:Hn},ml:{style:Hn},mx:{style:Hn},my:{style:Hn},margin:{style:Hn},marginTop:{style:Hn},marginRight:{style:Hn},marginBottom:{style:Hn},marginLeft:{style:Hn},marginX:{style:Hn},marginY:{style:Hn},marginInline:{style:Hn},marginInlineStart:{style:Hn},marginInlineEnd:{style:Hn},marginBlock:{style:Hn},marginBlockStart:{style:Hn},marginBlockEnd:{style:Hn},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Lj},rowGap:{style:jj},columnGap:{style:Ij},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:nd},maxWidth:{style:vZ},minWidth:{transform:nd},height:{transform:nd},maxHeight:{transform:nd},minHeight:{transform:nd},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function eot(...e){const t=e.reduce((n,a)=>n.concat(Object.keys(a)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function tot(e,t){return typeof e=="function"?e(t):e}function oot(){function e(r,n,a,l){const c={[r]:n,theme:a},d=l[r];if(!d)return{[r]:n};const{cssProperty:p=r,themeKey:u,transform:h,style:m}=d;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};const f=kj(a,u)||{};return m?m(c):g2(c,n,x=>{let y=LE(f,h,x);return x===y&&typeof x=="string"&&(y=LE(f,h,`${r}${x==="default"?"":mr(x)}`,x)),p===!1?y:{[p]:y}})}function t(r){const{sx:n,theme:a={},nested:l}=r||{};if(!n)return null;const c=a.unstable_sxConfig??Mj;function d(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=xtt(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=tot(u[x],a);if(y!=null)if(typeof y=="object")if(c[x])f=Zb(f,e(x,y,a,c));else{const b=g2({theme:a},y,w=>({[x]:w}));eot(b,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=Zb(f,b)}else f=Zb(f,e(x,y,a,c))}),!l&&a.modularCssLayers?{"@layer sx":Zre(a,Xre(m,f))}:Zre(a,Xre(m,f))}return Array.isArray(n)?n.map(d):d(n)}return t}const P4=oot();P4.filterProps=["sx"];function rot(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||typeof r.getColorSchemeSelector!="function")return{};let n=r.getColorSchemeSelector(e);return n==="&"?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}function CZ(e={},...t){const{breakpoints:r={},palette:n={},spacing:a,shape:l={},...c}=e,d=ptt(r),p=Mke(a);let u=ml({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:p,shape:{...gtt,...l}},c);return u=mtt(u),u.applyStyles=rot,u=t.reduce((h,m)=>ml(h,m),u),u.unstable_sxConfig={...Mj,...c?.unstable_sxConfig},u.unstable_sx=function(h){return P4({sx:h,theme:this})},u}function iot(e){return Object.keys(e).length===0}function AZ(e=null){const t=g.useContext(mke);return!t||iot(t)?e:t}const not=CZ();function Bke(e=not){return AZ(e)}function tie(e){const t=rg(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Dke({styles:e,themeId:t,defaultTheme:r={}}){const n=Bke(r),a=t&&n[t]||n;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(c=>tie(typeof c=="function"?c(a):c)):l=tie(l)),s.jsx(Eke,{styles:l})}const oie=e=>e,aot=()=>{let e=oie;return{configure(t){e=t},generate(t){return e(t)},reset(){e=oie}}},sot=aot();function Pke(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Pke(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ko(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Pke(e))&&(n&&(n+=" "),n+=t);return n}const lot={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function vi(e,t,r="Mui"){const n=lot[t];return n?`${r}-${n}`:`${sot.generate(e)}-${t}`}function ci(e,t,r="Mui"){const n={};return t.forEach(a=>{n[a]=vi(e,a,r)}),n}function Tke(e){const{variants:t,...r}=e,n={variants:t,style:rg(r),isProcessed:!0};return n.style===r||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=rg(a.style))}),n}const cot=CZ();function wT(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function i4(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function dot(e){return e?(t,r)=>r[e]:null}function pot(e,t,r){e.theme=mot(e.theme)?r:e.theme[t]||e.theme}function _S(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(a=>_S(e,a,r));if(Array.isArray(n?.variants)){let a;if(n.isProcessed)a=r?i4(n.style,r):n.style;else{const{variants:l,...c}=n;a=r?i4(rg(c),r):c}return zke(e,n.variants,[a],r)}return n?.isProcessed?r?i4(rg(n.style),r):n.style:r?i4(rg(n),r):n}function zke(e,t,r=[],n=void 0){let a;e:for(let l=0;l<t.length;l+=1){const c=t[l];if(typeof c.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!c.props(a))continue}else for(const d in c.props)if(e[d]!==c.props[d]&&e.ownerState?.[d]!==c.props[d])continue e;typeof c.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?i4(rg(c.style(a)),n):c.style(a))):r.push(n?i4(rg(c.style),n):c.style)}return r}function uot(e={}){const{themeId:t,defaultTheme:r=cot,rootShouldForwardProp:n=wT,slotShouldForwardProp:a=wT}=e;function l(c){pot(c,t,r)}return(c,d={})=>{stt(c,I=>I.filter(L=>L!==P4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=dot(fot(u)),...x}=d,y=p&&p.startsWith("Mui")||u?"components":"custom",b=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,w=m||!1;let v=wT;u==="Root"||u==="root"?v=n:u?v=a:got(c)&&(v=void 0);const A=att(c,{shouldForwardProp:v,label:hot(),...x}),S=I=>{if(I.__emotion_real===I)return I;if(typeof I=="function")return function(L){return _S(L,I,L.theme.modularCssLayers?y:void 0)};if(G0(I)){const L=Tke(I);return function(B){return L.variants?_S(B,L,B.theme.modularCssLayers?y:void 0):B.theme.modularCssLayers?i4(L.style,y):L.style}}return I},E=(...I)=>{const L=[],B=I.map(S),D=[];if(L.push(l),p&&f&&D.push(function(R){const N=R.theme.components?.[p]?.styleOverrides;if(!N)return null;const K={};for(const q in N)K[q]=_S(R,N[q],R.theme.modularCssLayers?"theme":void 0);return f(R,K)}),p&&!b&&D.push(function(R){const N=R.theme?.components?.[p]?.variants;return N?zke(R,N,[],R.theme.modularCssLayers?"theme":void 0):null}),w||D.push(P4),Array.isArray(B[0])){const R=B.shift(),N=new Array(L.length).fill(""),K=new Array(D.length).fill("");let q;q=[...N,...R,...K],q.raw=[...N,...R.raw,...K],L.unshift(q)}const P=[...L,...B,...D],T=A(...P);return c.muiName&&(T.muiName=c.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function hot(e,t){return void 0}function mot(e){for(const t in e)return!1;return!0}function got(e){return typeof e=="string"&&e.charCodeAt(0)>96}function fot(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function qW(e,t,r=!1){const n={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")n[l]={...e[l],...n[l]};else if(l==="componentsProps"||l==="slotProps"){const c=e[l],d=t[l];if(!d)n[l]=c||{};else if(!c)n[l]=d;else{n[l]={...d};for(const p in c)if(Object.prototype.hasOwnProperty.call(c,p)){const u=p;n[l][u]=qW(c[u],d[u],r)}}}else l==="className"&&r&&t.className?n.className=Ko(e?.className,t?.className):l==="style"&&r&&t.style?n.style={...e?.style,...t?.style}:n[l]===void 0&&(n[l]=e[l])}return n}const xd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function xot(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function $Z(e,t=0,r=1){return xot(e,t,r)}function yot(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,a)=>a<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function mg(e){if(e.type)return e;if(e.charAt(0)==="#")return mg(yot(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(m2(9,e));let n=e.substring(t+1,e.length-1),a;if(r==="color"){if(n=n.split(" "),a=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(m2(10,a))}else n=n.split(",");return n=n.map(l=>parseFloat(l)),{type:r,values:n,colorSpace:a}}const bot=e=>{const t=mg(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},mb=(e,t)=>{try{return bot(e)}catch{return e}};function Bj(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function Rke(e){e=mg(e);const{values:t}=e,r=t[0],n=t[1]/100,a=t[2]/100,l=n*Math.min(a,1-a),c=(u,h=(u+r/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let d="rgb";const p=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(d+="a",p.push(t[3])),Bj({type:d,values:p})}function ZW(e){e=mg(e);let t=e.type==="hsl"||e.type==="hsla"?mg(Rke(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function wot(e,t){const r=ZW(e),n=ZW(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function IE(e,t){return e=mg(e),t=$Z(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Bj(e)}function N3(e,t,r){try{return IE(e,t)}catch{return e}}function Dj(e,t){if(e=mg(e),t=$Z(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Bj(e)}function Di(e,t,r){try{return Dj(e,t)}catch{return e}}function Pj(e,t){if(e=mg(e),t=$Z(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Bj(e)}function Pi(e,t,r){try{return Pj(e,t)}catch{return e}}function vot(e,t=.15){return ZW(e)>.5?Dj(e,t):Pj(e,t)}function vA(e,t,r){try{return vot(e,t)}catch{return e}}const Fke=g.createContext(null);function kZ(){return g.useContext(Fke)}const Cot=typeof Symbol=="function"&&Symbol.for,Aot=Cot?Symbol.for("mui.nested"):"__THEME_NESTED__";function $ot(e,t){return typeof t=="function"?t(e):{...e,...t}}function kot(e){const{children:t,theme:r}=e,n=kZ(),a=g.useMemo(()=>{const l=n===null?{...r}:$ot(n,r);return l!=null&&(l[Aot]=n!==null),l},[r,n]);return s.jsx(Fke.Provider,{value:a,children:t})}const Oke=g.createContext();function Sot({value:e,...t}){return s.jsx(Oke.Provider,{value:e??!0,...t})}const C9=()=>g.useContext(Oke)??!1,Nke=g.createContext(void 0);function Eot({value:e,children:t}){return s.jsx(Nke.Provider,{value:e,children:t})}function Lot(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const a=t.components[r];return a.defaultProps?qW(a.defaultProps,n,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?qW(a,n,t.components.mergeClassNameAndStyle):n}function Iot({props:e,name:t}){const r=g.useContext(Nke);return Lot({props:e,name:t,theme:{components:r}})}let rie=0;function jot(e){const[t,r]=g.useState(e),n=e||t;return g.useEffect(()=>{t==null&&(rie+=1,r(`mui-${rie}`))},[t]),n}const Mot={...tJe},iie=Mot.useId;function Tj(e){if(iie!==void 0){const t=iie();return e??t}return jot(e)}function Bot(e){const t=AZ(),r=Tj()||"",{modularCssLayers:n}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!n||t!==null?a="":typeof n=="string"?a=n.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,xd(()=>{const l=document.querySelector("head");if(!l)return;const c=l.firstChild;if(a){if(c&&c.hasAttribute?.("data-mui-layer-order")&&c.getAttribute("data-mui-layer-order")===r)return;const d=document.createElement("style");d.setAttribute("data-mui-layer-order",r),d.textContent=a,l.prepend(d)}else l.querySelector(`style[data-mui-layer-order="${r}"]`)?.remove()},[a,r]),a?s.jsx(Dke,{styles:a}):null}const nie={};function aie(e,t,r,n=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof r=="function"){const l=r(a),c=e?{...t,[e]:l}:l;return n?()=>c:c}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,n])}function Hke(e){const{children:t,theme:r,themeId:n}=e,a=AZ(nie),l=kZ()||nie,c=aie(n,a,r),d=aie(n,l,r,!0),p=(n?c[n]:c).direction==="rtl",u=Bot(c);return s.jsx(kot,{theme:d,children:s.jsx(mke.Provider,{value:c,children:s.jsx(Sot,{value:p,children:s.jsxs(Eot,{value:n?c[n].components:c.components,children:[u,t]})})})})}const sie={theme:void 0};function Dot(e){let t,r;return function(n){let a=t;return(a===void 0||n.theme!==r)&&(sie.theme=n.theme,a=Tke(e(sie)),t=a,r=n.theme),a}}const SZ="mode",EZ="color-scheme",Pot="data-color-scheme";function Tot(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:a=SZ,colorSchemeStorageKey:l=EZ,attribute:c=Pot,colorSchemeNode:d="document.documentElement",nonce:p}=e||{};let u="",h=c;if(c==="class"&&(h=".%s"),c==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${d}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
3
3
  ${d}.classList.add('${f}'.replace('%s', colorScheme));`}const m=h.match(/\[([^[\]]+)\]/);if(m){const[f,x]=m[1].split("=");x||(u+=`${d}.removeAttribute('${f}'.replace('%s', light));
4
4
  ${d}.removeAttribute('${f}'.replace('%s', dark));`),u+=`
5
5
  ${d}.setAttribute('${f}'.replace('%s', colorScheme), ${x?`${x}.replace('%s', colorScheme)`:'""'});`}else h!==".%s"&&(u+=`${d}.setAttribute('${h}', colorScheme);`);return s.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(function() {
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
243
243
  `+he:"")+"\n```"},regExp:/^```(\w{1,10})?\s/,replace:q(re=>t.$createCodeNode(re?re[1]:void 0)),type:"element"},H={dependencies:[r.ListNode,r.ListItemNode],export:(re,he)=>r.$isListNode(re)?_(re,he,0):null,regExp:/^(\s*)[-*+]\s/,replace:F("bullet"),type:"element"},ee={dependencies:[r.ListNode,r.ListItemNode],export:(re,he)=>r.$isListNode(re)?_(re,he,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:F("check"),type:"element"},Y={dependencies:[r.ListNode,r.ListItemNode],export:(re,he)=>r.$isListNode(re)?_(re,he,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:F("number"),type:"element"},G={format:["code"],tag:"`",type:"text-format"},X={format:["highlight"],tag:"==",type:"text-format"},J={format:["bold","italic"],tag:"***",type:"text-format"},ae={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},xe={format:["bold"],tag:"**",type:"text-format"},me={format:["bold"],intraword:!1,tag:"__",type:"text-format"},de={format:["strikethrough"],tag:"~~",type:"text-format"},ce={format:["italic"],tag:"*",type:"text-format"},ge={format:["italic"],intraword:!1,tag:"_",type:"text-format"},be={dependencies:[l.LinkNode],export:(re,he,Ee)=>{if(!l.$isLinkNode(re))return null;he=(he=re.getTitle())?`[${re.getTextContent()}](${re.getURL()} "${he}")`:`[${re.getTextContent()}](${re.getURL()})`;const Be=re.getFirstChild();return re.getChildrenSize()===1&&e.$isTextNode(Be)?Ee(Be,he):he},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(re,he)=>{const[,Ee,Be,we]=he;he=l.$createLinkNode(Be,{title:we});const Pe=e.$createTextNode(Ee);Pe.setFormat(re.getFormat()),he.append(Pe),re.replace(he)},trigger:")",type:"text-match"},ie=[V,O,z,H,Y],ne=[G,J,ae,xe,me,X,ce,ge,de],fe=[be],ve=[...ie,...ne,...fe];return mn.$convertFromMarkdownString=function(re,he=ve,Ee){return B(he)(re,Ee)},mn.$convertToMarkdownString=function(re=ve,he){return u(re)(he)},mn.BOLD_ITALIC_STAR=J,mn.BOLD_ITALIC_UNDERSCORE=ae,mn.BOLD_STAR=xe,mn.BOLD_UNDERSCORE=me,mn.CHECK_LIST=ee,mn.CODE=z,mn.ELEMENT_TRANSFORMERS=ie,mn.HEADING=V,mn.HIGHLIGHT=X,mn.INLINE_CODE=G,mn.ITALIC_STAR=ce,mn.ITALIC_UNDERSCORE=ge,mn.LINK=be,mn.ORDERED_LIST=Y,mn.QUOTE=O,mn.STRIKETHROUGH=de,mn.TEXT_FORMAT_TRANSFORMERS=ne,mn.TEXT_MATCH_TRANSFORMERS=fe,mn.TRANSFORMERS=ve,mn.UNORDERED_LIST=H,mn.registerMarkdownShortcuts=function(re,he=ve){let Ee=d(he),Be=c(Ee.textFormat,({tag:Pe})=>Pe[Pe.length-1]),we=c(Ee.textMatch,({trigger:Pe})=>Pe);for(let Pe of he)if(he=Pe.type,(he==="element"||he==="text-match")&&!re.hasNodes(Pe.dependencies))throw Error("Minified Lexical error #79; visit https://lexical.dev/docs/error?code=79 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");return re.registerUpdateListener(({tags:Pe,dirtyLeaves:ze,editorState:tt,prevEditorState:Ue})=>{if(!Pe.has("historic")){var je=tt.read(e.$getSelection);if(Pe=Ue.read(e.$getSelection),e.$isRangeSelection(Pe)&&e.$isRangeSelection(je)&&je.isCollapsed()){Ue=je.anchor.key;var _e=je.anchor.offset,$e=tt._nodeMap.get(Ue);e.$isTextNode($e)&&ze.has(Ue)&&(_e===1||_e===Pe.anchor.offset+1)&&re.update(()=>{if(!$e.hasFormat("code")){var Ne=$e.getParent();if(Ne!==null&&!t.$isCodeNode(Ne)){var Ze=je.anchor.offset;e:{var Oe=Ee.element,et=Ne.getParent();if(e.$isRootOrShadowRoot(et)&&Ne.getFirstChild()===$e&&(et=$e.getTextContent(),et[Ze-1]===" ")){for(let{regExp:pt,replace:ut}of Oe)if((Oe=et.match(pt))&&Oe[0].length===Ze){et=$e.getNextSiblings();let[zt,Yt]=$e.splitText(Ze);zt.remove(),et=Yt?[Yt,...et]:et,ut(Ne,et,Oe,!1),Ne=!0;break e}}Ne=!1}if(!Ne){e:{if(Oe=$e.getTextContent(),Ne=we[Oe[Ze-1]],Ne!=null){Ze<Oe.length&&(Oe=Oe.slice(0,Ze));for(He of Ne)if(Ne=Oe.match(He.regExp),Ne!==null){Oe=Ne.index||0,et=Oe+Ne[0].length;var mt=void 0;Oe===0?[mt]=$e.splitText(et):[,mt]=$e.splitText(Oe,et),mt.selectNext(0,0),He.replace(mt,Ne);var He=!0;break e}}He=!1}if(!He)e:{et=$e.getTextContent(),--Ze;var bt=et[Ze];if(He=Be[bt])for(let pt of He){var{tag:Mt}=pt;He=Mt.length;let ut=Ze-He+1;if(!(1<He&&!K(et,ut,Mt,0,He)||et[ut-1]===" ")&&(mt=et[Ze+1],pt.intraword!==!1||!mt||p.test(mt))){Ne=mt=$e,Oe=N(et,ut,Mt);for(var Ft=Ne;0>Oe&&(Ft=Ft.getPreviousSibling())&&!e.$isLineBreakNode(Ft);)e.$isTextNode(Ft)&&(Oe=Ft.getTextContent(),Ne=Ft,Oe=N(Oe,Oe.length,Mt));if(!(0>Oe||Ne===mt&&Oe+He===ut||(Mt=Ne.getTextContent(),0<Oe&&Mt[Oe-1]===bt||(Ft=Mt[Oe-1],pt.intraword===!1&&Ft&&!p.test(Ft))))){et=mt.getTextContent(),et=et.slice(0,ut)+et.slice(Ze+1),mt.setTextContent(et),et=Ne===mt?et:Mt,Ne.setTextContent(et.slice(0,Oe)+et.slice(Oe+He)),et=e.$getSelection(),bt=e.$createRangeSelection(),e.$setSelection(bt),Ze=Ze-He*(Ne===mt?2:1)+1,bt.anchor.set(Ne.__key,Oe,"text"),bt.focus.set(mt.__key,Ze,"text");for(let zt of pt.format)bt.hasFormat(zt)||bt.formatText(zt);bt.anchor.set(bt.focus.key,bt.focus.offset,bt.focus.type);for(let zt of pt.format)bt.hasFormat(zt)&&bt.toggleFormat(zt);e.$isRangeSelection(et)&&(bt.format=et.format);break e}}}}}}}})}}})},mn}var WH,rme;function Qze(){return rme||(rme=1,WH=uOt()),WH}var hOt=Qze(),GH={},ime;function mOt(){if(ime)return GH;ime=1;var e=Ad(),t=Tc();return GH.AutoFocusPlugin=function({defaultSelection:r}){let[n]=e.useLexicalComposerContext();return t.useEffect(()=>{n.focus(()=>{let a=document.activeElement,l=n.getRootElement();l===null||a!==null&&l.contains(a)||l.focus({preventScroll:!0})},{defaultSelection:r})},[r,n]),null},GH}var YH,nme;function gOt(){return nme||(nme=1,YH=mOt()),YH}var fOt=gOt(),u$={},v7={},KH={},ame;function xOt(){if(ame)return KH;ame=1;var e=Ad(),t=Ta(),r=Tc();function n(a,l){return a.getEditorState().read(()=>{let c=t.$getNodeByKey(l);return c===null?!1:c.isSelected()})}return KH.useLexicalNodeSelection=function(a){let[l]=e.useLexicalComposerContext(),[c,d]=r.useState(()=>n(l,a));r.useEffect(()=>{let h=!0,m=l.registerUpdateListener(()=>{h&&d(n(l,a))});return()=>{h=!1,m()}},[l,a]);let p=r.useCallback(h=>{l.update(()=>{let m=t.$getSelection();t.$isNodeSelection(m)||(m=t.$createNodeSelection(),t.$setSelection(m)),h?m.add(a):m.delete(a)})},[l,a]),u=r.useCallback(()=>{l.update(()=>{const h=t.$getSelection();t.$isNodeSelection(h)&&h.clear()})},[l]);return[c,p,u]},KH}var qH,sme;function yOt(){return sme||(sme=1,qH=xOt()),qH}var lme;function bOt(){if(lme)return v7;lme=1;var e=Ad(),t=yOt(),r=Rc(),n=Ta(),a=Tc();let l=n.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function c({nodeKey:m}){let[f]=e.useLexicalComposerContext(),[x,y,b]=t.useLexicalNodeSelection(m),w=a.useCallback(v=>(x&&n.$isNodeSelection(n.$getSelection())&&(v.preventDefault(),v=n.$getNodeByKey(m),h(v)&&v.remove(),y(!1)),!1),[x,m,y]);return a.useEffect(()=>r.mergeRegister(f.registerCommand(n.CLICK_COMMAND,v=>{let A=f.getElementByKey(m);return v.target===A?(v.shiftKey||b(),y(!x),!0):!1},n.COMMAND_PRIORITY_LOW),f.registerCommand(n.KEY_DELETE_COMMAND,w,n.COMMAND_PRIORITY_LOW),f.registerCommand(n.KEY_BACKSPACE_COMMAND,w,n.COMMAND_PRIORITY_LOW)),[b,f,x,m,w,y]),a.useEffect(()=>{let v=f.getElementByKey(m);v!==null&&(v.className=x?"selected":"")},[f,x,m]),null}class d extends n.DecoratorNode{static getType(){return"horizontalrule"}static clone(f){return new d(f.__key)}static importJSON(){return u()}static importDOM(){return{hr:()=>({conversion:p,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
244
244
  `}isInline(){return!1}updateDOM(){return!1}decorate(){return a.createElement(c,{nodeKey:this.__key})}}function p(){return{node:u()}}function u(){return n.$applyNodeReplacement(new d)}function h(m){return m instanceof d}return v7.$createHorizontalRuleNode=u,v7.$isHorizontalRuleNode=h,v7.HorizontalRuleNode=d,v7.INSERT_HORIZONTAL_RULE_COMMAND=l,v7}var ZH,cme;function wOt(){return cme||(cme=1,ZH=bOt()),ZH}var dme;function vOt(){if(dme)return u$;dme=1;var e=Qze(),t=Ad(),r=wOt(),n=Tc();let a=[{dependencies:[r.HorizontalRuleNode],export:l=>r.$isHorizontalRuleNode(l)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(l,c,d,p)=>{c=r.$createHorizontalRuleNode(),p||l.getNextSibling()!=null?l.replace(c):l.insertBefore(c),c.selectNext()},type:"element"},...e.TRANSFORMERS];return u$.DEFAULT_TRANSFORMERS=a,u$.MarkdownShortcutPlugin=function({transformers:l=a}){let[c]=t.useLexicalComposerContext();return n.useEffect(()=>e.registerMarkdownShortcuts(c,l),[c,l]),null},u$}var JH,pme;function COt(){return pme||(pme=1,JH=vOt()),JH}var AOt=COt(),hi={},ume;function $Ot(){if(ume)return hi;ume=1;var e=Ta(),t=Rc();let r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class n extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(z){let H=new n(z.__headerState,z.__colSpan,z.__width,z.__key);return H.__rowSpan=z.__rowSpan,H}static importDOM(){return{td:()=>({conversion:a,priority:0}),th:()=>({conversion:a,priority:0})}}static importJSON(z){let H=l(z.headerState,z.colSpan,z.width||void 0);return H.__rowSpan=z.rowSpan,H}constructor(z=r.NO_STATUS,H=1,ee,Y){super(H,Y),this.__headerState=z,this.__width=ee}createDOM(z){let H=document.createElement(this.getTag());return this.__width&&(H.style.width=`${this.__width}px`),1<this.__colSpan&&(H.colSpan=this.__colSpan),1<this.__rowSpan&&(H.rowSpan=this.__rowSpan),t.addClassNamesToElement(H,z.theme.tableCell,this.hasHeader()&&z.theme.tableCellHeader),H}exportDOM(z){if({element:z}=super.exportDOM(z),z){let H=this.getParentOrThrow().getChildrenSize();z.style.border="1px solid black",1<this.__colSpan&&(z.colSpan=this.__colSpan),1<this.__rowSpan&&(z.rowSpan=this.__rowSpan),z.style.width=`${this.getWidth()||Math.max(90,700/H)}px`,z.style.verticalAlign="top",z.style.textAlign="start",this.hasHeader()&&(z.style.backgroundColor="#f2f3f5")}return{element:z}}exportJSON(){return{...super.exportJSON(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(z){return this.getWritable().__headerState=z,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(z){return this.getWritable().__width=z,this.__width}getWidth(){return this.getLatest().__width}toggleHeaderStyle(z){let H=this.getWritable();return H.__headerState=(H.__headerState&z)===z?H.__headerState-z:H.__headerState+z,H}hasHeaderState(z){return(this.getHeaderStyles()&z)===z}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(z){return z.__headerState!==this.__headerState||z.__width!==this.__width||z.__colSpan!==this.__colSpan||z.__rowSpan!==this.__rowSpan}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function a(O){var z=O.nodeName.toLowerCase();return z=l(z==="th"?r.ROW:r.NO_STATUS),z.__colSpan=O.colSpan,z.__rowSpan=O.rowSpan,{forChild:(H,ee)=>c(ee)&&!e.$isElementNode(H)?(ee=e.$createParagraphNode(),e.$isLineBreakNode(H)&&H.getTextContent()===`
245
245
  `?null:(ee.append(H),ee)):H,node:z}}function l(O,z=1,H){return e.$applyNodeReplacement(new n(O,z,H))}function c(O){return O instanceof n}class d extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(z){return new d(z.__height,z.__key)}static importDOM(){return{tr:()=>({conversion:p,priority:0})}}static importJSON(z){return u(z.height)}constructor(z,H){super(H),this.__height=z}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(z){let H=document.createElement("tr");return this.__height&&(H.style.height=`${this.__height}px`),t.addClassNamesToElement(H,z.theme.tableRow),H}isShadowRoot(){return!0}setHeight(z){return this.getWritable().__height=z,this.__height}getHeight(){return this.getLatest().__height}updateDOM(z){return z.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function p(){return{node:u()}}function u(O){return e.$applyNodeReplacement(new d(O))}function h(O){return O instanceof d}function m(O){throw Error(`Minified Lexical error #${O}; visit https://lexical.dev/docs/error?code=${O} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let f=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class x{constructor(z,H){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=H,this.editor=z,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(z=>z())}trackTableGrid(){let z=new MutationObserver(H=>{this.editor.update(()=>{var ee=!1;for(let Y=0;Y<H.length;Y++){const G=H[Y].target.nodeName;if(G==="TABLE"||G==="TR"){ee=!0;break}}if(ee){if(ee=this.editor.getElementByKey(this.tableNodeKey),!ee)throw Error("Expected to find TableElement in DOM");this.grid=b(ee)}})});this.editor.update(()=>{let H=this.editor.getElementByKey(this.tableNodeKey);if(!H)throw Error("Expected to find TableElement in DOM");this.grid=b(H),z.observe(H,{childList:!0,subtree:!0})})}clearHighlight(){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),this.editor.update(()=>{var z=e.$getNodeByKey(this.tableNodeKey);if(!R(z))throw Error("Expected TableNode.");if(z=this.editor.getElementByKey(this.tableNodeKey),!z)throw Error("Expected to find TableElement in DOM");z=b(z),w(z,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){this.editor.update(()=>{let z=this.editor.getElementByKey(this.tableNodeKey);if(!z)throw Error("Expected to find TableElement in DOM");z.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){this.editor.update(()=>{let z=this.editor.getElementByKey(this.tableNodeKey);if(!z)throw Error("Expected to find TableElement in DOM");z.classList.add("disable-selection"),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(z){z!=null&&z.gridKey===this.tableNodeKey?(this.gridSelection=z,this.isHighlightingCells=!0,this.disableHighlightStyle(),w(this.grid,this.gridSelection)):z==null&&this.clearHighlight()}setFocusCellForSelection(z,H=!1){this.editor.update(()=>{var ee=e.$getNodeByKey(this.tableNodeKey);if(!R(ee))throw Error("Expected TableNode.");if(!this.editor.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ee=z.x;let Y=z.y;if(this.focusCell=z,this.anchorCell!==null){let G=f?(this.editor._window||window).getSelection():null;G&&G.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ee||this.anchorY!==Y||H))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ee===this.focusX&&Y===this.focusY)return;this.focusX=ee,this.focusY=Y,this.isHighlightingCells&&(ee=e.$getNearestNodeFromDOMNode(z.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&c(ee)&&(ee=ee.getKey(),this.gridSelection=this.gridSelection.clone()||e.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ee,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),w(this.grid,this.gridSelection)))})}setAnchorCellForSelection(z){this.isHighlightingCells=!1,this.anchorCell=z,this.anchorX=z.x,this.anchorY=z.y,this.editor.update(()=>{var H=e.$getNearestNodeFromDOMNode(z.elem);c(H)&&(H=H.getKey(),this.gridSelection=e.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=H)})}formatCells(z){this.editor.update(()=>{let H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11);let ee=e.$createRangeSelection(),Y=ee.anchor,G=ee.focus;H.getNodes().forEach(X=>{c(X)&&X.getTextContentSize()!==0&&(Y.set(X.getKey(),0,"element"),G.set(X.getKey(),X.getChildrenSize(),"element"),ee.formatText(z))}),e.$setSelection(H),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){this.editor.update(()=>{let z=e.$getNodeByKey(this.tableNodeKey);if(!R(z))throw Error("Expected TableNode.");var H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11),H=H.getNodes().filter(c),H.length===this.grid.columns*this.grid.rows?(z.selectPrevious(),z.remove(),e.$getRoot().selectStart()):(H.forEach(ee=>{if(e.$isElementNode(ee)){let Y=e.$createParagraphNode(),G=e.$createTextNode();Y.append(G),ee.append(Y),ee.getChildren().forEach(X=>{X!==Y&&X.remove()})}}),w(this.grid,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function y(O){for(;O!=null;){let z=O.nodeName;if(z==="TD"||z==="TH"){if(O=O._cell,O===void 0)break;return O}O=O.parentNode}return null}function b(O){let z=[],H={cells:z,columns:0,rows:0};var ee=O.firstChild;let Y=O=0;for(z.length=0;ee!=null;){var G=ee.nodeName;if(G==="TD"||G==="TH")G={elem:ee,highlighted:!1,x:O,y:Y},ee._cell=G,z[Y]===void 0&&(z[Y]=[]),z[Y][O]=G;else if(G=ee.firstChild,G!=null){ee=G;continue}if(G=ee.nextSibling,G!=null)O++,ee=G;else if(G=ee.parentNode,G!=null){if(ee=G.nextSibling,ee==null)break;Y++,O=0}}return H.columns=O+1,H.rows=Y+1,H}function w(O,z){let H=[],ee=new Set(z?z.getNodes():[]);return v(O,(Y,G)=>{let X=Y.elem;ee.has(G)?(Y.highlighted=!0,X.style.setProperty("background-color","rgb(172, 206, 247)"),X.style.setProperty("caret-color","transparent"),H.push(Y)):(Y.highlighted=!1,X.style.removeProperty("background-color"),X.style.removeProperty("caret-color"),X.getAttribute("style")||X.removeAttribute("style"))}),H}function v(O,z){({cells:O}=O);for(let H=0;H<O.length;H++){let ee=O[H];for(let Y=0;Y<ee.length;Y++){let G=ee[Y],X=e.$getNearestNodeFromDOMNode(G.elem);X!==null&&z(G,X,{x:Y,y:H})}}}function A(O){O.disableHighlightStyle(),v(O.grid,z=>{let H=z.elem;z.highlighted=!0,H.style.setProperty("background-color","rgb(172, 206, 247)"),H.style.setProperty("caret-color","transparent")})}function S(O){O.enableHighlightStyle(),v(O.grid,z=>{let H=z.elem;z.highlighted=!1,H.style.removeProperty("background-color"),H.style.removeProperty("caret-color"),H.getAttribute("style")||H.removeAttribute("style")})}let E=(O,z,H,ee,Y)=>{const G=Y==="forward";switch(Y){case"backward":case"forward":return H!==(G?O.grid.columns-1:0)?B(z.getCellNodeFromCordsOrThrow(H+(G?1:-1),ee,O.grid)):ee!==(G?O.grid.rows-1:0)?B(z.getCellNodeFromCordsOrThrow(G?0:O.grid.columns-1,ee+(G?1:-1),O.grid)):G?z.selectNext():z.selectPrevious(),!0;case"up":return ee!==0?B(z.getCellNodeFromCordsOrThrow(H,ee-1,O.grid)):z.selectPrevious(),!0;case"down":return ee!==O.grid.rows-1?B(z.getCellNodeFromCordsOrThrow(H,ee+1,O.grid)):z.selectNext(),!0;default:return!1}},I=(O,z,H,ee,Y)=>{const G=Y==="forward";switch(Y){case"backward":case"forward":return H!==(G?O.grid.columns-1:0)&&O.setFocusCellForSelection(z.getCellFromCordsOrThrow(H+(G?1:-1),ee,O.grid)),!0;case"up":return ee!==0?(O.setFocusCellForSelection(z.getCellFromCordsOrThrow(H,ee-1,O.grid)),!0):!1;case"down":return ee!==O.grid.rows-1?(O.setFocusCellForSelection(z.getCellFromCordsOrThrow(H,ee+1,O.grid)),!0):!1;default:return!1}};function L(O,z){if(e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)){let H=z.isParentOf(O.anchor.getNode());return O=z.isParentOf(O.focus.getNode()),H&&O}return!1}function B(O){let z=O.getChildren().find(H=>e.$isParagraphNode(H));e.$isParagraphNode(z)?z.selectEnd():O.selectEnd()}class D extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(z){return new D(z.__key)}static importDOM(){return{table:()=>({conversion:P,priority:1})}}static importJSON(){return T()}constructor(z){super(z)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(z){let H=document.createElement("table");return t.addClassNamesToElement(H,z.theme.table),H}updateDOM(){return!1}exportDOM(z){return{...super.exportDOM(z),after:H=>{if(H){let ee=H.cloneNode(),Y=document.createElement("colgroup"),G=document.createElement("tbody");if(G.append(...H.children),H=this.getFirstChildOrThrow(),!h(H))throw Error("Expected to find row node.");H=H.getChildrenSize();for(let X=0;X<H;X++){let J=document.createElement("col");Y.append(J)}return ee.replaceChildren(Y,G),ee}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(z,H){let{rows:ee,cells:Y}=H;for(H=0;H<ee;H++){var G=Y[H];if(G==null)throw Error(`Row not found at y:${H}`);if(G=G.findIndex(({elem:X})=>e.$getNearestNodeFromDOMNode(X)===z),G!==-1)return{x:G,y:H}}throw Error("Cell not found in table.")}getCellFromCords(z,H,ee){return{cells:ee}=ee,H=ee[H],H==null?null:(z=H[z],z??null)}getCellFromCordsOrThrow(z,H,ee){if(z=this.getCellFromCords(z,H,ee),!z)throw Error("Cell not found at cords.");return z}getCellNodeFromCords(z,H,ee){return z=this.getCellFromCords(z,H,ee),z==null?null:(z=e.$getNearestNodeFromDOMNode(z.elem),c(z)?z:null)}getCellNodeFromCordsOrThrow(z,H,ee){if(z=this.getCellNodeFromCords(z,H,ee),!z)throw Error("Node at cords not TableCellNode.");return z}canSelectBefore(){return!0}canIndent(){return!1}}function P(){return{node:T()}}function T(){return e.$applyNodeReplacement(new D)}function R(O){return O instanceof D}function N(O){if(O=t.$findMatchingParent(O,z=>h(z)),h(O))return O;throw Error("Expected table cell to be inside of table row.")}function K(O){if(O=t.$findMatchingParent(O,z=>R(z)),R(O))return O;throw Error("Expected table cell to be inside of table.")}function q(O,z){let H=K(O),{x:ee,y:Y}=H.getCordsFromCellNode(O,z);return{above:H.getCellNodeFromCords(ee,Y-1,z),below:H.getCellNodeFromCords(ee,Y+1,z),left:H.getCellNodeFromCords(ee-1,Y,z),right:H.getCellNodeFromCords(ee+1,Y,z)}}function F(O){O=O.getFirstDescendant(),O===null&&m(124),O.getParentOrThrow().selectStart()}function _(O,z){let H=O.getFirstChild();H!==null?H.insertBefore(z):O.append(z)}let V=e.createCommand("INSERT_TABLE_COMMAND");return hi.$createTableCellNode=l,hi.$createTableNode=T,hi.$createTableNodeWithDimensions=function(O,z,H=!0){let ee=T();for(let G=0;G<O;G++){let X=u();for(let J=0;J<z;J++){var Y=r.NO_STATUS;typeof H=="object"?(G===0&&H.rows&&(Y|=r.ROW),J===0&&H.columns&&(Y|=r.COLUMN)):H&&(G===0&&(Y|=r.ROW),J===0&&(Y|=r.COLUMN)),Y=l(Y);let ae=e.$createParagraphNode();ae.append(e.$createTextNode()),Y.append(ae),X.append(Y)}ee.append(X)}return ee},hi.$createTableRowNode=u,hi.$deleteTableColumn=function(O,z){let H=O.getChildren();for(let Y=0;Y<H.length;Y++){var ee=H[Y];if(h(ee)){if(ee=ee.getChildren(),z>=ee.length||0>z)throw Error("Table column target index out of range");ee[z].remove()}}return O},hi.$deleteTableColumn__EXPERIMENTAL=function(){var O=e.$getSelection();e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)||m(118);var z=O.anchor.getNode();O=O.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(z);[z]=e.DEPRECATED_$getNodeTriplet(O);let[Y,G,X]=e.DEPRECATED_$computeGridMap(ee,H,z);var{startColumn:J}=G;let{startRow:ae,startColumn:xe}=X;O=Math.min(J,xe),J=Math.max(J+H.__colSpan-1,xe+z.__colSpan-1);let me=J-O+1;if(Y[0].length===J-O+1)ee.selectPrevious(),ee.remove();else{var de=Y.length;for(let ce=0;ce<de;ce++)for(let ge=O;ge<=J;ge++){let{cell:be,startColumn:ie}=Y[ce][ge];ie<O?ge===O&&be.setColSpan(be.__colSpan-Math.min(me,be.__colSpan-(O-ie))):ie+be.__colSpan-1>J?ge===J&&be.setColSpan(be.__colSpan-(J-ie+1)):be.remove()}O=Y[ae],z=O[xe+z.__colSpan],z!==void 0?({cell:z}=z,F(z)):({cell:z}=O[xe-1],F(z))}},hi.$deleteTableRow__EXPERIMENTAL=function(){var O=e.$getSelection();e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)||m(118);var z=O.anchor.getNode();O=O.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(z);[O]=e.DEPRECATED_$getNodeTriplet(O);let[Y,G,X]=e.DEPRECATED_$computeGridMap(ee,H,O);({startRow:z}=G);var{startRow:J}=X;if(O=J+O.__rowSpan-1,Y.length===O-z+1)ee.remove();else{J=Y[0].length;var ae=Y[O+1],xe=ee.getChildAtIndex(O+1);for(let de=O;de>=z;de--){for(var me=J-1;0<=me;me--){let{cell:ce,startRow:ge,startColumn:be}=Y[de][me];if(be===me&&(de===z&&ge<z&&ce.setRowSpan(ce.__rowSpan-(ge-z)),ge>=z&&ge+ce.__rowSpan-1>O))if(ce.setRowSpan(ce.__rowSpan-(O-ge+1)),xe===null&&m(122),me===0)_(xe,ce);else{let{cell:ie}=ae[me-1];ie.insertAfter(ce)}}me=ee.getChildAtIndex(de),e.DEPRECATED_$isGridRowNode(me)||m(123),me.remove()}ae!==void 0?({cell:z}=ae[0],F(z)):({cell:z}=Y[z-1][0],F(z))}},hi.$getElementGridForTableNode=function(O,z){if(O=O.getElementByKey(z.getKey()),O==null)throw Error("Table Element Not Found");return b(O)},hi.$getTableCellNodeFromLexicalNode=function(O){return O=t.$findMatchingParent(O,z=>c(z)),c(O)?O:null},hi.$getTableColumnIndexFromTableCellNode=function(O){return N(O).getChildren().findIndex(z=>z.is(O))},hi.$getTableNodeFromLexicalNodeOrThrow=K,hi.$getTableRowIndexFromTableCellNode=function(O){let z=N(O);return K(z).getChildren().findIndex(H=>H.is(z))},hi.$getTableRowNodeFromTableCellNodeOrThrow=N,hi.$insertTableColumn=function(O,z,H=!0,ee,Y){let G=O.getChildren();for(let ae=0;ae<G.length;ae++){let xe=G[ae];if(h(xe))for(let me=0;me<ee;me++){var X=xe.getChildren();if(z>=X.length||0>z)throw Error("Table column target index out of range");X=X[z],c(X)||m(12);let{left:de,right:ce}=q(X,Y);var J=r.NO_STATUS;(de&&de.hasHeaderState(r.ROW)||ce&&ce.hasHeaderState(r.ROW))&&(J|=r.ROW),J=l(J),J.append(e.$createParagraphNode()),H?X.insertAfter(J):X.insertBefore(J)}}return O},hi.$insertTableColumn__EXPERIMENTAL=function(O=!0){function z(){let me=l(r.NO_STATUS).append(e.$createParagraphNode());return ae===null&&(ae=me),me}var H=e.$getSelection();e.$isRangeSelection(H)||e.DEPRECATED_$isGridSelection(H)||m(118),H=H.focus.getNode();let[ee,,Y]=e.DEPRECATED_$getNodeTriplet(H),[G,X]=e.DEPRECATED_$computeGridMap(Y,ee,ee);H=G.length;var{startColumn:J}=X;O=O?J+ee.__colSpan-1:J-1,J=Y.getFirstChild(),e.DEPRECATED_$isGridRowNode(J)||m(120);let ae=null;var xe=J;e:for(J=0;J<H;J++){J!==0&&(xe=xe.getNextSibling(),e.DEPRECATED_$isGridRowNode(xe)||m(121));let me=G[J];if(0>O){_(xe,z());continue}let{cell:de,startColumn:ce,startRow:ge}=me[O];if(ce+de.__colSpan-1<=O){let be=de,ie=ge,ne=O;for(;ie!==J&&1<be.__rowSpan;)if(ne-=de.__colSpan,0<=ne){let{cell:fe,startRow:ve}=me[ne];be=fe,ie=ve}else{xe.append(z());continue e}be.insertAfter(z())}else de.setColSpan(de.__colSpan+1)}ae!==null&&F(ae)},hi.$insertTableRow=function(O,z,H=!0,ee,Y){var G=O.getChildren();if(z>=G.length||0>z)throw Error("Table row target index out of range");if(z=G[z],h(z))for(G=0;G<ee;G++){let J=z.getChildren(),ae=J.length,xe=u();for(let me=0;me<ae;me++){var X=J[me];c(X)||m(12);let{above:de,below:ce}=q(X,Y);X=r.NO_STATUS;let ge=de&&de.getWidth()||ce&&ce.getWidth()||void 0;(de&&de.hasHeaderState(r.COLUMN)||ce&&ce.hasHeaderState(r.COLUMN))&&(X|=r.COLUMN),X=l(X,1,ge),X.append(e.$createParagraphNode()),xe.append(X)}H?z.insertAfter(xe):z.insertBefore(xe)}else throw Error("Row before insertion index does not exist.");return O},hi.$insertTableRow__EXPERIMENTAL=function(O=!0){var z=e.$getSelection();e.$isRangeSelection(z)||e.DEPRECATED_$isGridSelection(z)||m(118),z=z.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(z),[Y,G]=e.DEPRECATED_$computeGridMap(ee,H,H);z=Y[0].length;var{startRow:X}=G;if(O){O=X+H.__rowSpan-1;var J=Y[O];X=u();for(var ae=0;ae<z;ae++){let{cell:xe,startRow:me}=J[ae];me+xe.__rowSpan-1<=O?X.append(l(r.NO_STATUS)):xe.setRowSpan(xe.__rowSpan+1)}z=ee.getChildAtIndex(O),e.DEPRECATED_$isGridRowNode(z)||m(119),z.insertAfter(X)}else{for(J=Y[X],O=u(),ae=0;ae<z;ae++){let{cell:xe,startRow:me}=J[ae];me===X?O.append(l(r.NO_STATUS)):xe.setRowSpan(xe.__rowSpan+1)}z=ee.getChildAtIndex(X),e.DEPRECATED_$isGridRowNode(z)||m(119),z.insertBefore(O)}},hi.$isTableCellNode=c,hi.$isTableNode=R,hi.$isTableRowNode=h,hi.$removeTableRowAtIndex=function(O,z){let H=O.getChildren();if(z>=H.length||0>z)throw Error("Expected table cell to be inside of table row.");return H[z].remove(),O},hi.$unmergeCell=function(){var O=e.$getSelection();e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)||m(118),O=O.anchor.getNode();let[z,H,ee]=e.DEPRECATED_$getNodeTriplet(O);O=z.__colSpan;let Y=z.__rowSpan;if(1<O){for(var G=1;G<O;G++)z.insertAfter(l(r.NO_STATUS));z.setColSpan(1)}if(1<Y){let[ae,xe]=e.DEPRECATED_$computeGridMap(ee,z,z),{startColumn:me,startRow:de}=xe;for(G=1;G<Y;G++){let ce=de+G,ge=ae[ce];var X=H.getNextSibling();e.DEPRECATED_$isGridRowNode(X)||m(125);var J=null;for(let be=0;be<me;be++){let ie=ge[be],ne=ie.cell;ie.startRow===ce&&(J=ne),1<ne.__colSpan&&(be+=ne.__colSpan-1)}if(J===null)for(J=0;J<O;J++)_(X,l(r.NO_STATUS));else for(X=0;X<O;X++)J.insertAfter(l(r.NO_STATUS))}z.setRowSpan(1)}},hi.INSERT_TABLE_COMMAND=V,hi.TableCellHeaderStates=r,hi.TableCellNode=n,hi.TableNode=D,hi.TableRowNode=d,hi.TableSelection=x,hi.applyTableHandlers=function(O,z,H){let ee=H.getRootElement();if(ee===null)throw Error("No root element.");let Y=new x(H,O.getKey());z.__lexicalTableSelection=Y;let G=!1,X=!1;z.addEventListener("dblclick",de=>{let ce=y(de.target);ce!==null&&(de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),Y.setAnchorCellForSelection(ce),Y.setFocusCellForSelection(ce,!0),G=!1)}),z.addEventListener("mousedown",de=>{setTimeout(()=>{if(de.button===0){var ce=y(de.target);ce!==null&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation(),Y.setAnchorCellForSelection(ce))}},0)}),z.addEventListener("mousemove",de=>{if(X&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation()),G){let ce=y(de.target);if(ce!==null){let ge=ce.x,be=ce.y;G&&(Y.anchorX!==ge||Y.anchorY!==be||Y.isHighlightingCells)&&(de.preventDefault(),Y.setFocusCellForSelection(ce))}}}),z.addEventListener("mouseleave",()=>{});let J=de=>{de.button===0&&H.update(()=>{var ce=e.$getSelection();const ge=de.target;if(ge instanceof Node){if(e.DEPRECATED_$isGridSelection(ce)&&ce.gridKey===Y.tableNodeKey&&ee.contains(ge))return Y.clearHighlight();ce=e.$getNearestNodeFromDOMNode(ge),ce!==null&&t.$findMatchingParent(ce,e.DEPRECATED_$isGridNode)&&(G=!0)}})};window.addEventListener("mousedown",J),Y.listenersToRemove.add(()=>window.removeEventListener("mousedown",J));let ae=de=>{var ce;(ce=G)&&(ce=de.target,ce=ce!==null&&ce.nodeName==="SPAN",ce=!ce),ce&&(de.preventDefault(),de.stopPropagation()),G=!1};window.addEventListener("mouseup",ae),Y.listenersToRemove.add(()=>window.removeEventListener("mouseup",ae)),z.addEventListener("mouseup",ae),Y.listenersToRemove.add(()=>z.removeEventListener("mouseup",ae)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_DOWN_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),ie=>c(ie));if(!c(ge))return!1;var be=O.getCordsFromCellNode(ge,Y.grid);if(ce=t.$findMatchingParent(ce.anchor.getNode(),ie=>e.$isElementNode(ie)),ce==null)throw Error("Expected BlockNode Parent");if((ge=ge.getLastChild())&&ce.isParentOf(ge)||ce===ge||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(be.x,be.y,Y.grid)),I(Y,O,be.x,be.y,"down")):E(Y,O,be.x,be.y,"down")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return be=ce.focus.getNode(),c(be)?(be=O.getCordsFromCellNode(be,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,be.x,be.y,"down")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_UP_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),ie=>c(ie));if(!c(ge))return!1;var be=O.getCordsFromCellNode(ge,Y.grid);if(ce=t.$findMatchingParent(ce.anchor.getNode(),ie=>e.$isElementNode(ie)),ce==null)throw Error("Expected BlockNode Parent");if((ge=ge.getLastChild())&&ce.isParentOf(ge)||ce===ge||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(be.x,be.y,Y.grid)),I(Y,O,be.x,be.y,"up")):E(Y,O,be.x,be.y,"up")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return be=ce.focus.getNode(),c(be)?(be=O.getCordsFromCellNode(be,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,be.x,be.y,"up")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_LEFT_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),be=>c(be));if(!c(ge))return!1;if(ge=O.getCordsFromCellNode(ge,Y.grid),t.$findMatchingParent(ce.anchor.getNode(),be=>e.$isElementNode(be))==null)throw Error("Expected BlockNode Parent");if(ce.anchor.offset===0||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(ge.x,ge.y,Y.grid)),I(Y,O,ge.x,ge.y,"backward")):E(Y,O,ge.x,ge.y,"backward")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return ce=ce.focus.getNode(),c(ce)?(ce=O.getCordsFromCellNode(ce,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,ce.x,ce.y,"backward")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),be=>c(be));if(!c(ge))return!1;if(ge=O.getCordsFromCellNode(ge,Y.grid),t.$findMatchingParent(ce.anchor.getNode(),be=>e.$isElementNode(be))==null)throw Error("Expected BlockNode Parent");if(ce.anchor.offset===ce.anchor.getNode().getTextContentSize()||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(ge.x,ge.y,Y.grid)),I(Y,O,ge.x,ge.y,"forward")):E(Y,O,ge.x,ge.y,"forward")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return ce=ce.focus.getNode(),c(ce)?(ce=O.getCordsFromCellNode(ce,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,ce.x,ce.y,"forward")):!1;return!1},e.COMMAND_PRIORITY_HIGH));let xe=de=>()=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.DEPRECATED_$isGridSelection(ce))return Y.clearText(),!0;if(e.$isRangeSelection(ce)){const ie=t.$findMatchingParent(ce.anchor.getNode(),ne=>c(ne));if(!c(ie))return!1;var ge=ce.anchor.getNode(),be=ce.focus.getNode();if(ge=O.isParentOf(ge),be=O.isParentOf(be),ge&&!be||be&&!ge)return Y.clearText(),!0;if(ge=(be=t.$findMatchingParent(ce.anchor.getNode(),ne=>e.$isElementNode(ne)))&&t.$findMatchingParent(be,ne=>e.$isElementNode(ne)&&c(ne.getParent())),!e.$isElementNode(ge)||!e.$isElementNode(be))return!1;if(de===e.DELETE_LINE_COMMAND&&ge.getPreviousSibling()===null)return!0;if((de===e.DELETE_CHARACTER_COMMAND||de===e.DELETE_WORD_COMMAND)&&ce.isCollapsed()&&ce.anchor.offset===0&&be!==ge){ce=be.getChildren();const ne=e.$createParagraphNode();return ce.forEach(fe=>ne.append(fe)),be.replace(ne),be.getWritable().__parent=ie.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(de=>{Y.listenersToRemove.add(H.registerCommand(de,xe(de),e.COMMAND_PRIORITY_CRITICAL))});let me=de=>{const ce=e.$getSelection();return L(ce,O)?e.DEPRECATED_$isGridSelection(ce)?(de.preventDefault(),de.stopPropagation(),Y.clearText(),!0):(e.$isRangeSelection(ce)&&(de=t.$findMatchingParent(ce.anchor.getNode(),ge=>c(ge)),c(de)),!1):!1};return Y.listenersToRemove.add(H.registerCommand(e.KEY_BACKSPACE_COMMAND,me,e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.KEY_DELETE_COMMAND,me,e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.FORMAT_TEXT_COMMAND,de=>{let ce=e.$getSelection();return L(ce,O)?e.DEPRECATED_$isGridSelection(ce)?(Y.formatCells(de),!0):(e.$isRangeSelection(ce)&&(de=t.$findMatchingParent(ce.anchor.getNode(),ge=>c(ge)),c(de)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var de=e.$getSelection();return L(de,O)&&(e.DEPRECATED_$isGridSelection(de)?Y.clearHighlight():e.$isRangeSelection(de)&&(de=t.$findMatchingParent(de.anchor.getNode(),ce=>c(ce)),c(de))),!1},e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.KEY_TAB_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){let ge=t.$findMatchingParent(ce.anchor.getNode(),be=>c(be));if(!c(ge))return!1;if(ce.isCollapsed())return ce=O.getCordsFromCellNode(ge,Y.grid),de.preventDefault(),E(Y,O,ce.x,ce.y,de.shiftKey?"backward":"forward"),!0}return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.FOCUS_COMMAND,()=>O.isSelected(),e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let de=e.$getSelection();var ce=e.$getPreviousSelection();if(de&&e.$isRangeSelection(de)&&!de.isCollapsed()){var ge=de.anchor.getNode(),be=de.focus.getNode();ge=O.isParentOf(ge);var ie=O.isParentOf(be);if(be=ge&&!ie||ie&&!ge,ge=ge&&ie&&!O.isSelected(),be)return ce=de.isBackward(),ge=e.$createRangeSelection(),be=O.getKey(),ge.anchor.set(de.anchor.key,de.anchor.offset,de.anchor.type),ge.focus.set(be,ce?0:O.getChildrenSize(),"element"),X=!0,e.$setSelection(ge),A(Y),!0;if(ge&&({grid:ge}=Y,de.getNodes().filter(c).length===ge.rows*ge.columns)){ge=e.DEPRECATED_$createGridSelection(),be=O.getKey(),ie=O.getFirstChildOrThrow().getFirstChild();let ne=O.getLastChildOrThrow().getLastChild();if(ie!=null&&ne!=null)return ge.set(be,ie.getKey(),ne.getKey()),e.$setSelection(ge),Y.updateTableGridSelection(ge),!0}}return de&&!de.is(ce)&&(e.DEPRECATED_$isGridSelection(de)||e.DEPRECATED_$isGridSelection(ce))&&Y.gridSelection&&!Y.gridSelection.is(ce)?(e.DEPRECATED_$isGridSelection(de)&&de.gridKey===Y.tableNodeKey?Y.updateTableGridSelection(de):!e.DEPRECATED_$isGridSelection(de)&&e.DEPRECATED_$isGridSelection(ce)&&ce.gridKey===Y.tableNodeKey&&Y.updateTableGridSelection(null),!1):(Y.hasHijackedSelectionStyles&&!O.isSelected()?(S(Y),X=!1):!Y.hasHijackedSelectionStyles&&O.isSelected()&&A(Y),!1)},e.COMMAND_PRIORITY_CRITICAL)),Y},hi.getCellFromTarget=y,hi.getTableSelectionFromTableElement=function(O){return O.__lexicalTableSelection},hi}var XH,hme;function kOt(){return hme||(hme=1,XH=$Ot()),XH}var e_=kOt(),h$={},mme;function SOt(){if(mme)return h$;mme=1;var e=SM(),t=Ad(),r=Rc(),n=Ta(),a=Tc();function l(f,x){for(let y=0;y<x.length;y++){let b=x[y](f);if(b)return b}return null}let c=/[.,;\s]/;function d(f){f=f.getPreviousSibling(),n.$isElementNode(f)&&(f=f.getLastDescendant());var x;return!(x=f===null||n.$isLineBreakNode(f))&&(x=n.$isTextNode(f))&&(f=f.getTextContent(),x=c.test(f[f.length-1])),x}function p(f){return f=f.getNextSibling(),n.$isElementNode(f)&&(f=f.getFirstDescendant()),f===null||n.$isLineBreakNode(f)||n.$isTextNode(f)&&c.test(f.getTextContent()[0])}function u(f,x,y){var b=f.getChildren();let w=b.length;for(let v=0;v<w;v++){let A=b[v];if(!n.$isTextNode(A)||!A.isSimpleText()){h(f),y(null,f.getURL());return}}b=f.getTextContent(),x=l(b,x),x===null||x.text!==b?(h(f),y(null,f.getURL())):d(f)&&p(f)?(b=f.getURL(),b!==x.url&&(f.setURL(x.url),y(x.url,b)),x.attributes&&(b=f.getRel(),b!==x.attributes.rel&&(f.setRel(x.attributes.rel||null),y(x.attributes.rel||null,b)),b=f.getTarget(),b!==x.attributes.target&&(f.setTarget(x.attributes.target||null),y(x.attributes.target||null,b)))):(h(f),y(null,f.getURL()))}function h(f){let x=f.getChildren();var y=x.length;for(--y;0<=y;y--)f.insertAfter(x[y]);return f.remove(),x.map(b=>b.getLatest())}function m(f,x,y){a.useEffect(()=>{if(!f.hasNodes([e.AutoLinkNode]))throw Error("Minified Lexical error #77; visit https://lexical.dev/docs/error?code=77 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");let b=(w,v)=>{y&&y(w,v)};return r.mergeRegister(f.registerNodeTransform(n.TextNode,w=>{var v=w.getParentOrThrow(),A=w.getPreviousSibling();if(e.$isAutoLinkNode(v))u(v,x,b);else if(!e.$isLinkNode(v)){if(w.isSimpleText()&&(c.test(w.getTextContent()[0])||!e.$isAutoLinkNode(A))){A=v=w.getTextContent();let P=0,T=w;for(var S;(S=l(A,x))&&S!==null;){let R=S.index,N=S.length,K=R+N;var E=P+R,I=P+K,L=v,B=w;if((0<E?c.test(L[E-1]):d(B))&&(I<L.length?c.test(L[I]):p(B))){var D=void 0;P+R===0?[D,T]=T.splitText(P+N):[,D,T]=T.splitText(P+R,P+R+N),E=e.$createAutoLinkNode(S.url,S.attributes),I=n.$createTextNode(S.text),I.setFormat(D.getFormat()),I.setDetail(D.getDetail()),E.append(I),D.replace(E),y&&y(S.url,null),P=0}else P+=K;A=A.substring(K)}}v=w.getPreviousSibling(),S=w.getNextSibling(),D=w.getTextContent(),e.$isAutoLinkNode(v)&&!c.test(D[0])&&(v.append(w),u(v,x,b),w=v.getURL(),y&&y(null,w)),e.$isAutoLinkNode(S)&&!c.test(D[D.length-1])&&(h(S),u(S,x,b),w=S.getURL(),y&&y(null,w))}}))},[f,x,y])}return h$.AutoLinkPlugin=function({matchers:f,onChange:x}){let[y]=t.useLexicalComposerContext();return m(y,f,x),null},h$.createLinkMatcherWithRegExp=function(f,x=y=>y){return y=>{let b=f.exec(y);return b===null?null:{index:b.index,length:b[0].length,text:b[0],url:x(y)}}},h$}var t_,gme;function EOt(){return gme||(gme=1,t_=SOt()),t_}var LOt=EOt(),lw={};lw.d=(e,t)=>{for(var r in t)lw.o(t,r)&&!lw.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})};lw.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var dr=globalThis.pdfjsLib={};lw.d(dr,{AbortException:()=>p5,AnnotationEditorLayer:()=>P0,AnnotationEditorParamsType:()=>gr,AnnotationEditorType:()=>ai,AnnotationEditorUIManager:()=>yg,AnnotationLayer:()=>SHt,AnnotationMode:()=>Fm,CMapCompressionType:()=>kY,ColorPicker:()=>Qu,DOMSVGFactory:()=>$X,DrawLayer:()=>nl,FeatureTest:()=>vc,GlobalWorkerOptions:()=>ov,ImageKind:()=>iE,InvalidPDFException:()=>Gze,MissingPDFException:()=>d5,OPS:()=>X1,Outliner:()=>DY,PDFDataRangeTransport:()=>dRe,PDFDateString:()=>Xze,PDFWorker:()=>Qd,PasswordResponses:()=>BOt,PermissionFlag:()=>MOt,PixelsPerInch:()=>U8,RenderingCancelledException:()=>kX,TextLayer:()=>BL,UnexpectedResponseException:()=>jM,Util:()=>jo,VerbosityLevel:()=>EM,XfaLayer:()=>uRe,build:()=>aHt,createValidAbsoluteUrl:()=>zOt,fetchData:()=>zM,getDocument:()=>ZNt,getFilenameFromUrl:()=>WOt,getPdfFilenameFromUrl:()=>GOt,getXfaPageViewport:()=>YOt,isDataScheme:()=>SX,isPdfFile:()=>EX,noContextMenu:()=>Ec,normalizeUnicode:()=>_Ot,renderTextLayer:()=>_Nt,setLayerDimensions:()=>H4,shadow:()=>mi,updateTextLayer:()=>VNt,version:()=>nHt});const ul=typeof R0=="object"&&R0+""=="[object process]"&&!R0.versions.nw&&!(R0.versions.electron&&R0.type&&R0.type!=="browser"),Wze=[1,0,0,1,0,0],$Y=[.001,0,0,.001,0,0],IOt=1e7,o_=1.35,Nd={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},Fm={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},jOt="pdfjs_internal_editor_",ai={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},gr={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},MOt={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},il={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},iE={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ha={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,WIDGET:20},py={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},EM={ERRORS:0,WARNINGS:1,INFOS:5},kY={NONE:0,BINARY:1},X1={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},BOt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let LM=EM.WARNINGS;function DOt(e){Number.isInteger(e)&&(LM=e)}function POt(){return LM}function IM(e){LM>=EM.INFOS&&console.log(`Info: ${e}`)}function Nr(e){LM>=EM.WARNINGS&&console.log(`Warning: ${e}`)}function Gi(e){throw new Error(e)}function Wa(e,t){e||Gi(t)}function TOt(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function zOt(e,t=null,r=null){if(!e)return null;try{if(r&&typeof e=="string"&&(r.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),r.tryConvertEncoding))try{e=HOt(e)}catch{}const n=t?new URL(e,t):new URL(e);if(TOt(n))return n}catch{}return null}function mi(e,t,r,n=!1){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const Pg=(function(){function t(r,n){this.constructor===t&&Gi("Cannot initialize BaseException."),this.message=r,this.name=n}return t.prototype=new Error,t.constructor=t,t})();class SY extends Pg{constructor(t,r){super(t,"PasswordException"),this.code=r}}class EY extends Pg{constructor(t,r){super(t,"UnknownErrorException"),this.details=r}}class Gze extends Pg{constructor(t){super(t,"InvalidPDFException")}}class d5 extends Pg{constructor(t){super(t,"MissingPDFException")}}class jM extends Pg{constructor(t,r){super(t,"UnexpectedResponseException"),this.status=r}}class ROt extends Pg{constructor(t){super(t,"FormatError")}}class p5 extends Pg{constructor(t){super(t,"AbortException")}}function Yze(e){(typeof e!="object"||e?.length===void 0)&&Gi("Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const n=[];for(let a=0;a<t;a+=r){const l=Math.min(a+r,t),c=e.subarray(a,l);n.push(String.fromCharCode.apply(null,c))}return n.join("")}function MM(e){typeof e!="string"&&Gi("Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let n=0;n<t;++n)r[n]=e.charCodeAt(n)&255;return r}function FOt(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function CX(e){const t=Object.create(null);for(const[r,n]of e)t[r]=n;return t}function OOt(){const e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}function NOt(){try{return new Function(""),!0}catch{return!1}}class vc{static get isLittleEndian(){return mi(this,"isLittleEndian",OOt())}static get isEvalSupported(){return mi(this,"isEvalSupported",NOt())}static get isOffscreenCanvasSupported(){return mi(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?mi(this,"platform",{isMac:navigator.platform.includes("Mac")}):mi(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return mi(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const r_=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class jo{static makeHexColor(t,r,n){return`#${r_[t]}${r_[r]}${r_[n]}`}static scaleMinMax(t,r){let n;t[0]?(t[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[0],r[2]*=t[0],t[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[3],r[3]*=t[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,t[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[1],r[3]*=t[1],t[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[2],r[2]*=t[2]),r[0]+=t[4],r[1]+=t[5],r[2]+=t[4],r[3]+=t[5]}static transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}static applyTransform(t,r){const n=t[0]*r[0]+t[1]*r[2]+r[4],a=t[0]*r[1]+t[1]*r[3]+r[5];return[n,a]}static applyInverseTransform(t,r){const n=r[0]*r[3]-r[1]*r[2],a=(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/n,l=(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/n;return[a,l]}static getAxialAlignedBoundingBox(t,r){const n=this.applyTransform(t,r),a=this.applyTransform(t.slice(2,4),r),l=this.applyTransform([t[0],t[3]],r),c=this.applyTransform([t[2],t[1]],r);return[Math.min(n[0],a[0],l[0],c[0]),Math.min(n[1],a[1],l[1],c[1]),Math.max(n[0],a[0],l[0],c[0]),Math.max(n[1],a[1],l[1],c[1])]}static inverseTransform(t){const r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}static singularValueDecompose2dScale(t){const r=[t[0],t[2],t[1],t[3]],n=t[0]*r[0]+t[1]*r[2],a=t[0]*r[1]+t[1]*r[3],l=t[2]*r[0]+t[3]*r[2],c=t[2]*r[1]+t[3]*r[3],d=(n+c)/2,p=Math.sqrt((n+c)**2-4*(n*c-l*a))/2,u=d+p||1,h=d-p||1;return[Math.sqrt(u),Math.sqrt(h)]}static normalizeRect(t){const r=t.slice(0);return t[0]>t[2]&&(r[0]=t[2],r[2]=t[0]),t[1]>t[3]&&(r[1]=t[3],r[3]=t[1]),r}static intersect(t,r){const n=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),a=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(n>a)return null;const l=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),c=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return l>c?null:[n,l,a,c]}static#e(t,r,n,a,l,c,d,p,u,h){if(u<=0||u>=1)return;const m=1-u,f=u*u,x=f*u,y=m*(m*(m*t+3*u*r)+3*f*n)+x*a,b=m*(m*(m*l+3*u*c)+3*f*d)+x*p;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)}static#t(t,r,n,a,l,c,d,p,u,h,m,f){if(Math.abs(u)<1e-12){Math.abs(h)>=1e-12&&this.#e(t,r,n,a,l,c,d,p,-m/h,f);return}const x=h**2-4*m*u;if(x<0)return;const y=Math.sqrt(x),b=2*u;this.#e(t,r,n,a,l,c,d,p,(-h+y)/b,f),this.#e(t,r,n,a,l,c,d,p,(-h-y)/b,f)}static bezierBoundingBox(t,r,n,a,l,c,d,p,u){return u?(u[0]=Math.min(u[0],t,d),u[1]=Math.min(u[1],r,p),u[2]=Math.max(u[2],t,d),u[3]=Math.max(u[3],r,p)):u=[Math.min(t,d),Math.min(r,p),Math.max(t,d),Math.max(r,p)],this.#t(t,n,l,d,r,a,c,p,3*(-t+3*(n-l)+d),6*(t-2*n+l),3*(n-t),u),this.#t(t,n,l,d,r,a,c,p,3*(-r+3*(a-c)+p),6*(r-2*a+c),3*(a-r),u),u}}function HOt(e){return decodeURIComponent(escape(e))}let i_=null,fme=null;function _Ot(e){return i_||(i_=/([\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,fme=new Map([["ſt","ſt"]])),e.replaceAll(i_,(t,r,n)=>r?r.normalize("NFKC"):fme.get(n))}function VOt(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(Math.random()*255);return Yze(e)}const Kze="pdfjs_internal_id_",C0={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};class BM{constructor(){this.constructor===BM&&Gi("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,r){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,r,n,a,l){return"none"}destroy(t=!1){}}class DM{#e=!1;constructor({enableHWA:t=!1}={}){this.constructor===DM&&Gi("Cannot initialize BaseCanvasFactory."),this.#e=t}create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(t,r);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#e})}}reset(t,r,n){if(!t.canvas)throw new Error("Canvas is not specified");if(r<=0||n<=0)throw new Error("Invalid canvas size");t.canvas.width=r,t.canvas.height=n}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,r){Gi("Abstract method `_createCanvas` called.")}}class PM{constructor({baseUrl:t=null,isCompressed:r=!0}){this.constructor===PM&&Gi("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=r}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const r=this.baseUrl+t+(this.isCompressed?".bcmap":""),n=this.isCompressed?kY.BINARY:kY.NONE;return this._fetchData(r,n).catch(a=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${r}`)})}_fetchData(t,r){Gi("Abstract method `_fetchData` called.")}}class TM{constructor({baseUrl:t=null}){this.constructor===TM&&Gi("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const r=`${this.baseUrl}${t}`;return this._fetchData(r).catch(n=>{throw new Error(`Unable to load font data at: ${r}`)})}_fetchData(t){Gi("Abstract method `_fetchData` called.")}}class AX{constructor(){this.constructor===AX&&Gi("Cannot initialize BaseSVGFactory.")}create(t,r,n=!1){if(t<=0||r<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),n||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${r}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${r}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Gi("Abstract method `_createSVG` called.")}}const I0="http://www.w3.org/2000/svg";class U8{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class UOt extends BM{#e;#t;#o;#i;#s;#r=0;constructor({docId:t,ownerDocument:r=globalThis.document}={}){super(),this.#o=t,this.#i=r}get#n(){return this.#e||=new Map}get#l(){return this.#s||=new Map}get#d(){if(!this.#t){const t=this.#i.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=this.#i.createElementNS(I0,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#t=this.#i.createElementNS(I0,"defs"),t.append(n),n.append(this.#t),this.#i.body.append(t)}return this.#t}#p(t){if(t.length===1){const p=t[0],u=new Array(256);for(let m=0;m<256;m++)u[m]=p[m]/255;const h=u.join(",");return[h,h,h]}const[r,n,a]=t,l=new Array(256),c=new Array(256),d=new Array(256);for(let p=0;p<256;p++)l[p]=r[p]/255,c[p]=n[p]/255,d[p]=a[p]/255;return[l.join(","),c.join(","),d.join(",")]}addFilter(t){if(!t)return"none";let r=this.#n.get(t);if(r)return r;const[n,a,l]=this.#p(t),c=t.length===1?n:`${n}${a}${l}`;if(r=this.#n.get(c),r)return this.#n.set(t,r),r;const d=`g_${this.#o}_transfer_map_${this.#r++}`,p=`url(#${d})`;this.#n.set(t,p),this.#n.set(c,p);const u=this.#a(d);return this.#f(n,a,l,u),p}addHCMFilter(t,r){const n=`${t}-${r}`,a="base";let l=this.#l.get(a);if(l?.key===n||(l?(l.filter?.remove(),l.key=n,l.url="none",l.filter=null):(l={key:n,url:"none",filter:null},this.#l.set(a,l)),!t||!r))return l.url;const c=this.#y(t);t=jo.makeHexColor(...c);const d=this.#y(r);if(r=jo.makeHexColor(...d),this.#d.style.color="",t==="#000000"&&r==="#ffffff"||t===r)return l.url;const p=new Array(256);for(let x=0;x<=255;x++){const y=x/255;p[x]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const u=p.join(","),h=`g_${this.#o}_hcm_filter`,m=l.filter=this.#a(h);this.#f(u,u,u,m),this.#c(m);const f=(x,y)=>{const b=c[x]/255,w=d[x]/255,v=new Array(y+1);for(let A=0;A<=y;A++)v[A]=b+A/y*(w-b);return v.join(",")};return this.#f(f(0,5),f(1,5),f(2,5),m),l.url=`url(#${h})`,l.url}addAlphaFilter(t){let r=this.#n.get(t);if(r)return r;const[n]=this.#p([t]),a=`alpha_${n}`;if(r=this.#n.get(a),r)return this.#n.set(t,r),r;const l=`g_${this.#o}_alpha_map_${this.#r++}`,c=`url(#${l})`;this.#n.set(t,c),this.#n.set(a,c);const d=this.#a(l);return this.#u(n,d),c}addLuminosityFilter(t){let r=this.#n.get(t||"luminosity");if(r)return r;let n,a;if(t?([n]=this.#p([t]),a=`luminosity_${n}`):a="luminosity",r=this.#n.get(a),r)return this.#n.set(t,r),r;const l=`g_${this.#o}_luminosity_map_${this.#r++}`,c=`url(#${l})`;this.#n.set(t,c),this.#n.set(a,c);const d=this.#a(l);return this.#h(d),t&&this.#u(n,d),c}addHighlightHCMFilter(t,r,n,a,l){const c=`${r}-${n}-${a}-${l}`;let d=this.#l.get(t);if(d?.key===c||(d?(d.filter?.remove(),d.key=c,d.url="none",d.filter=null):(d={key:c,url:"none",filter:null},this.#l.set(t,d)),!r||!n))return d.url;const[p,u]=[r,n].map(this.#y.bind(this));let h=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),m=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[f,x]=[a,l].map(this.#y.bind(this));m<h&&([h,m,f,x]=[m,h,x,f]),this.#d.style.color="";const y=(v,A,S)=>{const E=new Array(256),I=(m-h)/S,L=v/255,B=(A-v)/(255*S);let D=0;for(let P=0;P<=S;P++){const T=Math.round(h+P*I),R=L+P*B;for(let N=D;N<=T;N++)E[N]=R;D=T+1}for(let P=D;P<256;P++)E[P]=E[D-1];return E.join(",")},b=`g_${this.#o}_hcm_${t}_filter`,w=d.filter=this.#a(b);return this.#c(w),this.#f(y(f[0],x[0],5),y(f[1],x[1],5),y(f[2],x[2],5),w),d.url=`url(#${b})`,d.url}destroy(t=!1){t&&this.#l.size!==0||(this.#t&&(this.#t.parentNode.parentNode.remove(),this.#t=null),this.#e&&(this.#e.clear(),this.#e=null),this.#r=0)}#h(t){const r=this.#i.createElementNS(I0,"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)}#c(t){const r=this.#i.createElementNS(I0,"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)}#a(t){const r=this.#i.createElementNS(I0,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),this.#d.append(r),r}#m(t,r,n){const a=this.#i.createElementNS(I0,r);a.setAttribute("type","discrete"),a.setAttribute("tableValues",n),t.append(a)}#f(t,r,n,a){const l=this.#i.createElementNS(I0,"feComponentTransfer");a.append(l),this.#m(l,"feFuncR",t),this.#m(l,"feFuncG",r),this.#m(l,"feFuncB",n)}#u(t,r){const n=this.#i.createElementNS(I0,"feComponentTransfer");r.append(n),this.#m(n,"feFuncA",t)}#y(t){return this.#d.style.color=t,LX(getComputedStyle(this.#d).getPropertyValue("color"))}}class QOt extends DM{constructor({ownerDocument:t=globalThis.document,enableHWA:r=!1}={}){super({enableHWA:r}),this._document=t}_createCanvas(t,r){const n=this._document.createElement("canvas");return n.width=t,n.height=r,n}}async function zM(e,t="text"){if(bb(e,document.baseURI)){const r=await fetch(e);if(!r.ok)throw new Error(r.statusText);switch(t){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"json":return r.json()}return r.text()}return new Promise((r,n)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType=t,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(a.status===200||a.status===0){switch(t){case"arraybuffer":case"blob":case"json":r(a.response);return}r(a.responseText);return}n(new Error(a.statusText))}},a.send(null)})}class qze extends PM{_fetchData(t,r){return zM(t,this.isCompressed?"arraybuffer":"text").then(n=>({cMapData:n instanceof ArrayBuffer?new Uint8Array(n):MM(n),compressionType:r}))}}class Zze extends TM{_fetchData(t){return zM(t,"arraybuffer").then(r=>new Uint8Array(r))}}class $X extends AX{_createSVG(t){return document.createElementNS(I0,t)}}class hC{constructor({viewBox:t,scale:r,rotation:n,offsetX:a=0,offsetY:l=0,dontFlip:c=!1}){this.viewBox=t,this.scale=r,this.rotation=n,this.offsetX=a,this.offsetY=l;const d=(t[2]+t[0])/2,p=(t[3]+t[1])/2;let u,h,m,f;switch(n%=360,n<0&&(n+=360),n){case 180:u=-1,h=0,m=0,f=1;break;case 90:u=0,h=1,m=1,f=0;break;case 270:u=0,h=-1,m=-1,f=0;break;case 0:u=1,h=0,m=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}c&&(m=-m,f=-f);let x,y,b,w;u===0?(x=Math.abs(p-t[1])*r+a,y=Math.abs(d-t[0])*r+l,b=(t[3]-t[1])*r,w=(t[2]-t[0])*r):(x=Math.abs(d-t[0])*r+a,y=Math.abs(p-t[1])*r+l,b=(t[2]-t[0])*r,w=(t[3]-t[1])*r),this.transform=[u*r,h*r,m*r,f*r,x-u*r*d-m*r*p,y-h*r*d-f*r*p],this.width=b,this.height=w}get rawDims(){const{viewBox:t}=this;return mi(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:r=this.rotation,offsetX:n=this.offsetX,offsetY:a=this.offsetY,dontFlip:l=!1}={}){return new hC({viewBox:this.viewBox.slice(),scale:t,rotation:r,offsetX:n,offsetY:a,dontFlip:l})}convertToViewportPoint(t,r){return jo.applyTransform([t,r],this.transform)}convertToViewportRectangle(t){const r=jo.applyTransform([t[0],t[1]],this.transform),n=jo.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],n[0],n[1]]}convertToPdfPoint(t,r){return jo.applyInverseTransform([t,r],this.transform)}}class kX extends Pg{constructor(t,r=0){super(t,"RenderingCancelledException"),this.extraDelay=r}}function SX(e){const t=e.length;let r=0;for(;r<t&&e[r].trim()==="";)r++;return e.substring(r,r+5).toLowerCase()==="data:"}function EX(e){return typeof e=="string"&&/\.pdf$/i.test(e)}function WOt(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function GOt(e,t="document.pdf"){if(typeof e!="string")return t;if(SX(e))return Nr('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=r.exec(e);let l=n.exec(a[1])||n.exec(a[2])||n.exec(a[3]);if(l&&(l=l[0],l.includes("%")))try{l=n.exec(decodeURIComponent(l))[0]}catch{}return l||t}class xme{started=Object.create(null);times=[];time(t){t in this.started&&Nr(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Nr(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let r=0;for(const{name:n}of this.times)r=Math.max(n.length,r);for(const{name:n,start:a,end:l}of this.times)t.push(`${n.padEnd(r)} ${l-a}ms
246
- `);return t.join("")}}function bb(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return r==="http:"||r==="https:"}catch{return!1}}function Ec(e){e.preventDefault()}function Jze(e){console.log("Deprecated API usage: "+e)}let yme;class Xze{static toDateObject(t){if(!t||typeof t!="string")return null;yme||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=yme.exec(t);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(r[3],10);l=l>=1&&l<=31?l:1;let c=parseInt(r[4],10);c=c>=0&&c<=23?c:0;let d=parseInt(r[5],10);d=d>=0&&d<=59?d:0;let p=parseInt(r[6],10);p=p>=0&&p<=59?p:0;const u=r[7]||"Z";let h=parseInt(r[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(r[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(c+=h,d+=m):u==="+"&&(c-=h,d-=m),new Date(Date.UTC(n,a,l,c,d,p))}}function YOt(e,{scale:t=1,rotation:r=0}){const{width:n,height:a}=e.attributes.style,l=[0,0,parseInt(n),parseInt(a)];return new hC({viewBox:l,scale:t,rotation:r})}function LX(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(t=>parseInt(t)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Nr(`Not a valid color format: "${e}"`),[0,0,0])}function KOt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const r of e.keys()){t.style.color=r;const n=window.getComputedStyle(t).color;e.set(r,LX(n))}t.remove()}function Dn(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform();return[t,r,n,a,l,c]}function A0(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform().invertSelf();return[t,r,n,a,l,c]}function H4(e,t,r=!1,n=!0){if(t instanceof hC){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:c}=e,d=vc.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=d?`round(${p}, 1px)`:`calc(${p})`,m=d?`round(${u}, 1px)`:`calc(${u})`;!r||t.rotation%180===0?(c.width=h,c.height=m):(c.width=m,c.height=h)}n&&e.setAttribute("data-main-rotation",t.rotation)}class IX{#e=null;#t=null;#o;#i=null;constructor(t){this.#o=t}render(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const r=this.#o._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:r}),t.addEventListener("pointerdown",IX.#s,{signal:r});const n=this.#i=document.createElement("div");n.className="buttons",t.append(n);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,c=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*c}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),t}static#s(t){t.stopPropagation()}#r(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#n(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#l(t){const r=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:r}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:r}),t.addEventListener("contextmenu",Ec,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#d(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#o.editorType}-button`),this.#l(t),t.addEventListener("click",r=>{this.#o._uiManager.delete()},{signal:this.#o._uiManager._signal}),this.#i.append(t)}get#p(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#l(t),this.#i.prepend(t,this.#p)}addColorPicker(t){this.#t=t;const r=t.renderButton();this.#l(r),this.#i.prepend(r,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class qOt{#e=null;#t=null;#o;constructor(t){this.#o=t}#i(){const t=this.#t=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Ec,{signal:this.#o._signal});const r=this.#e=document.createElement("div");return r.className="buttons",t.append(r),this.#r(),t}#s(t,r){let n=0,a=0;for(const l of t){const c=l.y+l.height;if(c<n)continue;const d=l.x+(r?l.width:0);if(c>n){a=d,n=c;continue}r?d>a&&(a=d):d<a&&(a=d)}return[r?1-a:a,n]}show(t,r,n){const[a,l]=this.#s(r,n),{style:c}=this.#t||=this.#i();t.append(this.#t),c.insetInlineEnd=`${100*a}%`,c.top=`calc(${100*l}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const r=document.createElement("span");t.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=this.#o._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:n}),this.#e.append(t)}}function jL(e,t,r){for(const n of r)t.addEventListener(n,e[n].bind(e))}function ZOt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class JOt{#e=0;get id(){return`${jOt}${this.#e++}`}}class jX{#e=VOt();#t=0;#o=null;static get _isSVGFittingCanvas(){const t='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>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=t;const l=a.decode().then(()=>(n.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return mi(this,"_isSVGFittingCanvas",l)}async#i(t,r){this.#o||=new Map;let n=this.#o.get(t);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof r=="string"?(n.url=r,a=await zM(r,"blob")):a=n.file=r,a.type==="image/svg+xml"){const l=jX._isSVGFittingCanvas,c=new FileReader,d=new Image,p=new Promise((u,h)=>{d.onload=()=>{n.bitmap=d,n.isSvg=!0,u()},c.onload=async()=>{const m=n.svgUrl=c.result;d.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},d.onerror=c.onerror=h});c.readAsDataURL(a),await p}else n.bitmap=await createImageBitmap(a);n.refCounter=1}catch(a){console.error(a),n=null}return this.#o.set(t,n),n&&this.#o.set(n.id,n),n}async getFromFile(t){const{lastModified:r,name:n,size:a,type:l}=t;return this.#i(`${r}_${n}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const r=this.#o.get(t);return r?r.bitmap?(r.refCounter+=1,r):r.file?this.getFromFile(r.file):this.getFromUrl(r.url):null}getSvgUrl(t){const r=this.#o.get(t);return r?.isSvg?r.svgUrl:null}deleteId(t){this.#o||=new Map;const r=this.#o.get(t);r&&(r.refCounter-=1,r.refCounter===0&&(r.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class XOt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:r,post:n,mustExec:a,type:l=NaN,overwriteIfSameType:c=!1,keepUndo:d=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:r,post:n,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(c&&this.#e[this.#i].type===l){d&&(p.undo=this.#e[this.#i].undo),this.#e[this.#i]=p;return}const u=this.#i+1;u===this.#o?this.#e.splice(0,1):(this.#i=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(p)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:t,post:r}=this.#e[this.#i];t(),r?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:r}=this.#e[this.#i];t(),r?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class mC{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:r}=vc.platform;for(const[n,a,l={}]of t)for(const c of n){const d=c.startsWith("mac+");r&&d?(this.callbacks.set(c.slice(4),{callback:a,options:l}),this.allKeys.add(c.split("+").at(-1))):!r&&!d&&(this.callbacks.set(c,{callback:a,options:l}),this.allKeys.add(c.split("+").at(-1)))}}#e(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const r=this.buffer.join("+");return this.buffer.length=0,r}exec(t,r){if(!this.allKeys.has(r.key))return;const n=this.callbacks.get(this.#e(r));if(!n)return;const{callback:a,options:{bubbles:l=!1,args:c=[],checker:d=null}}=n;d&&!d(t,r)||(a.bind(t,...c,r)(),l||(r.stopPropagation(),r.preventDefault()))}}class MX{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return KOt(t),mi(this,"_colors",t)}convert(t){const r=LX(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(const[n,a]of this._colors)if(a.every((l,c)=>l===r[c]))return MX._colorsMapping.get(n);return r}getHexCode(t){const r=this._colors.get(t);return r?jo.makeHexColor(...r):t}}class yg{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new XOt;#d=0;#p=new Set;#h=null;#c=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#b=null;#v=new JOt;#A=!1;#k=!1;#S=null;#j=null;#$=null;#w=ai.NONE;#x=new Set;#C=null;#E=null;#L=null;#B=this.blur.bind(this);#M=this.focus.bind(this);#T=this.copy.bind(this);#D=this.cut.bind(this);#z=this.paste.bind(this);#P=this.keydown.bind(this);#U=this.keyup.bind(this);#Q=this.onEditingAction.bind(this);#_=this.onPageChanging.bind(this);#N=this.onScaleChanging.bind(this);#R=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#V=[0,0];#F=null;#H=null;#q=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=yg.prototype,r=c=>c.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&c.hasSomethingToControl(),n=(c,{target:d})=>{if(d instanceof HTMLInputElement){const{type:p}=d;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return mi(this,"_keyboardManager",new mC([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],t.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:n}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(d)&&!c.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:r}]]))}constructor(t,r,n,a,l,c,d,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=r,this.#s=n,this._eventBus=a,this._eventBus._on("editingaction",this.#Q),this._eventBus._on("pagechanging",this.#_),this._eventBus._on("scalechanging",this.#N),this._eventBus._on("rotationchanging",this.#R),this.#ie(),this.#le(),this.#Z(),this.#r=l.annotationStorage,this.#f=l.filterFactory,this.#E=c,this.#y=d||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:U8.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#e?.abort(),this.#e=null,this._signal=null,this._eventBus._off("editingaction",this.#Q),this._eventBus._off("pagechanging",this.#_),this._eventBus._off("scalechanging",this.#N),this._eventBus._off("rotationchanging",this.#R);for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#t=null,this.#x.clear(),this.#l.destroy(),this.#s?.destroy(),this.#b?.hide(),this.#b=null,this.#u&&(clearTimeout(this.#u),this.#u=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}async mlGuess(t){return this.#$?.guess(t)||null}get hasMLManager(){return!!this.#$}get hcmFilter(){return mi(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return mi(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return mi(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(r=>r.trim()))):null)}get highlightColorNames(){return mi(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#j=t}editAltText(t){this.#s?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#d=t-1}focusMainContainer(){this.#H.focus()}findParent(t,r){for(const n of this.#i.values()){const{x:a,y:l,width:c,height:d}=n.div.getBoundingClientRect();if(t>=a&&t<=a+c&&r>=l&&r<=l+d)return n}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#a.add(t)}removeShouldRescale(t){this.#a.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*U8.PDF_TO_CSS_UNITS;for(const r of this.#a)r.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#G({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:n,anchorOffset:a,focusNode:l,focusOffset:c}=r,d=r.toString(),u=this.#G(r).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){r.empty(),this.#w===ai.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:ai.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#i.values())if(m.hasTextLayer(u)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:n,anchorOffset:a,focusNode:l,focusOffset:c,text:d});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const n=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(n);a&&(this.#b||=new qOt(this),this.#b.show(n,a,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}#re(){const t=document.getSelection();if(!t||t.isCollapsed){this.#C&&(this.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}const{anchorNode:r}=t;if(r===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}if(this.#b?.hide(),this.#C=r,this.#I({hasSelectedText:!0}),!(this.#w!==ai.HIGHLIGHT&&this.#w!==ai.NONE)&&(this.#w===ai.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,c=d=>{d.type==="pointerup"&&d.button!==0||(window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),d.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}}#Y(t=""){this.#w===ai.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#oe()}#ie(){document.addEventListener("selectionchange",this.#re.bind(this),{signal:this._signal})}#ne(){const t=this._signal;window.addEventListener("focus",this.#M,{signal:t}),window.addEventListener("blur",this.#B,{signal:t})}#ae(){window.removeEventListener("focus",this.#M),window.removeEventListener("blur",this.#B)}blur(){if(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const r of this.#x)if(r.div.contains(t)){this.#S=[r,t],r._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,r]=this.#S;this.#S=null,r.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.focus()}#Z(){const t=this._signal;window.addEventListener("keydown",this.#P,{signal:t}),window.addEventListener("keyup",this.#U,{signal:t})}#se(){window.removeEventListener("keydown",this.#P),window.removeEventListener("keyup",this.#U)}#J(){const t=this._signal;document.addEventListener("copy",this.#T,{signal:t}),document.addEventListener("cut",this.#D,{signal:t}),document.addEventListener("paste",this.#z,{signal:t})}#X(){document.removeEventListener("copy",this.#T),document.removeEventListener("cut",this.#D),document.removeEventListener("paste",this.#z)}#le(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#se(),this.#X()}dragOver(t){for(const{type:r}of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const r of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const r=[];for(const n of this.#x){const a=n.serialize(!0);a&&r.push(a)}r.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:r}=t;for(const l of r.items)for(const c of this.#c)if(c.isHandlingMimeForPasting(l.type)){c.paste(l,this.currentLayer);return}let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(l){Nr(`paste: "${l.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of n){const u=a.deserialize(p);if(!u)return;l.push(u)}const c=()=>{for(const p of l)this.#ee(p);this.#te(l)},d=()=>{for(const p of l)p.remove()};this.addCommands({cmd:c,undo:d,mustExec:!0})}catch(l){Nr(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#w!==ai.NONE&&!this.isEditorHandlingKeyboard&&yg._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#I(t){Object.entries(t).some(([n,a])=>this.#K[n]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#w===ai.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[gr.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#I({isEditing:this.#w!==ai.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ae(),this.#X(),this.#I({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const r of this.#c)this.#O(r.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#d)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#d}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,r=null,n=!1){if(this.#w!==t){if(this.#w=t,t===ai.NONE){this.setEditingState(!1),this.#de();return}this.setEditingState(!0),this.#ce(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!r&&n){this.addNewEditorFromKeyboard();return}if(r){for(const a of this.#o.values())if(a.annotationElementId===r){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#w&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,r){if(this.#c){switch(t){case gr.CREATE:this.currentLayer.addNewEditor();return;case gr.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(r);break;case gr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,r),this.showAllEditors("highlight",r);break}for(const n of this.#x)n.updateParams(t,r);for(const n of this.#c)n.updateDefaultParams(t,r)}}showAllEditors(t,r,n=!1){for(const l of this.#o.values())l.editorType===t&&l.show(r);(this.#L?.get(gr.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#O([[gr.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const r of this.#i.values())t?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",t)}}#ce(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#de(){if(this.unselectAll(),this.#A){this.#A=!1;for(const t of this.#i.values())t.disable();for(const t of this.#o.values())t.disable()}}getEditors(t){const r=[];for(const n of this.#o.values())n.pageIndex===t&&r.push(n);return r}getEditor(t){return this.#o.get(t)}addEditor(t){this.#o.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{this.focusMainContainer(),this.#u=null},0)),this.#o.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#r?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#ee(t){const r=this.#i.get(t.pageIndex);r?r.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#O(t.propertiesToUpdate))}get#pe(){let t=null;for(t of this.#x);return t}updateUI(t){this.#pe===t&&this.#O(t.propertiesToUpdate)}toggleSelected(t){if(this.#x.has(t)){this.#x.delete(t),t.unselect(),this.#I({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}setSelected(t){for(const r of this.#x)r!==t&&r.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}isSelected(t){return this.#x.has(t)}get firstSelectedEditor(){return this.#x.values().next().value}unselect(t){t.unselect(),this.#x.delete(t),this.#I({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#x.size!==0}get isEnterHandled(){return this.#x.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#I({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#l.redo(),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(t){this.#l.add(t),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#W()})}#W(){if(this.#o.size===0)return!0;if(this.#o.size===1)for(const t of this.#o.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#x],r=()=>{for(const a of t)a.remove()},n=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:r,undo:n,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const r of this.#x)r.unselect();this.#x.clear();for(const r of t)r.isEmpty()||(this.#x.add(r),r.select());this.#I({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#x)t.commit();this.#te(this.#o.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#w!==ai.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(t,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=r;const[a,l]=this.#V,c=[...this.#x],d=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#V[0]=this.#V[1]=0,this.addCommands({cmd:()=>{for(const p of c)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of c)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},d);for(const p of c)p.translateInPage(t,r)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(const t of this.#x)this.#h.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);const t=this.#h;this.#h=null;let r=!1;for(const[{x:a,y:l,pageIndex:c},d]of t)d.newX=a,d.newY=l,d.newPageIndex=c,r||=a!==d.savedX||l!==d.savedY||c!==d.savedPageIndex;if(!r)return!1;const n=(a,l,c,d)=>{if(this.#o.has(a.id)){const p=this.#i.get(d);p?a._setParentAndPosition(p,l,c):(a.pageIndex=d,a.x=l,a.y=c)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:c,newPageIndex:d}]of t)n(a,l,c,d)},undo:()=>{for(const[a,{savedX:l,savedY:c,savedPageIndex:d}]of t)n(a,l,c,d)},mustExec:!0}),!0}dragSelectedEditors(t,r){if(this.#h)for(const n of this.#h.keys())n.drag(t,r)}rebuild(t){if(t.parent===null){const r=this.getLayer(t.pageIndex);r?(r.changeParent(t),r.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#w}get imageManager(){return mi(this,"imageManager",new jX)}getSelectionBoxes(t){if(!t)return null;const r=document.getSelection();for(let u=0,h=r.rangeCount;u<h;u++)if(!t.contains(r.getRangeAt(u).commonAncestorContainer))return null;const{x:n,y:a,width:l,height:c}=t.getBoundingClientRect();let d;switch(t.getAttribute("data-main-rotation")){case"90":d=(u,h,m,f)=>({x:(h-a)/c,y:1-(u+m-n)/l,width:f/c,height:m/l});break;case"180":d=(u,h,m,f)=>({x:1-(u+m-n)/l,y:1-(h+f-a)/c,width:m/l,height:f/c});break;case"270":d=(u,h,m,f)=>({x:1-(h+f-a)/c,y:(u-n)/l,width:f/c,height:m/l});break;default:d=(u,h,m,f)=>({x:(u-n)/l,y:(h-a)/c,width:m/l,height:f/c});break}const p=[];for(let u=0,h=r.rangeCount;u<h;u++){const m=r.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:b}of m.getClientRects())y===0||b===0||p.push(d(f,x,y,b))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:r}){(this.#n||=new Map).set(t,r)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const r=this.#n?.get(t.data.id);if(!r)return;const n=this.#r.getRawValue(r);n&&(this.#w===ai.NONE&&!n.hasBeenModified||n.renderAnnotationElement(t))}}class p4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){p4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const r=await p4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=r,t.setAttribute("aria-label",r),t.tabIndex="0";const n=this.#n._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:n});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:n}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:n}),await this.#l(),t}finish(){this.#o&&(this.#o.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:r}){this.#e===t&&this.#t===r||(this.#e=t,this.#t=r,this.#l())}toggle(t=!1){this.#o&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o.disabled=!t)}destroy(){this.#o?.remove(),this.#o=null,this.#i=null}async#l(){const t=this.#o;if(!t)return;if(!this.#e&&!this.#t){t.classList.remove("done"),this.#i?.remove();return}t.classList.add("done"),p4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let r=this.#i;if(!r){this.#i=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip");const a=r.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,c=this.#n._uiManager._signal;c.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#i.classList.add("show"),this.#n._reportTelemetry({action:"alt_text_tooltip"})},l)},{signal:c}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:c})}r.innerText=this.#t?await p4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,r.parentNode||t.append(r),this.#n.getImageForAltText()?.setAttribute("aria-describedby",r.id)}}class ur{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#d=this.focusout.bind(this);#p=null;#h="";#c=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#b=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=ur._zIndex++;static _borderLineWidth=-1;static _colorManager=new MX;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=ur.prototype._resizeWithKeyboard,r=yg.TRANSLATE_SMALL,n=yg.TRANSLATE_BIG;return mi(this,"_resizerKeyboardManager",new mC([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,n]}],[["Escape","mac+Escape"],ur.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===ur&&Gi("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:r,rawDims:{pageWidth:n,pageHeight:a,pageX:l,pageY:c}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,a],this.pageTranslation=[l,c];const[d,p]=this.parentDimensions;this.x=t.x/d,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return mi(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const r=new eNt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(t,r,n){if(ur._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(l=>[l,t.get(l.replaceAll(/([A-Z])/g,c=>`-${c.toLowerCase()}`))])),n?.strings)for(const l of n.strings)ur._l10nPromise.set(l,t.get(l));if(ur._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);ur._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,r){Gi("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(t*2),this.y+=this.width*t/(r*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(t*2),this.y-=this.width*t/(r*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#P(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#c?this.#c=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,r,n,a){const[l,c]=this.parentDimensions;[n,a]=this.screenToPageTranslation(n,a),this.x=(t+n)/l,this.y=(r+a)/c,this.fixAndSetPosition()}#S([t,r],n,a){[n,a]=this.screenToPageTranslation(n,a),this.x+=n/t,this.y+=a/r,this.fixAndSetPosition()}translate(t,r){this.#S(this.parentDimensions,t,r)}translateInPage(t,r){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,r),this.div.scrollIntoView({block:"nearest"})}drag(t,r){this.#a||=[this.x,this.y];const[n,a]=this.parentDimensions;if(this.x+=t/n,this.y+=r/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:l,y:c}=this;const[d,p]=this.getBaseTranslation();l+=d,c+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*c).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}getBaseTranslation(){const[t,r]=this.parentDimensions,{_borderLineWidth:n}=ur,a=n/t,l=n/r;switch(this.rotation){case 90:return[-a,l];case 180:return[a,l];case 270:return[a,-l];default:return[-a,-l]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[r,n]=this.pageDimensions;let{x:a,y:l,width:c,height:d}=this;if(c*=r,d*=n,a*=r,l*=n,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(r-c,a)),l=Math.max(0,Math.min(n-d,l));break;case 90:a=Math.max(0,Math.min(r-d,a)),l=Math.min(n,Math.max(c,l));break;case 180:a=Math.min(r,Math.max(c,a)),l=Math.min(n,Math.max(d,l));break;case 270:a=Math.min(r,Math.max(d,a)),l=Math.max(0,Math.min(n-c,l));break}this.x=a/=r,this.y=l/=n;const[p,u]=this.getBaseTranslation();a+=p,l+=u;const{style:h}=this.div;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*l).toFixed(2)}%`,this.moveInDOM()}static#j(t,r,n){switch(n){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}screenToPageTranslation(t,r){return ur.#j(t,r,this.parentRotation)}pageTranslationToScreen(t,r){return ur.#j(t,r,360-this.parentRotation)}#$(t){switch(t){case 90:{const[r,n]=this.pageDimensions;return[0,-r/n,n/r,0]}case 180:return[-1,0,0,-1];case 270:{const[r,n]=this.pageDimensions;return[0,r/n,-n/r,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[r,n]}=this,a=r*t,l=n*t;return vc.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,r){const[n,a]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*r/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:r,width:n}=t,a=n.endsWith("%"),l=!this.#s&&r.endsWith("%");if(a&&l)return;const[c,d]=this.parentDimensions;a||(t.width=`${(100*parseFloat(n)/c).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(r)/d).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#w(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],r=this._uiManager._signal;for(const n of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",n),a.setAttribute("data-resizer-name",n),a.addEventListener("pointerdown",this.#x.bind(this,n),{signal:r}),a.addEventListener("contextmenu",Ec,{signal:r}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,r){r.preventDefault();const{isMac:n}=vc.platform;if(r.button!==0||r.ctrlKey&&n)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const c=this._uiManager._signal,d={passive:!0,capture:!0,signal:c};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,d),window.addEventListener("contextmenu",Ec,{signal:c});const p=this.x,u=this.y,h=this.width,m=this.height,f=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;const y=()=>{this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=l,window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),window.removeEventListener("pointermove",a,d),window.removeEventListener("contextmenu",Ec),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:c}),window.addEventListener("blur",y,{signal:c})}#C(t,r,n,a){const l=this.x,c=this.y,d=this.width,p=this.height;l===t&&c===r&&d===n&&p===a||this.addCommands({cmd:()=>{this.width=d,this.height=p,this.x=l,this.y=c;const[u,h]=this.parentDimensions;this.setDims(u*d,h*p),this.fixAndSetPosition()},undo:()=>{this.width=n,this.height=a,this.x=t,this.y=r;const[u,h]=this.parentDimensions;this.setDims(u*n,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,r){const[n,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,p=this.height,u=ur.MIN_SIZE/n,h=ur.MIN_SIZE/a,m=V=>Math.round(V*1e4)/1e4,f=this.#$(this.rotation),x=(V,O)=>[f[0]*V+f[2]*O,f[1]*V+f[3]*O],y=this.#$(360-this.rotation),b=(V,O)=>[y[0]*V+y[2]*O,y[1]*V+y[3]*O];let w,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,w=(V,O)=>[0,0],v=(V,O)=>[V,O];break;case"topMiddle":w=(V,O)=>[V/2,0],v=(V,O)=>[V/2,O];break;case"topRight":A=!0,w=(V,O)=>[V,0],v=(V,O)=>[0,O];break;case"middleRight":S=!0,w=(V,O)=>[V,O/2],v=(V,O)=>[0,O/2];break;case"bottomRight":A=!0,w=(V,O)=>[V,O],v=(V,O)=>[0,0];break;case"bottomMiddle":w=(V,O)=>[V/2,O],v=(V,O)=>[V/2,0];break;case"bottomLeft":A=!0,w=(V,O)=>[0,O],v=(V,O)=>[V,0];break;case"middleLeft":S=!0,w=(V,O)=>[0,O/2],v=(V,O)=>[V,O/2];break}const E=w(d,p),I=v(d,p);let L=x(...I);const B=m(l+L[0]),D=m(c+L[1]);let P=1,T=1,[R,N]=this.screenToPageTranslation(r.movementX,r.movementY);if([R,N]=b(R/n,N/a),A){const V=Math.hypot(d,p);P=T=Math.max(Math.min(Math.hypot(I[0]-E[0]-R,I[1]-E[1]-N)/V,1/d,1/p),u/d,h/p)}else S?P=Math.max(u,Math.min(1,Math.abs(I[0]-E[0]-R)))/d:T=Math.max(h,Math.min(1,Math.abs(I[1]-E[1]-N)))/p;const K=m(d*P),q=m(p*T);L=x(...v(K,q));const F=B-L[0],_=D-L[1];this.width=K,this.height=q,this.x=F,this.y=_,this.setDims(n*K,a*q),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new IX(this),this.div.append(this.#p.render()),this.#o&&this.#p.addAltTextButton(await this.#o.render()),this.#p)}removeEditToolbar(){this.#p&&(this.#p.remove(),this.#p=null,this.#o?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(p4.initialize(ur._l10nPromise),this.#o=new p4(this),this.#e&&(this.#o.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}hasAltText(){return!this.#o?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#l,{signal:t}),this.div.addEventListener("focusout",this.#d,{signal:t});const[r,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/r).toFixed(2)}%`,this.div.style.maxHeight=`${(100*r/n).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),jL(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:r}=vc.platform;if(t.button!==0||t.ctrlKey&&r){t.preventDefault();return}if(this.#c=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:r}=vc.platform;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const r=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let n,a;const l=this._uiManager._signal;r&&(this.div.classList.add("moving"),n={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#b=t.clientY,a=d=>{const{clientX:p,clientY:u}=d,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#b);this.#g=p,this.#b=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,n));const c=()=>{window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),r&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,n)),this.#c=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,r,n){t.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition()}getRect(t,r,n=this.rotation){const a=this.parentScale,[l,c]=this.pageDimensions,[d,p]=this.pageTranslation,u=t/a,h=r/a,m=this.x*l,f=this.y*c,x=this.width*l,y=this.height*c;switch(n){case 0:return[m+u+d,c-f-h-y+p,m+u+x+d,c-f-h+p];case 90:return[m+h+d,c-f+u+p,m+h+y+d,c-f+u+x+p];case 180:return[m-u-x+d,c-f+h+p,m-u+d,c-f+h+y+p];case 270:return[m-h-y+d,c-f-u-x+p,m-h+d,c-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,r){const[n,a,l,c]=t,d=l-n,p=c-a;switch(this.rotation){case 0:return[n,r-c,d,p];case 90:return[n,r-a,p,d];case 180:return[l,r-a,d,p];case 270:return[l,r-c,p,d];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#u}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#l,{signal:t}),this.div?.addEventListener("focusout",this.#d,{signal:t})}rotate(t){}serialize(t=!1,r=null){Gi("An editor must be serializable")}static deserialize(t,r,n){const a=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,c]=a.pageDimensions,[d,p,u,h]=a.getRectInCurrentCoords(t.rect,c);return a.x=d/l,a.y=p/c,a.width=u/l,a.height=h/c,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#d),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#P(),this.removeEditToolbar(),this.#v){for(const t of this.#v.values())clearTimeout(t);this.#v=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#w(),this.#r.classList.remove("hidden"),jL(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#n={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const r=this.#r.children;if(!this.#t){this.#t=Array.from(r);const c=this.#M.bind(this),d=this.#T.bind(this),p=this._uiManager._signal;for(const u of this.#t){const h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",c,{signal:p}),u.addEventListener("blur",d,{signal:p}),u.addEventListener("focus",this.#D.bind(this,h),{signal:p}),ur._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const n=this.#t[0];let a=0;for(const c of r){if(c===n)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let d=0;d<a-l;d++)this.#r.append(this.#r.firstChild);else if(l>a)for(let d=0;d<l-a;d++)this.#r.firstChild.before(this.#r.lastChild);let c=0;for(const d of r){const u=this.#t[c++].getAttribute("data-resizer-name");ur._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>d.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){ur._resizerKeyboardManager.exec(this,t)}#T(t){this.#u&&t.relatedTarget?.parentNode!==this.#r&&this.#P()}#D(t){this.#h=this.#u?t:""}#z(t){if(this.#t)for(const r of this.#t)r.tabIndex=t}_resizeWithKeyboard(t,r){this.#u&&this.#E(this.#h,{movementX:t,movementY:r})}#P(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:r,savedWidth:n,savedHeight:a}=this.#n;this.#C(t,r,n,a),this.#n=null}}_stopResizingWithKeyboard(){this.#P(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#p){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#p?.show()});return}this.#p?.show()}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#p?.hide()}updateParams(t,r){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,r){this.#s=!0;const n=t/r,{style:a}=this.div;a.aspectRatio=n,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,r=!1){if(r){this.#v||=new Map;const{action:n}=t;let a=this.#v.get(n);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(n),this.#v.size===0&&(this.#v=null)},ur._telemetryTimeout),this.#v.set(n,a);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(t){let r=t.container.querySelector(".annotationContent");if(!r)r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),t.container.prepend(r);else if(r.nodeName==="CANVAS"){const n=r;r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),n.before(r)}return r}resetAnnotationElement(t){const{firstChild:r}=t.container;r.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class eNt extends ur{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const bme=3285377520,Pd=4294901760,Tu=65535;class eRe{constructor(t){this.h1=t?t&4294967295:bme,this.h2=t?t&4294967295:bme}update(t){let r,n;if(typeof t=="string"){r=new Uint8Array(t.length*2),n=0;for(let b=0,w=t.length;b<w;b++){const v=t.charCodeAt(b);v<=255?r[n++]=v:(r[n++]=v>>>8,r[n++]=v&255)}}else if(ArrayBuffer.isView(t))r=t.slice(),n=r.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=n>>2,l=n-a*4,c=new Uint32Array(r.buffer,0,a);let d=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&Tu,y=f&Tu;for(let b=0;b<a;b++)b&1?(d=c[b],d=d*m&Pd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Pd|d*y&Tu,u^=d,u=u<<13|u>>>19,u=u*5+3864292196):(p=c[b],p=p*m&Pd|p*x&Tu,p=p<<15|p>>>17,p=p*f&Pd|p*y&Tu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(d=0,l){case 3:d^=r[a*4+2]<<16;case 2:d^=r[a*4+1]<<8;case 1:d^=r[a*4],d=d*m&Pd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Pd|d*y&Tu,a&1?u^=d:h^=d}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,r=this.h2;return t^=r>>>1,t=t*3981806797&Pd|t*36045&Tu,r=r*4283543511&Pd|((r<<16|t>>>16)*2950163797&Pd)>>>16,t^=r>>>1,t=t*444984403&Pd|t*60499&Tu,r=r*3301882366&Pd|((r<<16|t>>>16)*3120437893&Pd)>>>16,t^=r>>>1,(t>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}const LY=Object.freeze({map:null,hash:"",transfer:void 0});class BX{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,r){const n=this.#t.get(t);return n===void 0?r:Object.assign(r,n)}getRawValue(t){return this.#t.get(t)}remove(t){if(this.#t.delete(t),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const r of this.#t.values())if(r instanceof ur)return;this.onAnnotationEditor(null)}}setValue(t,r){const n=this.#t.get(t);let a=!1;if(n!==void 0)for(const[l,c]of Object.entries(r))n[l]!==c&&(a=!0,n[l]=c);else a=!0,this.#t.set(t,r);a&&this.#o(),r instanceof ur&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?CX(this.#t):null}setAll(t){for(const[r,n]of Object.entries(t))this.setValue(r,n)}get size(){return this.#t.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new tRe(this)}get serializable(){if(this.#t.size===0)return LY;const t=new Map,r=new eRe,n=[],a=Object.create(null);let l=!1;for(const[c,d]of this.#t){const p=d instanceof ur?d.serialize(!1,a):d;p&&(t.set(c,p),r.update(`${c}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const c of t.values())c.bitmap&&n.push(c.bitmap);return t.size>0?{map:t,hash:r.hexdigest(),transfer:n}:LY}get editorStats(){let t=null;const r=new Map;for(const n of this.#t.values()){if(!(n instanceof ur))continue;const a=n.telemetryFinalData;if(!a)continue;const{type:l}=a;r.has(l)||r.set(l,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const c=t[l]||=new Map;for(const[d,p]of Object.entries(a)){if(d==="type")continue;let u=c.get(d);u||(u=new Map,c.set(d,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[n,a]of r)t[n]=a.computeTelemetryFinalData(t[n]);return t}}class tRe extends BX{#e;constructor(t){super();const{map:r,hash:n,transfer:a}=t.serializable,l=structuredClone(r,a?{transfer:a}:null);this.#e={map:l,hash:n,transfer:a}}get print(){Gi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class tNt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:r=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const r=this.styleElement.sheet;r.insertRule(t,r.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:r}){if(!(!t||this.#e.has(t.loadedName))){if(Wa(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:a,style:l}=t,c=new FontFace(n,a,l);this.addNativeFontFace(c);try{await c.load(),this.#e.add(n),r?.(t)}catch{Nr(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(c)}return}Gi("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const n=t.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(a){throw Nr(`Failed to load font '${n.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const r=t.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const a=this._queueLoadingCallback(n);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return mi(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(ul||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),mi(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function r(){for(Wa(!a.done,"completeRequest() cannot be called twice."),a.done=!0;n.length>0&&n[0].done;){const l=n.shift();setTimeout(l.callback,0)}}const{loadingRequests:n}=this,a={done:!1,complete:r,callback:t};return n.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return mi(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,r){function n(E,I){return E.charCodeAt(I)<<24|E.charCodeAt(I+1)<<16|E.charCodeAt(I+2)<<8|E.charCodeAt(I+3)&255}function a(E,I,L,B){const D=E.substring(0,I),P=E.substring(I+L);return D+B+P}let l,c;const d=this._document.createElement("canvas");d.width=1,d.height=1;const p=d.getContext("2d");let u=0;function h(E,I){if(++u>30){Nr("Load test font never loaded."),I();return}if(p.font="30px "+E,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){I();return}setTimeout(h.bind(null,E,I))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=a(f,976,m.length,m);const y=16,b=1482184792;let w=n(f,y);for(l=0,c=m.length-3;l<c;l+=4)w=w-b+n(m,l)|0;l<m.length&&(w=w-b+n(m+"XXX",l)|0),f=a(f,y,4,FOt(w));const v=`url(data:font/opentype;base64,${btoa(f)});`,A=`@font-face {font-family:"${m}";src:${v}}`;this.insertRule(A);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const E of[t.loadedName,m]){const I=this._document.createElement("span");I.textContent="Hi",I.style.fontFamily=E,S.append(I)}this._document.body.append(S),h(m,()=>{S.remove(),r.complete()})}}class oNt{constructor(t,{disableFontFace:r=!1,inspectFont:n=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=r===!0,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=Yze(this.data),r=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${r}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${r}}`}return this._inspectFont?.(this,r),n}getPathGenerator(t,r){if(this.compiledGlyphs[r]!==void 0)return this.compiledGlyphs[r];let n;try{n=t.get(this.loadedName+"_path_"+r)}catch(l){Nr(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(n)||n.length===0)return this.compiledGlyphs[r]=function(l,c){};const a=[];for(let l=0,c=n.length;l<c;)switch(n[l++]){case C0.BEZIER_CURVE_TO:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.bezierCurveTo(d,p,u,h,m,f)),l+=6}break;case C0.MOVE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.moveTo(d,p)),l+=2}break;case C0.LINE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.lineTo(d,p)),l+=2}break;case C0.QUADRATIC_CURVE_TO:{const[d,p,u,h]=n.slice(l,l+4);a.push(m=>m.quadraticCurveTo(d,p,u,h)),l+=4}break;case C0.RESTORE:a.push(d=>d.restore());break;case C0.SAVE:a.push(d=>d.save());break;case C0.SCALE:Wa(a.length===2,"Scale command is only valid at the third position.");break;case C0.TRANSFORM:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.transform(d,p,u,h,m,f)),l+=6}break;case C0.TRANSLATE:{const[d,p]=n.slice(l,l+2);a.push(u=>u.translate(d,p)),l+=2}break}return this.compiledGlyphs[r]=function(c,d){a[0](c),a[1](c),c.scale(d,-d);for(let p=2,u=a.length;p<u;p++)a[p](c)}}}if(ul){var IY=Promise.withResolvers(),jY=null;(async()=>{const t=await r4(()=>import("./empty-CgYLD2qf.js").then(d=>d.e),__vite__mapDeps([0,1,2])),r=await r4(()=>import("./index-TuR64bb4.js").then(d=>d.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),n=await r4(()=>import("./index-BOz0wXfz.js").then(d=>d.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await r4(()=>import("./url-BkXBPObc.js").then(d=>d.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,c;return new Map(Object.entries({fs:t,http:r,https:n,url:a,canvas:l,path2d:c}))})().then(t=>{jY=t,IY.resolve()},t=>{Nr(`loadPackages: ${t}`),jY=new Map,IY.resolve()})}class Rh{static get promise(){return IY.promise}static get(t){return jY?.get(t)}}const oRe=function(e){return Rh.get("fs").promises.readFile(e).then(r=>new Uint8Array(r))};class rNt extends BM{}class iNt extends DM{_createCanvas(t,r){return Rh.get("canvas").createCanvas(t,r)}}class nNt extends PM{_fetchData(t,r){return oRe(t).then(n=>({cMapData:n,compressionType:r}))}}class aNt extends TM{_fetchData(t){return oRe(t)}}const Tl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function MY(e,t){if(!t)return;const r=t[2]-t[0],n=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],r,n),e.clip(a)}class gC{constructor(){this.constructor===gC&&Gi("Cannot initialize BaseShadingPattern.")}getPattern(){Gi("Abstract method `getPattern` called.")}}class sNt extends gC{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let r;this._type==="axial"?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)r.addColorStop(n[0],n[1]);return r}getPattern(t,r,n,a){let l;if(a===Tl.STROKE||a===Tl.FILL){const c=r.current.getClippedPathBoundingBox(a,Dn(t))||[0,0,0,0],d=Math.ceil(c[2]-c[0])||1,p=Math.ceil(c[3]-c[1])||1,u=r.cachedCanvases.getCanvas("pattern",d,p,!0),h=u.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(-c[0],-c[1]),n=jo.transform(n,[1,0,0,1,c[0],c[1]]),h.transform(...r.baseTransform),this.matrix&&h.transform(...this.matrix),MY(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(n);l.setTransform(m)}else MY(t,this._bbox),l=this._createGradient(t);return l}}function n_(e,t,r,n,a,l,c,d){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f),p[n+1]>p[a+1]&&(f=n,n=a,a=f,f=c,c=d,d=f),p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f);const x=(p[r]+t.offsetX)*t.scaleX,y=(p[r+1]+t.offsetY)*t.scaleY,b=(p[n]+t.offsetX)*t.scaleX,w=(p[n+1]+t.offsetY)*t.scaleY,v=(p[a]+t.offsetX)*t.scaleX,A=(p[a+1]+t.offsetY)*t.scaleY;if(y>=A)return;const S=u[l],E=u[l+1],I=u[l+2],L=u[c],B=u[c+1],D=u[c+2],P=u[d],T=u[d+1],R=u[d+2],N=Math.round(y),K=Math.round(A);let q,F,_,V,O,z,H,ee;for(let Y=N;Y<=K;Y++){if(Y<w){const xe=Y<y?0:(y-Y)/(y-w);q=x-(x-b)*xe,F=S-(S-L)*xe,_=E-(E-B)*xe,V=I-(I-D)*xe}else{let xe;Y>A?xe=1:w===A?xe=0:xe=(w-Y)/(w-A),q=b-(b-v)*xe,F=L-(L-P)*xe,_=B-(B-T)*xe,V=D-(D-R)*xe}let G;Y<y?G=0:Y>A?G=1:G=(y-Y)/(y-A),O=x-(x-v)*G,z=S-(S-P)*G,H=E-(E-T)*G,ee=I-(I-R)*G;const X=Math.round(Math.min(q,O)),J=Math.round(Math.max(q,O));let ae=m*Y+X*4;for(let xe=X;xe<=J;xe++)G=(q-xe)/(q-O),G<0?G=0:G>1&&(G=1),h[ae++]=F-(F-z)*G|0,h[ae++]=_-(_-H)*G|0,h[ae++]=V-(V-ee)*G|0,h[ae++]=255}}function lNt(e,t,r){const n=t.coords,a=t.colors;let l,c;switch(t.type){case"lattice":const d=t.verticesPerRow,p=Math.floor(n.length/d)-1,u=d-1;for(l=0;l<p;l++){let h=l*d;for(let m=0;m<u;m++,h++)n_(e,r,n[h],n[h+1],n[h+d],a[h],a[h+1],a[h+d]),n_(e,r,n[h+d+1],n[h+1],n[h+d],a[h+d+1],a[h+1],a[h+d])}break;case"triangles":for(l=0,c=n.length;l<c;l+=3)n_(e,r,n[l],n[l+1],n[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class cNt extends gC{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,r,n){const d=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-d,h=Math.ceil(this._bounds[3])-p,m=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),x=u/m,y=h/f,b={coords:this._coords,colors:this._colors,offsetX:-d,offsetY:-p,scaleX:1/x,scaleY:1/y},w=m+4,v=f+4,A=n.getCanvas("mesh",w,v,!1),S=A.context,E=S.createImageData(m,f);if(r){const L=E.data;for(let B=0,D=L.length;B<D;B+=4)L[B]=r[0],L[B+1]=r[1],L[B+2]=r[2],L[B+3]=255}for(const L of this._figures)lNt(E,L,b);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:d-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,r,n,a){MY(t,this._bbox);let l;if(a===Tl.SHADING)l=jo.singularValueDecompose2dScale(Dn(t));else if(l=jo.singularValueDecompose2dScale(r.baseTransform),this.matrix){const d=jo.singularValueDecompose2dScale(this.matrix);l=[l[0]*d[0],l[1]*d[1]]}const c=this._createMeshCanvas(l,a===Tl.SHADING?null:this._background,r.cachedCanvases);return a!==Tl.SHADING&&(t.setTransform(...r.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(c.offsetX,c.offsetY),t.scale(c.scaleX,c.scaleY),t.createPattern(c.canvas,"no-repeat")}}class dNt extends gC{getPattern(){return"hotpink"}}function pNt(e){switch(e[0]){case"RadialAxial":return new sNt(e);case"Mesh":return new cNt(e);case"Dummy":return new dNt}throw new Error(`Unknown IR type: ${e[0]}`)}const wme={COLORED:1,UNCOLORED:2};class DX{static MAX_PATTERN_SIZE=3e3;constructor(t,r,n,a,l){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=r,this.ctx=n,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const r=this.operatorList,n=this.bbox,a=this.xstep,l=this.ystep,c=this.paintType,d=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;IM("TilingType: "+d);const h=n[0],m=n[1],f=n[2],x=n[3],y=jo.singularValueDecompose2dScale(this.matrix),b=jo.singularValueDecompose2dScale(this.baseTransform),w=[y[0]*b[0],y[1]*b[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,w[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,w[1]),S=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),E=S.context,I=u.createCanvasGraphics(E);I.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(I,c,p);let L=h,B=m,D=f,P=x;return h<0&&(L=0,D+=Math.abs(h)),m<0&&(B=0,P+=Math.abs(m)),E.translate(-(v.scale*L),-(A.scale*B)),I.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(I,L,B,D,P),I.baseTransform=Dn(I.ctx),I.executeOperatorList(r),I.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:B}}getSizeAndScale(t,r,n){t=Math.abs(t);const a=Math.max(DX.MAX_PATTERN_SIZE,r);let l=Math.ceil(t*n);return l>=a?l=a:n=l/t,{scale:n,size:l}}clipBbox(t,r,n,a,l){const c=a-r,d=l-n;t.ctx.rect(r,n,c,d),t.current.updateRectMinMax(Dn(t.ctx),[r,n,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,r,n){const a=t.ctx,l=t.current;switch(r){case wme.COLORED:const c=this.ctx;a.fillStyle=c.fillStyle,a.strokeStyle=c.strokeStyle,l.fillColor=c.fillStyle,l.strokeColor=c.strokeStyle;break;case wme.UNCOLORED:const d=jo.makeHexColor(n[0],n[1],n[2]);a.fillStyle=d,a.strokeStyle=d,l.fillColor=d,l.strokeColor=d;break;default:throw new ROt(`Unsupported paint type: ${r}`)}}getPattern(t,r,n,a){let l=n;a!==Tl.SHADING&&(l=jo.transform(l,r.baseTransform),this.matrix&&(l=jo.transform(l,this.matrix)));const c=this.createPatternCanvas(r);let d=new DOMMatrix(l);d=d.translate(c.offsetX,c.offsetY),d=d.scale(1/c.scaleX,1/c.scaleY);const p=t.createPattern(c.canvas,"repeat");return p.setTransform(d),p}}function uNt({src:e,srcPos:t=0,dest:r,width:n,height:a,nonBlackColor:l=4294967295,inverseDecode:c=!1}){const d=vc.isLittleEndian?4278190080:255,[p,u]=c?[l,d]:[d,l],h=n>>3,m=n&7,f=e.length;r=new Uint32Array(r.buffer);let x=0;for(let y=0;y<a;y++){for(const w=t+h;t<w;t++){const v=t<f?e[t]:255;r[x++]=v&128?u:p,r[x++]=v&64?u:p,r[x++]=v&32?u:p,r[x++]=v&16?u:p,r[x++]=v&8?u:p,r[x++]=v&4?u:p,r[x++]=v&2?u:p,r[x++]=v&1?u:p}if(m===0)continue;const b=t<f?e[t++]:255;for(let w=0;w<m;w++)r[x++]=b&1<<7-w?u:p}return{srcPos:t,destPos:x}}const vme=16,Cme=100,hNt=15,Ame=10,$me=1e3,dc=16;function mNt(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(n,a){t.translate(n,a),this.__originalTranslate(n,a)},e.scale=function(n,a){t.scale(n,a),this.__originalScale(n,a)},e.transform=function(n,a,l,c,d,p){t.transform(n,a,l,c,d,p),this.__originalTransform(n,a,l,c,d,p)},e.setTransform=function(n,a,l,c,d,p){t.setTransform(n,a,l,c,d,p),this.__originalSetTransform(n,a,l,c,d,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(n){t.rotate(n),this.__originalRotate(n)},e.clip=function(n){t.clip(n),this.__originalClip(n)},e.moveTo=function(r,n){t.moveTo(r,n),this.__originalMoveTo(r,n)},e.lineTo=function(r,n){t.lineTo(r,n),this.__originalLineTo(r,n)},e.bezierCurveTo=function(r,n,a,l,c,d){t.bezierCurveTo(r,n,a,l,c,d),this.__originalBezierCurveTo(r,n,a,l,c,d)},e.rect=function(r,n,a,l){t.rect(r,n,a,l),this.__originalRect(r,n,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class gNt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,r,n){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,r,n)):(a=this.canvasFactory.create(r,n),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const r=this.cache[t];this.canvasFactory.destroy(r),delete this.cache[t]}}}function m$(e,t,r,n,a,l,c,d,p,u){const[h,m,f,x,y,b]=Dn(e);if(m===0&&f===0){const A=c*h+y,S=Math.round(A),E=d*x+b,I=Math.round(E),L=(c+p)*h+y,B=Math.abs(Math.round(L)-S)||1,D=(d+u)*x+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,I),e.drawImage(t,r,n,a,l,0,0,B,P),e.setTransform(h,m,f,x,y,b),[B,P]}if(h===0&&x===0){const A=d*f+y,S=Math.round(A),E=c*m+b,I=Math.round(E),L=(d+u)*f+y,B=Math.abs(Math.round(L)-S)||1,D=(c+p)*m+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,I),e.drawImage(t,r,n,a,l,0,0,P,B),e.setTransform(h,m,f,x,y,b),[P,B]}e.drawImage(t,r,n,a,l,c,d,p,u);const w=Math.hypot(h,m),v=Math.hypot(f,x);return[w*p,v*u]}function fNt(e){const{width:t,height:r}=e;if(t>$me||r>$me)return null;const n=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let c=new Uint8Array(l*(r+1)),d,p,u;const h=t+7&-8;let m=new Uint8Array(h*r),f=0;for(const v of e.data){let A=128;for(;A>0;)m[f++]=v&A?0:255,A>>=1}let x=0;for(f=0,m[f]!==0&&(c[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(c[p]=2,++x),d=1;d<r;d++){f=d*h,u=d*l,m[f-h]!==m[f]&&(c[u]=m[f]?1:8,++x);let v=(m[f]?4:0)+(m[f-h]?8:0);for(p=1;p<t;p++)v=(v>>2)+(m[f+1]?4:0)+(m[f-h+1]?8:0),a[v]&&(c[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(c[u+p]=m[f]?2:4,++x),x>n)return null}for(f=h*(r-1),u=d*l,m[f]!==0&&(c[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(c[u+p]=4,++x),x>n)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),b=new Path2D;for(d=0;x&&d<=r;d++){let v=d*l;const A=v+t;for(;v<A&&!c[v];)v++;if(v===A)continue;b.moveTo(v%l,d);const S=v;let E=c[v];do{const I=y[E];do v+=I;while(!c[v]);const L=c[v];L!==5&&L!==10?(E=L,c[v]=0):(E=L&51*E>>4,c[v]&=E>>2|E<<2),b.lineTo(v%l,v/l|0),c[v]||--x}while(S!==v);--d}return m=null,c=null,function(v){v.save(),v.scale(1/t,-1/r),v.translate(0,-r),v.fill(b),v.beginPath(),v.restore()}}class kme{constructor(t,r){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Wze,this.textMatrixScale=1,this.fontMatrix=$Y,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=il.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,r])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,r){this.x=t,this.y=r}updatePathMinMax(t,r,n){[r,n]=jo.applyTransform([r,n],t),this.minX=Math.min(this.minX,r),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,r),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,r){const n=jo.applyTransform(r,t),a=jo.applyTransform(r.slice(2),t),l=jo.applyTransform([r[0],r[3]],t),c=jo.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,n[0],a[0],l[0],c[0]),this.minY=Math.min(this.minY,n[1],a[1],l[1],c[1]),this.maxX=Math.max(this.maxX,n[0],a[0],l[0],c[0]),this.maxY=Math.max(this.maxY,n[1],a[1],l[1],c[1])}updateScalingPathMinMax(t,r){jo.scaleMinMax(t,r),this.minX=Math.min(this.minX,r[0]),this.minY=Math.min(this.minY,r[1]),this.maxX=Math.max(this.maxX,r[2]),this.maxY=Math.max(this.maxY,r[3])}updateCurvePathMinMax(t,r,n,a,l,c,d,p,u,h){const m=jo.bezierBoundingBox(r,n,a,l,c,d,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=Tl.FILL,r=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===Tl.STROKE){r||Gi("Stroke bounding box must include transform.");const a=jo.singularValueDecompose2dScale(r),l=a[0]*this.lineWidth/2,c=a[1]*this.lineWidth/2;n[0]-=l,n[1]-=c,n[2]+=l,n[3]+=c}return n}updateClipFromPath(){const t=jo.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Tl.FILL,r=null){return jo.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}function Sme(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0,u;const h=t.data,m=d.data;let f,x,y,b;if(t.kind===iE.GRAYSCALE_1BPP){const w=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=n+7>>3,E=4294967295,I=vc.isLittleEndian?4278190080:255;for(f=0;f<c;f++){for(y=f<l?dc:a,u=0,x=0;x<y;x++){const L=w-p;let B=0;const D=L>S?n:L*8-7,P=D&-8;let T=0,R=0;for(;B<P;B+=8)R=h[p++],v[u++]=R&128?E:I,v[u++]=R&64?E:I,v[u++]=R&32?E:I,v[u++]=R&16?E:I,v[u++]=R&8?E:I,v[u++]=R&4?E:I,v[u++]=R&2?E:I,v[u++]=R&1?E:I;for(;B<D;B++)T===0&&(R=h[p++],T=128),v[u++]=R&T?E:I,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(d,0,f*dc)}}else if(t.kind===iE.RGBA_32BPP){for(x=0,b=n*dc*4,f=0;f<l;f++)m.set(h.subarray(p,p+b)),p+=b,e.putImageData(d,0,x),x+=dc;f<c&&(b=n*a*4,m.set(h.subarray(p,p+b)),e.putImageData(d,0,x))}else if(t.kind===iE.RGB_24BPP)for(y=dc,b=n*y,f=0;f<c;f++){for(f>=l&&(y=a,b=n*y),u=0,x=b;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(d,0,f*dc)}else throw new Error(`bad image kind: ${t.kind}`)}function Eme(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0;const u=t.data,h=d.data;for(let m=0;m<c;m++){const f=m<l?dc:a;({srcPos:p}=uNt({src:u,srcPos:p,dest:h,width:n,height:f,nonBlackColor:0})),e.putImageData(d,0,m*dc)}}function uy(e,t){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function g$(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0),!ul){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function Lme(e,t){if(t)return!0;const r=jo.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*U8.PDF_TO_CSS_UNITS);return r[0]<=n&&r[1]<=n}const xNt=["butt","round","square"],yNt=["miter","round","bevel"],bNt={},Ime={};class d8{constructor(t,r,n,a,l,{optionalContentConfig:c,markedContentStack:d=null},p,u){this.ctx=t,this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,this.canvasFactory=a,this.filterFactory=l,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=d||[],this.optionalContentConfig=c,this.cachedCanvases=new gNt(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,r=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):r}beginDrawing({transform:t,viewport:r,transparency:n=!1,background:a=null}){const l=this.ctx.canvas.width,c=this.ctx.canvas.height,d=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,c),this.ctx.fillStyle=d,n){const p=this.cachedCanvases.getCanvas("transparent",l,c);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...Dn(this.compositeCtx))}this.ctx.save(),g$(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=Dn(this.ctx)}executeOperatorList(t,r,n,a){const l=t.argsArray,c=t.fnArray;let d=r||0;const p=l.length;if(p===d)return d;const u=p-d>Ame&&typeof n=="function",h=u?Date.now()+hNt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&d===a.nextBreakPoint)return a.breakIt(d,n),d;if(y=c[d],y!==X1.dependency)this[y].apply(this,l[d]);else for(const b of l[d]){const w=b.startsWith("g_")?f:x;if(!w.has(b))return w.get(b,n),d}if(d++,d===p)return d;if(u&&++m>Ame){if(Date.now()>h)return n(),d;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const r of t.values())typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&(r.width=r.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const r=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(t,r){const n=t.width,a=t.height;let l=Math.max(Math.hypot(r[0],r[1]),1),c=Math.max(Math.hypot(r[2],r[3]),1),d=n,p=a,u="prescale1",h,m;for(;l>2&&d>1||c>2&&p>1;){let f=d,x=p;l>2&&d>1&&(f=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d/2),l/=d/f),c>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,c/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,d,p,0,0,f,x),t=h.canvas,d=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:d,paintHeight:p}}_createMaskCanvas(t){const r=this.ctx,{width:n,height:a}=t,l=this.current.fillColor,c=this.current.patternFill,d=Dn(r);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;u=JSON.stringify(c?d:[d.slice(0,4),l]),p=this._cachedBitmapsMap.get(D),p||(p=new Map,this._cachedBitmapsMap.set(D,p));const P=p.get(u);if(P&&!c){const T=Math.round(Math.min(d[0],d[2])+d[4]),R=Math.round(Math.min(d[1],d[3])+d[5]);return{canvas:P,offsetX:T,offsetY:R}}h=P}h||(m=this.cachedCanvases.getCanvas("maskCanvas",n,a),Eme(m.context,t));let f=jo.transform(d,[1/n,0,0,-1/a,0,0]);f=jo.transform(f,[1,0,0,1,0,-a]);const[x,y,b,w]=jo.getAxialAlignedBoundingBox([0,0,n,a],f),v=Math.round(b-x)||1,A=Math.round(w-y)||1,S=this.cachedCanvases.getCanvas("fillCanvas",v,A),E=S.context,I=x,L=y;E.translate(-I,-L),E.transform(...f),h||(h=this._scaleImage(m.canvas,A0(E)),h=h.img,p&&c&&p.set(u,h)),E.imageSmoothingEnabled=Lme(Dn(E),t.interpolate),m$(E,h,0,0,h.width,h.height,0,0,n,a),E.globalCompositeOperation="source-in";const B=jo.transform(A0(E),[1,0,0,1,-I,-L]);return E.fillStyle=c?l.getPattern(r,this,B,Tl.FILL):l,E.fillRect(0,0,n,a),p&&!c&&(this.cachedCanvases.delete("fillCanvas"),p.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(I),offsetY:Math.round(L)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=xNt[t]}setLineJoin(t){this.ctx.lineJoin=yNt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,r){const n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(t),n.lineDashOffset=r)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[r,n]of t)switch(r){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,r=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,t,r);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...Dn(this.suspendedCtx)),uy(this.suspendedCtx,l),mNt(l,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),uy(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,r,n,a){const l=a[0],c=a[1],d=a[2]-l,p=a[3]-c;d===0||p===0||(this.genericComposeSMask(r.context,n,d,p,r.subtype,r.backdrop,r.transferMap,l,c,r.offsetX,r.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}genericComposeSMask(t,r,n,a,l,c,d,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(c){if(x<0||y<0||x+n>f.width||y+a>f.height){const w=this.cachedCanvases.getCanvas("maskExtension",n,a),v=w.context;v.drawImage(f,-x,-y),c.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=jo.makeHexColor(...c),v.fillRect(0,0,n,a),v.globalCompositeOperation="source-over"),f=w.canvas,x=y=0}else if(c.some(w=>w!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(x,y,n,a),t.clip(w),t.globalCompositeOperation="destination-atop",t.fillStyle=jo.makeHexColor(...c),t.fillRect(x,y,n,a),t.restore()}}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),l==="Alpha"&&d?r.filter=this.filterFactory.addAlphaFilter(d):l==="Luminosity"&&(r.filter=this.filterFactory.addLuminosityFilter(d));const b=new Path2D;b.rect(p,u,n,a),r.clip(b),r.globalCompositeOperation="destination-in",r.drawImage(f,x,y,n,a,p,u,n,a),r.restore()}save(){this.inSMaskMode?(uy(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),uy(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,r,n,a,l,c){this.ctx.transform(t,r,n,a,l,c),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,r,n){const a=this.ctx,l=this.current;let c=l.x,d=l.y,p,u;const h=Dn(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?n.slice(0):null;for(let x=0,y=0,b=t.length;x<b;x++)switch(t[x]|0){case X1.rectangle:c=r[y++],d=r[y++];const w=r[y++],v=r[y++],A=c+w,S=d+v;a.moveTo(c,d),w===0||v===0?a.lineTo(A,S):(a.lineTo(A,d),a.lineTo(A,S),a.lineTo(c,S)),m||l.updateRectMinMax(h,[c,d,A,S]),a.closePath();break;case X1.moveTo:c=r[y++],d=r[y++],a.moveTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.lineTo:c=r[y++],d=r[y++],a.lineTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.curveTo:p=c,u=d,c=r[y+4],d=r[y+5],a.bezierCurveTo(r[y],r[y+1],r[y+2],r[y+3],c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],r[y+2],r[y+3],c,d,f),y+=6;break;case X1.curveTo2:p=c,u=d,a.bezierCurveTo(c,d,r[y],r[y+1],r[y+2],r[y+3]),l.updateCurvePathMinMax(h,p,u,c,d,r[y],r[y+1],r[y+2],r[y+3],f),c=r[y+2],d=r[y+3],y+=4;break;case X1.curveTo3:p=c,u=d,c=r[y+2],d=r[y+3],a.bezierCurveTo(r[y],r[y+1],c,d,c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],c,d,c,d,f),y+=4;break;case X1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(t=!0){const r=this.ctx,n=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof n=="object"&&n?.getPattern?(r.save(),r.strokeStyle=n.getPattern(r,this,A0(r),Tl.STROKE),this.rescaleAndStroke(!1),r.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),r.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(r.save(),r.fillStyle=n.getPattern(r,this,A0(r),Tl.FILL),l=!0);const c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(r.fill("evenodd"),this.pendingEOFill=!1):r.fill()),l&&r.restore(),t&&this.consumePath(c)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=bNt}eoClip(){this.pendingClip=Ime}beginText(){this.current.textMatrix=Wze,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,r=this.ctx;if(t===void 0){r.beginPath();return}r.save(),r.beginPath();for(const n of t)r.setTransform(...n.transform),r.translate(n.x,n.y),n.addToPath(r,n.fontSize);r.restore(),r.clip(),r.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,r){const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||$Y,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Nr("Invalid font matrix for font "+t),r<0?(r=-r,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=r,n.isType3Font)return;const l=n.loadedName||"sans-serif",c=n.systemFontInfo?.css||`"${l}", ${n.fallbackName}`;let d="normal";n.black?d="900":n.bold&&(d="bold");const p=n.italic?"italic":"normal";let u=r;r<vme?u=vme:r>Cme&&(u=Cme),this.current.fontSizeScale=r/u,this.ctx.font=`${p} ${d} ${u}px ${c}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,r){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,r){this.setLeading(-r),this.moveText(t,r)}setTextMatrix(t,r,n,a,l,c){this.current.textMatrix=[t,r,n,a,l,c],this.current.textMatrixScale=Math.hypot(t,r),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,r,n,a){const l=this.ctx,c=this.current,d=c.font,p=c.textRenderingMode,u=c.fontSize/c.fontSizeScale,h=p&il.FILL_STROKE_MASK,m=!!(p&il.ADD_TO_PATH_FLAG),f=c.patternFill&&!d.missingFile;let x;(d.disableFontFace||m||f)&&(x=d.getPathGenerator(this.commonObjs,t)),d.disableFontFace||f?(l.save(),l.translate(r,n),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===il.FILL||h===il.FILL_STROKE)&&l.fill(),(h===il.STROKE||h===il.FILL_STROKE)&&l.stroke(),l.restore()):((h===il.FILL||h===il.FILL_STROKE)&&l.fillText(t,r,n),(h===il.STROKE||h===il.FILL_STROKE)&&l.strokeText(t,r,n)),m&&(this.pendingTextPaths||=[]).push({transform:Dn(l),x:r,y:n,fontSize:u,addToPath:x})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const r=t.getImageData(0,0,10,10).data;let n=!1;for(let a=3;a<r.length;a+=4)if(r[a]>0&&r[a]<255){n=!0;break}return mi(this,"isFontSubpixelAAEnabled",n)}showText(t){const r=this.current,n=r.font;if(n.isType3Font)return this.showType3Text(t);const a=r.fontSize;if(a===0)return;const l=this.ctx,c=r.fontSizeScale,d=r.charSpacing,p=r.wordSpacing,u=r.fontDirection,h=r.textHScale*u,m=t.length,f=n.vertical,x=f?1:-1,y=n.defaultVMetrics,b=a*r.fontMatrix[0],w=r.textRenderingMode===il.FILL&&!n.disableFontFace&&!r.patternFill;l.save(),l.transform(...r.textMatrix),l.translate(r.x,r.y+r.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(r.patternFill){l.save();const L=r.fillColor.getPattern(l,this,A0(l),Tl.FILL);v=Dn(l),l.restore(),l.fillStyle=L}let A=r.lineWidth;const S=r.textMatrixScale;if(S===0||A===0){const L=r.textRenderingMode&il.FILL_STROKE_MASK;(L===il.STROKE||L===il.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(c!==1&&(l.scale(c,c),A/=c),l.lineWidth=A,n.isInvalidPDFjsFont){const L=[];let B=0;for(const D of t)L.push(D.unicode),B+=D.width;l.fillText(L.join(""),0,0),r.x+=B*b*h,l.restore(),this.compose();return}let E=0,I;for(I=0;I<m;++I){const L=t[I];if(typeof L=="number"){E+=x*L*a/1e3;continue}let B=!1;const D=(L.isSpace?p:0)+d,P=L.fontChar,T=L.accent;let R,N,K=L.width;if(f){const F=L.vmetric||y,_=-(L.vmetric?F[1]:K*.5)*b,V=F[2]*b;K=F?-F[0]:K,R=_/c,N=(E+V)/c}else R=E/c,N=0;if(n.remeasure&&K>0){const F=l.measureText(P).width*1e3/a*c;if(K<F&&this.isFontSubpixelAAEnabled){const _=K/F;B=!0,l.save(),l.scale(_,1),R/=_}else K!==F&&(R+=(K-F)/2e3*a/c)}if(this.contentVisible&&(L.isInFont||n.missingFile)){if(w&&!T)l.fillText(P,R,N);else if(this.paintChar(P,R,N,v),T){const F=R+a*T.offset.x/c,_=N-a*T.offset.y/c;this.paintChar(T.fontChar,F,_,v)}}const q=f?K*b-D*u:K*b+D*u;E+=q,B&&l.restore()}f?r.y-=E:r.x+=E*h,l.restore(),this.compose()}showType3Text(t){const r=this.ctx,n=this.current,a=n.font,l=n.fontSize,c=n.fontDirection,d=a.vertical?1:-1,p=n.charSpacing,u=n.wordSpacing,h=n.textHScale*c,m=n.fontMatrix||$Y,f=t.length,x=n.textRenderingMode===il.INVISIBLE;let y,b,w,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),r.transform(...n.textMatrix),r.translate(n.x,n.y),r.scale(h,c),y=0;y<f;++y){if(b=t[y],typeof b=="number"){v=d*b*l/1e3,this.ctx.translate(v,0),n.x+=v*h;continue}const A=(b.isSpace?u:0)+p,S=a.charProcOperatorList[b.operatorListId];if(!S){Nr(`Type3 character "${b.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=b,this.save(),r.scale(l,l),r.transform(...m),this.executeOperatorList(S),this.restore()),w=jo.applyTransform([b.width,0],m)[0]*l+A,r.translate(w,0),n.x+=w*h}r.restore(),this.processingType3=null}}setCharWidth(t,r){}setCharWidthAndBounds(t,r,n,a,l,c){this.ctx.rect(n,a,l-n,c-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let r;if(t[0]==="TilingPattern"){const n=t[1],a=this.baseTransform||Dn(this.ctx),l={createCanvasGraphics:c=>new d8(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};r=new DX(t,n,this.ctx,l,a)}else r=this._getPattern(t[1],t[2]);return r}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,r=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=pNt(this.getObject(t)),this.cachedPatterns.set(t,n)),r&&(n.matrix=r),n}shadingFill(t){if(!this.contentVisible)return;const r=this.ctx;this.save();const n=this._getPattern(t);r.fillStyle=n.getPattern(r,this,A0(r),Tl.SHADING);const a=A0(r);if(a){const{width:l,height:c}=r.canvas,[d,p,u,h]=jo.getAxialAlignedBoundingBox([0,0,l,c],a);this.ctx.fillRect(d,p,u-d,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Gi("Should not call beginInlineImage")}beginImageData(){Gi("Should not call beginImageData")}paintFormXObjectBegin(t,r){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Dn(this.ctx),r)){const n=r[2]-r[0],a=r[3]-r[1];this.ctx.rect(r[0],r[1],n,a),this.current.updateRectMinMax(Dn(this.ctx),r),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const r=this.ctx;t.isolated||IM("TODO: Support non-isolated groups."),t.knockout&&Nr("Knockout groups not supported.");const n=Dn(r);if(t.matrix&&r.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=jo.getAxialAlignedBoundingBox(t.bbox,Dn(r));const l=[0,0,r.canvas.width,r.canvas.height];a=jo.intersect(a,l)||[0,0,0,0];const c=Math.floor(a[0]),d=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-c,1),u=Math.max(Math.ceil(a[3])-d,1);this.current.startNewPathAndClipBox([0,0,p,u]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(h,p,u),f=m.context;f.translate(-c,-d),f.transform(...n),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:c,offsetY:d,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(r.setTransform(1,0,0,1,0,0),r.translate(c,d),r.save()),uy(r,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=Dn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=jo.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a);this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,r,n,a,l){if(this.#e(),g$(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const c=r[2]-r[0],d=r[3]-r[1];if(l&&this.annotationCanvasMap){n=n.slice(),n[4]-=r[0],n[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=c,r[3]=d;const[p,u]=jo.singularValueDecompose2dScale(Dn(this.ctx)),{viewportScale:h}=this,m=Math.ceil(c*this.outputScaleX*h),f=Math.ceil(d*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(m,f);const{canvas:x,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,x),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(p,0,0,-u,0,d*u),g$(this.ctx)}else g$(this.ctx),this.ctx.rect(r[0],r[1],c,d),this.ctx.clip(),this.endPath()}this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const r=t.count;t=this.getObject(t.data,t),t.count=r;const n=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=fNt(t)),a.compiled)){a.compiled(n);return}const l=this._createMaskCanvas(t),c=l.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(c,l.offsetX,l.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,r,n=0,a=0,l,c){if(!this.contentVisible)return;t=this.getObject(t.data,t);const d=this.ctx;d.save();const p=Dn(d);d.transform(r,n,a,l,0,0);const u=this._createMaskCanvas(t);d.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=c.length;h<m;h+=2){const f=jo.transform(p,[r,n,a,l,c[h],c[h+1]]),[x,y]=jo.applyTransform([0,0],f);d.drawImage(u.canvas,x,y)}d.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:c,width:d,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",d,p),m=h.context;m.save();const f=this.getObject(c,l);Eme(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?n.getPattern(m,this,A0(r),Tl.FILL):n,m.fillRect(0,0,d,p),m.restore(),r.save(),r.transform(...u),r.scale(1,-1),m$(r,h.canvas,0,0,d,p,0,-1,1,1),r.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const r=this.getObject(t);if(!r){Nr("Dependent image isn't ready yet");return}this.paintInlineImageXObject(r)}paintImageXObjectRepeat(t,r,n,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Nr("Dependent image isn't ready yet");return}const c=l.width,d=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[r,0,0,n,a[u],a[u+1]],x:0,y:0,w:c,h:d});this.paintInlineImageXObjectGroup(l,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:r,width:n,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",n,a),c=l.context;return c.filter=this.current.transferMaps,c.drawImage(r,0,0),c.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const r=t.width,n=t.height,a=this.ctx;if(this.save(),!ul){const{filter:d}=a;d!=="none"&&d!==""&&(a.filter="none")}a.scale(1/r,-1/n);let l;if(t.bitmap)l=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.cachedCanvases.getCanvas("inlineImage",r,n).context;Sme(p,t),l=this.applyTransferMapsToCanvas(p)}const c=this._scaleImage(l,A0(a));a.imageSmoothingEnabled=Lme(Dn(a),t.interpolate),m$(a,c.img,0,0,c.paintWidth,c.paintHeight,0,-n,r,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,r){if(!this.contentVisible)return;const n=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,c=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,c).context;Sme(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of r)n.save(),n.transform(...l.transform),n.scale(1,-1),m$(n,a,l.x,l.y,l.w,l.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,r){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,r){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(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===Ime?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Dn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const r=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,a)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:r,b:n,c:a,d:l}=this.ctx.getTransform();let c,d;if(n===0&&a===0){const p=Math.abs(r),u=Math.abs(l);if(p===u)if(t===0)c=d=1/p;else{const h=p*t;c=d=h<1?1/h:1}else if(t===0)c=1/p,d=1/u;else{const h=p*t,m=u*t;c=h<1?1/h:1,d=m<1?1/m:1}}else{const p=Math.abs(r*l-n*a),u=Math.hypot(r,n),h=Math.hypot(a,l);if(t===0)c=h/p,d=u/p;else{const m=t*p;c=h>m?h/m:1,d=u>m?u/m:1}}this._cachedScaleForStroking[0]=c,this._cachedScaleForStroking[1]=d}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:r}=this,{lineWidth:n}=this.current,[a,l]=this.getScaleForStroking();if(r.lineWidth=n||1,a===1&&l===1){r.stroke();return}const c=r.getLineDash();if(t&&r.save(),r.scale(a,l),c.length>0){const d=Math.max(a,l);r.setLineDash(c.map(p=>p/d)),r.lineDashOffset/=d}r.stroke(),t&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in X1)d8.prototype[e]!==void 0&&(d8.prototype[X1[e]]=d8.prototype[e]);class ov{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#e=t}static get workerSrc(){return this.#t}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#t=t}}const f$={DATA:1,ERROR:2},Ca={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function qc(e){switch(e instanceof Error||typeof e=="object"&&e!==null||Gi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new p5(e.message);case"MissingPDFException":return new d5(e.message);case"PasswordException":return new SY(e.message,e.code);case"UnexpectedResponseException":return new jM(e.message,e.status);case"UnknownErrorException":return new EY(e.message,e.details);default:return new EY(e.message,e.toString())}}class wb{constructor(t,r,n){this.sourceName=t,this.targetName=r,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const l=a.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#t(l);return}if(l.callback){const d=l.callbackId,p=this.callbackCapabilities[d];if(!p)throw new Error(`Cannot resolve callback ${d}`);if(delete this.callbackCapabilities[d],l.callback===f$.DATA)p.resolve(l.data);else if(l.callback===f$.ERROR)p.reject(qc(l.reason));else throw new Error("Unexpected callback case");return}const c=this.actionHandler[l.action];if(!c)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const d=this.sourceName,p=l.sourceName;new Promise(function(u){u(c(l.data))}).then(function(u){n.postMessage({sourceName:d,targetName:p,callback:f$.DATA,callbackId:l.callbackId,data:u})},function(u){n.postMessage({sourceName:d,targetName:p,callback:f$.ERROR,callbackId:l.callbackId,reason:qc(u)})});return}if(l.streamId){this.#e(l);return}c(l.data)},n.addEventListener("message",this._onComObjOnMessage)}on(t,r){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=r}send(t,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},n)}sendWithPromise(t,r,n){const a=this.callbackId++,l=Promise.withResolvers();this.callbackCapabilities[a]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:r},n)}catch(c){l.reject(c)}return l.promise}sendWithStream(t,r,n,a){const l=this.streamId++,c=this.sourceName,d=this.targetName,p=this.comObj;return new ReadableStream({start:u=>{const h=Promise.withResolvers();return this.streamControllers[l]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:c,targetName:d,action:t,streamId:l,data:r,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:c,targetName:d,stream:Ca.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Wa(u instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[l].cancelCall=h,this.streamControllers[l].isClosed=!0,p.postMessage({sourceName:c,targetName:d,stream:Ca.CANCEL,streamId:l,reason:qc(u)}),h.promise}},n)}#e(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this,d=this.actionHandler[t.action],p={enqueue(u,h=1,m){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),l.postMessage({sourceName:n,targetName:a,stream:Ca.ENQUEUE,streamId:r,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.CLOSE,streamId:r}),delete c.streamSinks[r])},error(u){Wa(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.ERROR,streamId:r,reason:qc(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[r]=p,new Promise(function(u){u(d(t.data,p))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,success:!0})},function(u){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,reason:qc(u)})})}#t(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this.streamControllers[r],d=this.streamSinks[r];switch(t.stream){case Ca.START_COMPLETE:t.success?c.startCall.resolve():c.startCall.reject(qc(t.reason));break;case Ca.PULL_COMPLETE:t.success?c.pullCall.resolve():c.pullCall.reject(qc(t.reason));break;case Ca.PULL:if(!d){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0});break}d.desiredSize<=0&&t.desiredSize>0&&d.sinkCapability.resolve(),d.desiredSize=t.desiredSize,new Promise(function(p){p(d.onPull?.())}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,reason:qc(p)})});break;case Ca.ENQUEUE:if(Wa(c,"enqueue should have stream controller"),c.isClosed)break;c.controller.enqueue(t.chunk);break;case Ca.CLOSE:if(Wa(c,"close should have stream controller"),c.isClosed)break;c.isClosed=!0,c.controller.close(),this.#o(c,r);break;case Ca.ERROR:Wa(c,"error should have stream controller"),c.controller.error(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL_COMPLETE:t.success?c.cancelCall.resolve():c.cancelCall.reject(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL:if(!d)break;new Promise(function(p){p(d.onCancel?.(qc(t.reason)))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,reason:qc(p)})}),d.sinkCapability.reject(qc(t.reason)),d.isCancelled=!0,delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}async#o(t,r){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class wNt{#e;#t;constructor({parsedData:t,rawData:r}){this.#e=t,this.#t=r}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return CX(this.#e)}has(t){return this.#e.has(t)}}const Sm=Symbol("INTERNAL");class vNt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:r,intent:n,usage:a}){this.#e=!!(t&Nd.DISPLAY),this.#t=!!(t&Nd.PRINT),this.name=r,this.intent=n,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:r}=this.usage;return this.#e?r?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,r,n=!1){t!==Sm&&Gi("Internal method `_setVisible` called."),this.#o=n,this.#i=r}}class CNt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,r=Nd.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const n of t.groups)this.#t.set(n.id,new vNt(r,n));if(t.baseState==="OFF")for(const n of this.#t.values())n._setVisible(Sm,!1);for(const n of t.on)this.#t.get(n)._setVisible(Sm,!0);for(const n of t.off)this.#t.get(n)._setVisible(Sm,!1);this.#o=this.getHash()}}#s(t){const r=t.length;if(r<2)return!0;const n=t[0];for(let a=1;a<r;a++){const l=t[a];let c;if(Array.isArray(l))c=this.#s(l);else if(this.#t.has(l))c=this.#t.get(l).visible;else return Nr(`Optional content group not found: ${l}`),!0;switch(n){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return n==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return IM("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Nr(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#s(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!1}return!0}return Nr(`Unknown optional content policy ${t.policy}.`),!0}return Nr(`Unknown group type ${t.type}.`),!0}setVisibility(t,r=!0){const n=this.#t.get(t);if(!n){Nr(`Optional content group not found: ${t}`);return}n._setVisible(Sm,!!r,!0),this.#e=null}setOCGState({state:t,preserveRB:r}){let n;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":n=a;continue}const l=this.#t.get(a);if(l)switch(n){case"ON":l._setVisible(Sm,!0);break;case"OFF":l._setVisible(Sm,!1);break;case"Toggle":l._setVisible(Sm,!l.visible);break}}this.#e=null}get hasInitialVisibility(){return this.#o===null||this.getHash()===this.#o}getOrder(){return this.#t.size?this.#i?this.#i.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?CX(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new eRe;for(const[r,n]of this.#t)t.update(`${r}:${n.visible}`);return this.#e=t.hexdigest()}}class ANt{constructor(t,{disableRange:r=!1,disableStream:n=!1}){Wa(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:c,contentDispositionFilename:d}=t;if(this._queuedChunks=[],this._progressiveDone=c,this._contentDispositionFilename=d,l?.length>0){const p=l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!r,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,u)=>{this._onReceiveData({begin:p,chunk:u})}),t.addProgressListener((p,u)=>{this._onProgress({loaded:p,total:u})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:r}){const n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(n),!0)});Wa(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){Wa(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new $Nt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new kNt(this,t,r);return this._pdfDataRangeTransport.requestDataRange(t,r),this._rangeReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeReaders.slice(0))r.cancel(t);this._pdfDataRangeTransport.abort()}}class $Nt{constructor(t,r,n=!1,a=null){this._stream=t,this._done=n||!1,this._filename=EX(a)?a:null,this._queuedChunks=r||[],this._loaded=0;for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class kNt{constructor(t,r,n){this._stream=t,this._begin=r,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const n of this._requests)n.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 r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function SNt(e){let t=!0,r=n("filename\\*","i").exec(e);if(r){r=r[1];let h=d(r);return h=unescape(h),h=p(h),h=u(h),l(h)}if(r=c(e),r){const h=u(r);return l(h)}if(r=n("filename","i").exec(e),r){r=r[1];let h=d(r);return h=u(h),l(h)}function n(h,m){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function a(h,m){if(h){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const f=new TextDecoder(h,{fatal:!0}),x=MM(m);m=f.decode(x),t=!1}catch{}}return m}function l(h){return t&&/[\x80-\xff]/.test(h)&&(h=a("utf-8",h),t&&(h=a("iso-8859-1",h))),h}function c(h){const m=[];let f;const x=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,b,w,v]=f;if(b=parseInt(b,10),b in m){if(b===0)break;continue}m[b]=[w,v]}const y=[];for(let b=0;b<m.length&&b in m;++b){let[w,v]=m[b];v=d(v),w&&(v=unescape(v),b===0&&(v=p(v))),y.push(v)}return y.join("")}function d(h){if(h.startsWith('"')){const m=h.slice(1).split('\\"');for(let f=0;f<m.length;++f){const x=m[f].indexOf('"');x!==-1&&(m[f]=m[f].slice(0,x),m.length=f+1),m[f]=m[f].replaceAll(/\\(.)/g,"$1")}h=m.join('"')}return h}function p(h){const m=h.indexOf("'");if(m===-1)return h;const f=h.slice(0,m),y=h.slice(m+1).replace(/^[^']*'/,"");return a(f,y)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,f,x,y){if(x==="q"||x==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(b,w){return String.fromCharCode(parseInt(w,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function PX({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:n}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*r)||n||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function TX(e){const t=e("Content-Disposition");if(t){let r=SNt(t);if(r.includes("%"))try{r=decodeURIComponent(r)}catch{}if(EX(r))return r}return null}function RM(e,t){return e===404||e===0&&t.startsWith("file:")?new d5('Missing PDF "'+t+'".'):new jM(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function rRe(e){return e===200||e===206}function iRe(e,t,r){return{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function nRe(e){const t=new Headers;for(const r in e){const n=e[r];n!==void 0&&t.append(r,n)}return t}function aRe(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Nr(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class jme{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Wa(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new ENt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new LNt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class ENt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const r=t.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._headers=nRe(this._stream.httpHeaders);const n=r.url;fetch(n,iRe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!rRe(a.status))throw RM(a.status,n);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:c,suggestedLength:d}=PX({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=d||this._contentLength,this._filename=TX(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p5("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class LNt{constructor(t,r,n){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=nRe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${r}-${n-1}`);const l=a.url;fetch(l,iRe(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!rRe(c.status))throw RM(c.status,l);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const a_=200,s_=206;function INt(e){const t=e.response;return typeof t!="string"?t:MM(t).buffer}class jNt{constructor(t,r={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null),this.withCredentials=r.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,r,n){const a={begin:t,end:r};for(const l in n)a[l]=n[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const r=new XMLHttpRequest,n=this.currXhrId++,a=this.pendingRequests[n]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const c=this.httpHeaders[l];c!==void 0&&r.setRequestHeader(l,c)}return this.isHttp&&"begin"in t&&"end"in t?(r.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=s_):a.expectedStatus=a_,r.responseType="arraybuffer",t.onError&&(r.onerror=function(l){t.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,r.send(null),n}onProgress(t,r){const n=this.pendingRequests[t];n&&n.onProgress?.(r)}onStateChange(t,r){const n=this.pendingRequests[t];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){n.onError?.(a.status);return}const l=a.status||a_;if(!(l===a_&&n.expectedStatus===s_)&&l!==n.expectedStatus){n.onError?.(a.status);return}const d=INt(a);if(l===s_){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);n.onDone({begin:parseInt(u[1],10),chunk:d})}else d?n.onDone({begin:0,chunk:d}):n.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const r=this.pendingRequests[t].xhr;delete this.pendingRequests[t],r.abort()}}class MNt{constructor(t){this._source=t,this._manager=new jNt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return Wa(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new BNt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,r){const n=new DNt(this._manager,t,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class BNt{constructor(t,r){this._manager=t;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,r=this._manager.getRequestXhr(t),n=c=>r.getResponseHeader(c),{allowRangeRequests:a,suggestedLength:l}=PX({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=TX(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=RM(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class DNt{constructor(t,r,n){this._manager=t;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(r,n,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const r=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=RM(t,this._url);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const sRe=/^file:\/\/\/[a-zA-Z]:\//;function PNt(e){const t=Rh.get("url"),r=t.parse(e);return r.protocol==="file:"||r.host?r:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(r.host||(r.protocol="file:"),r)}class TNt{constructor(t){this.source=t,this.url=PNt(t.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Wa(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new FNt(this):new zNt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=this.isFsUrl?new ONt(this,t,r):new RNt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class lRe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const r=t.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",r=>{this._error(r)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p5("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class cRe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const r=t.source;this._isStreamingSupported=!r.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",r=>{this._error(r)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ML(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class zNt extends lRe{constructor(t){super(t);const r=n=>{if(n.statusCode===404){const d=new d5(`Missing PDF "${this._url}".`);this._storedError=d,this._headersCapability.reject(d);return}this._headersCapability.resolve(),this._setReadableStream(n);const a=d=>this._readableStream.headers[d.toLowerCase()],{allowRangeRequests:l,suggestedLength:c}=PX({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=c||this._contentLength,this._filename=TX(a)};if(this._request=null,this._url.protocol==="http:"){const n=Rh.get("http");this._request=n.request(ML(this._url,t.httpHeaders),r)}else{const n=Rh.get("https");this._request=n.request(ML(this._url,t.httpHeaders),r)}this._request.on("error",n=>{this._storedError=n,this._headersCapability.reject(n)}),this._request.end()}}class RNt extends cRe{constructor(t,r,n){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const c=t.httpHeaders[l];c!==void 0&&(this._httpHeaders[l]=c)}this._httpHeaders.Range=`bytes=${r}-${n-1}`;const a=l=>{if(l.statusCode===404){const c=new d5(`Missing PDF "${this._url}".`);this._storedError=c;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=Rh.get("http");this._request=l.request(ML(this._url,this._httpHeaders),a)}else{const l=Rh.get("https");this._request=l.request(ML(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class FNt extends lRe{constructor(t){super(t);let r=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(r=r.replace(/^\//,""));const n=Rh.get("fs");n.promises.lstat(r).then(a=>{this._contentLength=a.size,this._setReadableStream(n.createReadStream(r)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new d5(`Missing PDF "${r}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class ONt extends cRe{constructor(t,r,n){super(t);let a=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=Rh.get("fs");this._setReadableStream(l.createReadStream(a,{start:r,end:n-1}))}}const NNt=1e5,rc=30,HNt=.8;let BL=class Nu{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#d=null;#p=null;#h=0;#c=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#b=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:r,viewport:n}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#p=r,this.#c=n.scale*(globalThis.devicePixelRatio||1),this.#h=n.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:c,pageY:d}=n.rawDims;this.#g=[1,0,0,-1,-c,d+l],this.#l=a,this.#n=l,Nu.#x(),H4(r,n),this.#e.promise.catch(()=>{}).then(()=>{Nu.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#d.read().then(({value:r,done:n})=>{if(n){this.#e.resolve();return}this.#s??=r.lang,Object.assign(this.#a,r.styles),this.#S(r.items),t()},this.#e.reject)};return this.#d=this.#f.getReader(),Nu.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:r=null}){const n=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(r?.(),this.#h=a,H4(this.#p,{rotation:a})),n!==this.#c){r?.(),this.#c=n;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Nu.#w(this.#s)};for(const c of this.#u)l.properties=this.#y.get(c),l.div=c,this.#$(l)}}cancel(){const t=new p5("TextLayer task cancelled.");this.#d?.cancel(t).catch(()=>{}),this.#d=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=Nu.#w(this.#s);const r=this.#u,n=this.#m;for(const a of t){if(r.length>NNt){Nr("Ignoring additional textDivs for performance reasons."),this.#o=!0;return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),a.id!==null&&this.#t.setAttribute("id",`${a.id}`),l.append(this.#t)}else a.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}n.push(a.str),this.#j(a)}}#j(t){const r=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(r);const a=jo.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const c=this.#a[t.fontName];c.vertical&&(l+=Math.PI/2);const d=this.#i&&c.fontSubstitution||c.fontFamily,p=Math.hypot(a[2],a[3]),u=p*Nu.#C(d,this.#s);let h,m;l===0?(h=a[4],m=a[5]-u):(h=a[4]+u*Math.sin(l),m=a[5]-u*Math.cos(l));const f="calc(var(--scale-factor)*",x=r.style;this.#t===this.#p?(x.left=`${(100*h/this.#l).toFixed(2)}%`,x.top=`${(100*m/this.#n).toFixed(2)}%`):(x.left=`${f}${h.toFixed(2)}px)`,x.top=`${f}${m.toFixed(2)}px)`),x.fontSize=`${f}${(Nu.#A*p).toFixed(2)}px)`,x.fontFamily=d,n.fontSize=p,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,this.#i&&(r.dataset.fontName=c.fontSubstitutionLoadedName||t.fontName),l!==0&&(n.angle=l*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const b=Math.abs(t.transform[0]),w=Math.abs(t.transform[3]);b!==w&&Math.max(b,w)/Math.min(b,w)>1.5&&(y=!0)}if(y&&(n.canvasWidth=c.vertical?t.height:t.width),this.#y.set(r,n),this.#r.div=r,this.#r.properties=n,this.#$(this.#r),n.hasText&&this.#t.append(r),n.hasEOL){const b=document.createElement("br");b.setAttribute("role","presentation"),this.#t.append(b)}}#$(t){const{div:r,properties:n,ctx:a,prevFontSize:l,prevFontFamily:c}=t,{style:d}=r;let p="";if(Nu.#A>1&&(p=`scale(${1/Nu.#A})`),n.canvasWidth!==0&&n.hasText){const{fontFamily:u}=d,{canvasWidth:h,fontSize:m}=n;(l!==m||c!==u)&&(a.font=`${m*this.#c}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(r.textContent);f>0&&(p=`scaleX(${h*this.#c/f}) ${p}`)}n.angle!==0&&(p=`rotate(${n.angle}deg) ${p}`),p.length>0&&(d.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#b.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#w(t=null){let r=this.#v.get(t||="");if(!r){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=t,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,r)}return r}static#x(){if(this.#A!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#A=t.getBoundingClientRect().height,t.remove()}static#C(t,r){const n=this.#b.get(t);if(n)return n;const a=this.#w(r),l=a.font;a.canvas.width=a.canvas.height=rc,a.font=`${rc}px ${t}`;const c=a.measureText("");let d=c.fontBoundingBoxAscent,p=Math.abs(c.fontBoundingBoxDescent);if(d){const m=d/(d+p);return this.#b.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,rc,rc),a.strokeText("g",0,0);let u=a.getImageData(0,0,rc,rc).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/rc);break}a.clearRect(0,0,rc,rc),a.strokeText("A",0,rc),u=a.getImageData(0,0,rc,rc).data,d=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){d=rc-Math.floor(m/4/rc);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=d?d/(d+p):HNt;return this.#b.set(t,h),h}};function _Nt(){Jze("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:r,...n}=arguments[0],a=Object.keys(n);a.length>0&&Nr("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new BL({textContentSource:e,container:t,viewport:r}),{textDivs:c,textContentItemsStr:d}=l;return{promise:l.render(),textDivs:c,textContentItemsStr:d}}function VNt(){Jze("`updateTextLayer`, please use `TextLayer` instead.")}class rv{static textContent(t){const r=[],n={items:r,styles:Object.create(null)};function a(l){if(!l)return;let c=null;const d=l.name;if(d==="#text")c=l.value;else if(rv.shouldBuildText(d))l?.attributes?.textContent?c=l.attributes.textContent:l.value&&(c=l.value);else return;if(c!==null&&r.push({str:c}),!!l.children)for(const p of l.children)a(p)}return a(t),n}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const UNt=65536,QNt=100,WNt=5e3,GNt=ul?iNt:QOt,YNt=ul?nNt:qze,KNt=ul?rNt:UOt,qNt=ul?aNt:Zze;function ZNt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new zX,{docId:r}=t,n=e.url?JNt(e.url):null,a=e.data?XNt(e.data):null,l=e.httpHeaders||null,c=e.withCredentials===!0,d=e.password??null,p=e.range instanceof dRe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:UNt;let h=e.worker instanceof Qd?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!SX(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,b=e.CMapReaderFactory||YNt,w=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||qNt,A=e.stopAtErrors!==!0,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,I=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!ul,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,B=typeof e.disableFontFace=="boolean"?e.disableFontFace:ul,D=e.fontExtraProperties===!0,P=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,R=e.disableRange===!0,N=e.disableStream===!0,K=e.disableAutoFetch===!0,q=e.pdfBug===!0,F=e.enableHWA===!0,_=p?p.length:e.length??NaN,V=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!ul&&!B,O=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:b===qze&&v===Zze&&x&&w&&bb(x,document.baseURI)&&bb(w,document.baseURI),z=e.canvasFactory||new GNt({ownerDocument:T,enableHWA:F}),H=e.filterFactory||new KNt({docId:r,ownerDocument:T}),ee=null;DOt(m);const Y={canvasFactory:z,filterFactory:H};if(O||(Y.cMapReaderFactory=new b({baseUrl:x,isCompressed:y}),Y.standardFontDataFactory=new v({baseUrl:w})),!h){const J={verbosity:m,port:ov.workerPort};h=J.port?Qd.fromPort(J):new Qd(J),t._worker=h}const G={docId:r,apiVersion:"4.4.168",data:a,password:d,disableAutoFetch:K,rangeChunkSize:u,length:_,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:S,disableFontFace:B,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:L,fontExtraProperties:D,useSystemFonts:V,cMapUrl:O?x:null,standardFontDataUrl:O?w:null}},X={disableFontFace:B,fontExtraProperties:D,ownerDocument:T,pdfBug:q,styleElement:ee,loadingParams:{disableAutoFetch:K,enableXfa:P}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const J=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let ae;if(p)ae=new ANt(p,{disableRange:R,disableStream:N});else if(!a){if(!n)throw new Error("getDocument - no `url` parameter provided.");ae=(me=>ul?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&bb(me.url)?new jme(me):new TNt(me):bb(me.url)?new jme(me):new MNt(me))({url:n,length:_,httpHeaders:l,withCredentials:c,rangeChunkSize:u,disableRange:R,disableStream:N})}return J.then(xe=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new wb(r,xe,h.port),de=new rHt(me,t,ae,X,Y);t._transport=de,me.send("Ready",null)})}).catch(t._capability.reject),t}function JNt(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(ul&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function XNt(e){if(ul&&typeof CE<"u"&&e instanceof CE)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e=="string")return MM(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e=="object"&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Mme(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class zX{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${zX.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let dRe=class{constructor(t,r,n=!1,a=null){this.length=t,this.initialData=r,this.progressiveDone=n,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,r){for(const n of this._rangeListeners)n(t,r)}onDataProgress(t,r){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(t,r)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const r of this._progressiveReadListeners)r(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,r){Gi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class eHt{constructor(t,r){this._pdfInfo=t,this._transport=r}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return mi(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(r)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class tHt{#e=null;#t=!1;constructor(t,r,n,a=!1){this._pageIndex=t,this._pageInfo=r,this._transport=n,this._stats=a?new xme:null,this._pdfBug=a,this.commonObjs=n.commonObjs,this.objs=new pRe,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:r=this.rotate,offsetX:n=0,offsetY:a=0,dontFlip:l=!1}={}){return new hC({viewBox:this.view,scale:t,rotation:r,offsetX:n,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return mi(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:r,intent:n="display",annotationMode:a=Fm.ENABLE,transform:l=null,background:c=null,optionalContentConfigPromise:d=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(n,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),d||=this._transport.getOptionalContentConfig(f);let y=this._intentStates.get(x);y||(y=Object.create(null),this._intentStates.set(x,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const b=!!(f&Nd.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const w=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||b)&&(this.#t=!0),this.#o(!b),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new W6({callback:w,params:{canvasContext:t,viewport:r,transform:l,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,d]).then(([S,E])=>{if(this.destroyed){w();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:E}),v.operatorListChanged()}).catch(w),A}getOperatorList({intent:t="display",annotationMode:r=Fm.ENABLE,printAnnotationStorage:n=null}={}){function a(){c.operatorList.lastChunk&&(c.opListReadCapability.resolve(c.operatorList),c.renderTasks.delete(d))}const l=this._transport.getRenderingIntent(t,r,n,!0);let c=this._intentStates.get(l.cacheKey);c||(c=Object.create(null),this._intentStates.set(l.cacheKey,c));let d;return c.opListReadCapability||(d=Object.create(null),d.operatorListChanged=a,c.opListReadCapability=Promise.withResolvers(),(c.renderTasks||=new Set).add(d),c.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),c.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:r===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>rv.textContent(n));const r=this.streamTextContent(t);return new Promise(function(n,a){function l(){c.read().then(function({value:p,done:u}){if(u){n(d);return}d.lang??=p.lang,Object.assign(d.styles,p.styles),d.items.push(...p.items),l()},a)}const c=r.getReader(),d={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(const n of r.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const r=this.#o(!1);return t&&r&&(this._stats&&=new xme),r}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},WNt),!1;for(const{renderTasks:r,operatorList:n}of this._intentStates.values())if(r.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(t,r){const n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(t))}_renderPageChunk(t,r){for(let n=0,a=t.length;n<a;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);r.operatorList.lastChunk=t.lastChunk,r.operatorList.separateAnnots=t.separateAnnots;for(const n of r.renderTasks)n.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:r,annotationStorageSerializable:n}){const{map:a,transfer:l}=n,d=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:r,annotationStorage:a},l).getReader(),p=this._intentStates.get(r);p.streamReader=d;const u=()=>{d.read().then(({value:h,done:m})=>{if(m){p.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,p),u())},h=>{if(p.streamReader=null,!this._transport.destroyed){if(p.operatorList){p.operatorList.lastChunk=!0;for(const m of p.renderTasks)m.operatorListChanged();this.#o(!0)}if(p.displayReadyCapability)p.displayReadyCapability.reject(h);else if(p.opListReadCapability)p.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:t,reason:r,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(r instanceof kX){let a=QNt;r.extraDelay>0&&r.extraDelay<1e3&&(a+=r.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:r,force:!0})},a);return}}if(t.streamReader.cancel(new p5(r.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,l]of this._intentStates)if(l===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class oHt{#e=new Set;#t=Promise.resolve();postMessage(t,r){const n={data:structuredClone(t,r?{transfer:r}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,n)})}addEventListener(t,r){this.#e.add(r)}removeEventListener(t,r){this.#e.delete(r)}terminate(){this.#e.clear()}}const N0={isWorkerDisabled:!1,fakeWorkerId:0};ul&&(N0.isWorkerDisabled=!0,ov.workerSrc||="./pdf.worker.mjs"),N0.isSameOrigin=function(e,t){let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const n=new URL(t,r);return r.origin===n.origin},N0.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class Qd{static#e;constructor({name:t=null,port:r=null,verbosity:n=POt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,r){if(Qd.#e?.has(r))throw new Error("Cannot use more than one PDFWorker per port.");(Qd.#e||=new WeakMap).set(r,this),this._initializeFromPort(r);return}this._initialize()}get promise(){return ul?Promise.all([Rh.promise,this._readyCapability.promise]):this._readyCapability.promise}#t(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new wb("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(N0.isWorkerDisabled||Qd.#o){this._setupFakeWorker();return}let{workerSrc:t}=Qd;try{N0.isSameOrigin(window.location.href,t)||(t=N0.createCDNWrapper(new URL(t,window.location).href));const r=new Worker(t,{type:"module"}),n=new wb("main","worker",r),a=()=>{l.abort(),n.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;r.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),n.on("test",d=>{if(l.abort(),this.destroyed||!d){a();return}this._messageHandler=n,this._port=r,this._webWorker=r,this.#t()}),n.on("ready",d=>{if(l.abort(),this.destroyed){a();return}try{c()}catch{this._setupFakeWorker()}});const c=()=>{const d=new Uint8Array;n.send("test",d,[d.buffer])};c();return}catch{IM("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){N0.isWorkerDisabled||(Nr("Setting up fake worker."),N0.isWorkerDisabled=!0),Qd._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new oHt;this._port=r;const n=`fake${N0.fakeWorkerId++}`,a=new wb(n+"_worker",n,r);t.setup(a,r),this._messageHandler=new wb(n,n+"_worker",r),this.#t()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Qd.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const r=this.#e?.get(t.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new Qd(t)}static get workerSrc(){if(ov.workerSrc)return ov.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return mi(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class rHt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,r,n,a,l){this.messageHandler=t,this.loadingTask=r,this.commonObjs=new pRe,this.fontLoader=new tNt({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=l.canvasFactory,this.filterFactory=l.filterFactory,this.cMapReaderFactory=l.cMapReaderFactory,this.standardFontDataFactory=l.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,r=null){const n=this.#e.get(t);if(n)return n;const a=this.messageHandler.sendWithPromise(t,r);return this.#e.set(t,a),a}get annotationStorage(){return mi(this,"annotationStorage",new BX)}getRenderingIntent(t,r=Fm.ENABLE,n=null,a=!1){let l=Nd.DISPLAY,c=LY;switch(t){case"any":l=Nd.ANY;break;case"display":break;case"print":l=Nd.PRINT;break;default:Nr(`getRenderingIntent - invalid intent: ${t}`)}switch(r){case Fm.DISABLE:l+=Nd.ANNOTATIONS_DISABLE;break;case Fm.ENABLE:break;case Fm.ENABLE_FORMS:l+=Nd.ANNOTATIONS_FORMS;break;case Fm.ENABLE_STORAGE:l+=Nd.ANNOTATIONS_STORAGE,c=(l&Nd.PRINT&&n instanceof tRe?n:this.annotationStorage).serializable;break;default:Nr(`getRenderingIntent - invalid annotationMode: ${r}`)}return a&&(l+=Nd.OPLIST),{renderingIntent:l,cacheKey:`${l}_${c.hash}`,annotationStorageSerializable:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const n of this.#t.values())t.push(n._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),BL.cleanup(),this._networkStream?.cancelAllRequests(new p5("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:r}=this;t.on("GetReader",(n,a)=>{Wa(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=l=>{this._lastProgress={loaded:l.loaded,total:l.total}},a.onPull=()=>{this._fullReader.read().then(function({value:l,done:c}){if(c){a.close();return}Wa(l instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{a.error(l)})},a.onCancel=l=>{this._fullReader.cancel(l),a.ready.catch(c=>{if(!this.destroyed)throw c})}}),t.on("ReaderHeadersReady",n=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&r.onProgress?.(this._lastProgress),l.onProgress=c=>{r.onProgress?.({loaded:c.loaded,total:c.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(n,a)=>{Wa(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(n.begin,n.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:c,done:d}){if(d){a.close();return}Wa(c instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{a.error(c)})},a.onCancel=c=>{l.cancel(c),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,r._capability.resolve(new eHt(n,this))}),t.on("DocException",function(n){let a;switch(n.name){case"PasswordException":a=new SY(n.message,n.code);break;case"InvalidPDFException":a=new Gze(n.message);break;case"MissingPDFException":a=new d5(n.message);break;case"UnexpectedResponseException":a=new jM(n.message,n.status);break;case"UnknownErrorException":a=new EY(n.message,n.details);break;default:Gi("DocException - expected a valid Error.")}r._capability.reject(a)}),t.on("PasswordRequest",n=>{if(this.#s=Promise.withResolvers(),r.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{r.onPassword(a,n.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new SY(n.message,n.code));return this.#s.promise}),t.on("DataLoaded",n=>{r.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),t.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),t.on("commonobj",([n,a,l])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(a){case"Font":const{disableFontFace:c,fontExtraProperties:d,pdfBug:p}=this._params;if("error"in l){const f=l.error;Nr(`Error during font loading: ${f}`),this.commonObjs.resolve(n,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new oNt(l,{disableFontFace:c,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!d&&h.data&&(h.data=null),this.commonObjs.resolve(n,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Wa(m,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,x]of f.objs)if(x?.ref===m)return x.dataLen?(this.commonObjs.resolve(n,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([n,a,l,c])=>{if(this.destroyed)return;const d=this.#t.get(a);if(!d.objs.has(n)){if(d._intentStates.size===0){c?.bitmap?.close();return}switch(l){case"Image":d.objs.resolve(n,c),c?.dataLen>IOt&&(d._maybeCleanupAfterRender=!0);break;case"Pattern":d.objs.resolve(n,c);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",n=>{this.destroyed||r.onProgress?.({loaded:n.loaded,total:n.total})}),t.on("FetchBuiltInCMap",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(n):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(n):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Nr("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const r=t-1,n=this.#o.get(r);if(n)return n;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const c=new tHt(r,l,this,this._params.pdfBug);return this.#t.set(r,c),c});return this.#o.set(r,a),a}getPageIndex(t){return Mme(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(r=>new CNt(r,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",r=this.#e.get(t);if(r)return r;const n=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new wNt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const r of this.#t.values())if(!r.cleanup())throw new Error(`startCleanup: Page ${r.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),BL.cleanup()}}cachedPageNumber(t){if(!Mme(t))return null;const r=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(r)??null}}const x$=Symbol("INITIAL_DATA");class pRe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:x$}}get(t,r=null){if(r){const a=this.#t(t);return a.promise.then(()=>r(a.data)),null}const n=this.#e[t];if(!n||n.data===x$)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const r=this.#e[t];return!!r&&r.data!==x$}resolve(t,r=null){const n=this.#t(t);n.data=r,n.resolve()}clear(){for(const t in this.#e){const{data:r}=this.#e[t];r?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:r}=this.#e[t];r!==x$&&(yield[t,r])}}}class iHt{#e=null;constructor(t){this.#e=t,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(t=0){this.#e.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#e.operatorList;if(!t)return!1;const{annotationCanvasMap:r}=this.#e;return t.form||t.canvas&&r?.size>0}}class W6{#e=null;static#t=new WeakSet;constructor({callback:t,params:r,objs:n,commonObjs:a,annotationCanvasMap:l,operatorList:c,pageIndex:d,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=r,this.objs=n,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=c,this._pageIndex=d,this.canvasFactory=p,this.filterFactory=u,this._pdfBug=m,this.pageColors=f,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 iHt(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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(W6.#t.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.");W6.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:a,transform:l,background:c}=this.params;this.gfx=new d8(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:c}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),W6.#t.delete(this._canvas),this.callback(t||new kX(`Rendering cancelled, page ${this._pageIndex+1}`,r))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),W6.#t.delete(this._canvas),this.callback())))}}const nHt="4.4.168",aHt="19fbc8998";function Bme(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function hy(e){return Math.max(0,Math.min(255,255*e))}class Dme{static CMYK_G([t,r,n,a]){return["G",1-Math.min(1,.3*t+.59*n+.11*r+a)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=hy(t),[t,t,t]}static G_HTML([t]){const r=Bme(t);return`#${r}${r}${r}`}static RGB_G([t,r,n]){return["G",.3*t+.59*r+.11*n]}static RGB_rgb(t){return t.map(hy)}static RGB_HTML(t){return`#${t.map(Bme).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,r,n,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,n+a),1-Math.min(1,r+a)]}static CMYK_rgb([t,r,n,a]){return[hy(1-Math.min(1,t+a)),hy(1-Math.min(1,n+a)),hy(1-Math.min(1,r+a))]}static CMYK_HTML(t){const r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([t,r,n]){const a=1-t,l=1-r,c=1-n,d=Math.min(a,l,c);return["CMYK",a,l,c,d]}}class uRe{static setupStorage(t,r,n,a,l){const c=a.getValue(r,{value:null});switch(n.name){case"textarea":if(c.value!==null&&(t.textContent=c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(c.value===n.attributes.xfaOn?t.setAttribute("checked",!0):c.value===n.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",d=>{a.setValue(r,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(c.value!==null&&t.setAttribute("value",c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})})}break;case"select":if(c.value!==null){t.setAttribute("value",c.value);for(const d of n.children)d.attributes.value===c.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}t.addEventListener("input",d=>{const p=d.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(r,{value:u})});break}}static setAttributes({html:t,element:r,storage:n=null,intent:a,linkService:l}){const{attributes:c}=r,d=t instanceof HTMLAnchorElement;c.type==="radio"&&(c.name=`${c.name}-${a}`);for(const[p,u]of Object.entries(c))if(u!=null)switch(p){case"class":u.length&&t.setAttribute(p,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!d||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}d&&l.addLinkAttributes(t,c.href,c.newWindow),n&&c.dataId&&this.setupStorage(t,c.dataId,r,n)}static render(t){const r=t.annotationStorage,n=t.linkService,a=t.xfaHtml,l=t.intent||"display",c=document.createElement(a.name);a.attributes&&this.setAttributes({html:c,element:a,intent:l,linkService:n});const d=l!=="richText",p=t.div;if(p.append(c),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}d&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);c.append(m),d&&rv.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,c]];for(;h.length>0;){const[m,f,x]=h.at(-1);if(f+1===m.children.length){h.pop();continue}const y=m.children[++h.at(-1)[1]];if(y===null)continue;const{name:b}=y;if(b==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const w=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,b):document.createElement(b);if(x.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:r,intent:l,linkService:n}),y.children?.length>0)h.push([y,-1,w]);else if(y.value){const v=document.createTextNode(y.value);d&&rv.shouldBuildText(b)&&u.push(v),w.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const r=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=r,t.div.hidden=!1}}const fC=1e3,sHt=9,_4=new WeakSet;function u2(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class lHt{static create(t){switch(t.data.annotationType){case Ha.LINK:return new hRe(t);case Ha.TEXT:return new cHt(t);case Ha.WIDGET:switch(t.data.fieldType){case"Tx":return new dHt(t);case"Btn":return t.data.radioButton?new mRe(t):t.data.checkBox?new uHt(t):new hHt(t);case"Ch":return new mHt(t);case"Sig":return new pHt(t)}return new u5(t);case Ha.POPUP:return new BY(t);case Ha.FREETEXT:return new gRe(t);case Ha.LINE:return new fHt(t);case Ha.SQUARE:return new xHt(t);case Ha.CIRCLE:return new yHt(t);case Ha.POLYLINE:return new fRe(t);case Ha.CARET:return new wHt(t);case Ha.INK:return new xRe(t);case Ha.POLYGON:return new bHt(t);case Ha.HIGHLIGHT:return new vHt(t);case Ha.UNDERLINE:return new CHt(t);case Ha.SQUIGGLY:return new AHt(t);case Ha.STRIKEOUT:return new $Ht(t);case Ha.STAMP:return new yRe(t);case Ha.FILEATTACHMENT:return new kHt(t);default:return new ua(t)}}}class ua{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=r,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,r&&(this.container=this._createContainer(n)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:r,richText:n}){return!!(t?.str||r?.str||n?.str)}get hasPopupData(){return ua._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:r}=t;r&&this.#i(r),this.#o?.popup.updateEdited(t)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#o?.popup.resetEdited(),this.#e=null)}#i(t){const{container:{style:r},data:{rect:n,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:c,pageX:d,pageY:p}}}}=this;n?.splice(0,4,...t);const{width:u,height:h}=u2(t);r.left=`${100*(t[0]-d)/l}%`,r.top=`${100*(c-t[3]+p)/c}%`,a===0?(r.width=`${100*u/l}%`,r.height=`${100*h/c}%`):this.setRotation(a)}_createContainer(t){const{data:r,parent:{page:n,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",r.id),this instanceof u5||(l.tabIndex=fC);const{style:c}=l;if(c.zIndex=this.parent.zIndex++,r.popupRef&&l.setAttribute("aria-haspopup","dialog"),r.alternativeText&&(l.title=r.alternativeText),r.noRotate&&l.classList.add("norotate"),!r.rect||this instanceof BY){const{rotation:b}=r;return!r.hasOwnCanvas&&b!==0&&this.setRotation(b,l),l}const{width:d,height:p}=u2(r.rect);if(!t&&r.borderStyle.width>0){c.borderWidth=`${r.borderStyle.width}px`;const b=r.borderStyle.horizontalCornerRadius,w=r.borderStyle.verticalCornerRadius;if(b>0||w>0){const A=`calc(${b}px * var(--scale-factor)) / calc(${w}px * var(--scale-factor))`;c.borderRadius=A}else if(this instanceof mRe){const A=`calc(${d}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;c.borderRadius=A}switch(r.borderStyle.style){case py.SOLID:c.borderStyle="solid";break;case py.DASHED:c.borderStyle="dashed";break;case py.BEVELED:Nr("Unimplemented border style: beveled");break;case py.INSET:Nr("Unimplemented border style: inset");break;case py.UNDERLINE:c.borderBottomStyle="solid";break}const v=r.borderColor||null;v?(this.#t=!0,c.borderColor=jo.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):c.borderWidth=0}const u=jo.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;c.left=`${100*(u[0]-f)/h}%`,c.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=r;return r.hasOwnCanvas||y===0?(c.width=`${100*d/h}%`,c.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,r=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:c}=u2(this.data.rect);let d,p;t%180===0?(d=100*l/n,p=100*c/a):(d=100*c/n,p=100*l/a),r.style.width=`${d}%`,r.style.height=`${p}%`,r.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(r,n,a)=>{const l=a.detail[r],c=l[0],d=l.slice(1);a.target.style[n]=Dme[`${c}_HTML`](d),this.annotationStorage.setValue(this.data.id,{[n]:Dme[`${c}_rgb`](d)})};return mi(this,"_commonActions",{display:r=>{const{display:n}=r.detail,a=n%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:n===1||n===2})},print:r=>{this.annotationStorage.setValue(this.data.id,{noPrint:!r.detail.print})},hidden:r=>{const{hidden:n}=r.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:r=>{setTimeout(()=>r.target.focus({preventScroll:!1}),0)},userName:r=>{r.target.title=r.detail.userName},readonly:r=>{r.target.disabled=r.detail.readonly},required:r=>{this._setRequired(r.target,r.detail.required)},bgColor:r=>{t("bgColor","backgroundColor",r)},fillColor:r=>{t("fillColor","backgroundColor",r)},fgColor:r=>{t("fgColor","color",r)},textColor:r=>{t("textColor","color",r)},borderColor:r=>{t("borderColor","borderColor",r)},strokeColor:r=>{t("strokeColor","borderColor",r)},rotation:r=>{const n=r.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(t,r){const n=this._commonActions;for(const a of Object.keys(r.detail))(t[a]||n[a])?.(r)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;const n=this._commonActions;for(const[a,l]of Object.entries(r)){const c=n[a];if(c){const d={detail:{[a]:l},target:t};c(d),delete r[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[r,n,a,l]=this.data.rect.map(b=>Math.fround(b));if(t.length===8){const[b,w,v,A]=t.subarray(2,6);if(a===b&&l===w&&r===v&&n===A)return}const{style:c}=this.container;let d;if(this.#t){const{borderColor:b,borderWidth:w}=c;c.borderWidth=0,d=["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 p=a-r,u=l-n,{svgFactory:h}=this,m=h.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const f=h.createElement("defs");m.append(f);const x=h.createElement("clipPath"),y=`clippath_${this.data.id}`;x.setAttribute("id",y),x.setAttribute("clipPathUnits","objectBoundingBox"),f.append(x);for(let b=2,w=t.length;b<w;b+=8){const v=t[b],A=t[b+1],S=t[b+2],E=t[b+3],I=h.createElement("rect"),L=(S-r)/p,B=(l-A)/u,D=(v-S)/p,P=(A-E)/u;I.setAttribute("x",L),I.setAttribute("y",B),I.setAttribute("width",D),I.setAttribute("height",P),x.append(I),d?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${B}" width="${D}" height="${P}"/>`)}this.#t&&(d.push("</g></svg>')"),c.backgroundImage=d.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:r}=this;t.setAttribute("aria-haspopup","dialog");const n=this.#o=new BY({data:{color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,parentRect:r.rect,borderStyle:0,id:`popup_${r.id}`,rotation:r.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){Gi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,r=null){const n=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:c,exportValues:d}of a){if(l===-1||c===r)continue;const p=typeof d=="string"?d:null,u=document.querySelector(`[data-element-id="${c}"]`);if(u&&!_4.has(u)){Nr(`_getElementsByName - element not allowed: ${c}`);continue}n.push({id:c,exportValue:p,domElement:u})}return n}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,c=a.getAttribute("data-element-id");c!==r&&_4.has(a)&&n.push({id:c,exportValue:l,domElement:a})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const r of t)r.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:r})})}}class hRe extends ua{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let a=!1;return t.url?(r.addLinkAttributes(n,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(n,t.action),a=!0):t.attachment?(this.#t(n,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(n,t.setOCGState),a=!0):t.dest?(this._bindLink(n,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),a=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&this.#e()}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),this.#e()}#t(t,r,n=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,n),!1),this.#e()}#o(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),this.#e()}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(r.actions)){const l=n.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,r){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Nr('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{n?.();const{fields:a,refs:l,include:c}=r,d=[];if(a.length!==0||l.length!==0){const h=new Set(l);for(const m of a){const f=this._fieldObjects[m]||[];for(const{id:x}of f)h.add(x)}for(const m of Object.values(this._fieldObjects))for(const f of m)h.has(f.id)===c&&d.push(f)}else for(const h of Object.values(this._fieldObjects))d.push(...h);const p=this.annotationStorage,u=[];for(const h of d){const{id:m}=h;switch(u.push(m),h.type){case"text":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}case"checkbox":case"radiobutton":{const x=h.defaultValue===h.exportValues;p.setValue(m,{value:x});break}case"combobox":case"listbox":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}default:continue}const f=document.querySelector(`[data-element-id="${m}"]`);if(f){if(!_4.has(f)){Nr(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}}class cHt extends ua{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class u5 extends ua{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return vc.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,r,n,a,l){n.includes("mouse")?t.addEventListener(n,c=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c),shift:c.shiftKey,modifier:this._getKeyModifier(c)}})}):t.addEventListener(n,c=>{if(n==="blur"){if(!r.focused||!c.relatedTarget)return;r.focused=!1}else if(n==="focus"){if(r.focused)return;r.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c)}})})}_setEventListeners(t,r,n,a){for(const[l,c]of n)(c==="Action"||this.data.actions?.[c])&&((c==="Focus"||c==="Blur")&&(r||={focused:!1}),this._setEventListener(t,r,l,c,a),c==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,r,"blur","Blur",null):c==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,r,"focus","Focus",null))}_setBackgroundColor(t){const r=this.data.backgroundColor||null;t.style.backgroundColor=r===null?"transparent":jo.makeHexColor(r[0],r[1],r[2])}_setTextStyle(t){const r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||sHt,l=t.style;let c;const d=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d),h=Math.round(u/(o_*a))||1,m=u/h;c=Math.min(a,p(m/o_))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d);c=Math.min(a,p(u/o_))}l.fontSize=`calc(${c}px * var(--scale-factor))`,l.color=jo.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(l.textAlign=r[this.data.textAlignment])}_setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",r)}}class dHt extends u5{constructor(t){const r=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:r})}setPropertyOnSiblings(t,r,n,a){const l=this.annotationStorage;for(const c of this._getElementsByName(t.name,t.id))c.domElement&&(c.domElement[r]=n),l.setValue(c.id,{[a]:n})}render(){const t=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const a=t.getValue(r,{value:this.data.fieldValue});let l=a.value||"";const c=t.getValue(r,{charLimit:this.data.maxLen}).charLimit;c&&l.length>c&&(l=l.slice(0,c));let d=a.formattedValue||this.data.textContent?.join(`
246
+ `);return t.join("")}}function bb(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return r==="http:"||r==="https:"}catch{return!1}}function Ec(e){e.preventDefault()}function Jze(e){console.log("Deprecated API usage: "+e)}let yme;class Xze{static toDateObject(t){if(!t||typeof t!="string")return null;yme||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=yme.exec(t);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(r[3],10);l=l>=1&&l<=31?l:1;let c=parseInt(r[4],10);c=c>=0&&c<=23?c:0;let d=parseInt(r[5],10);d=d>=0&&d<=59?d:0;let p=parseInt(r[6],10);p=p>=0&&p<=59?p:0;const u=r[7]||"Z";let h=parseInt(r[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(r[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(c+=h,d+=m):u==="+"&&(c-=h,d-=m),new Date(Date.UTC(n,a,l,c,d,p))}}function YOt(e,{scale:t=1,rotation:r=0}){const{width:n,height:a}=e.attributes.style,l=[0,0,parseInt(n),parseInt(a)];return new hC({viewBox:l,scale:t,rotation:r})}function LX(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(t=>parseInt(t)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Nr(`Not a valid color format: "${e}"`),[0,0,0])}function KOt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const r of e.keys()){t.style.color=r;const n=window.getComputedStyle(t).color;e.set(r,LX(n))}t.remove()}function Dn(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform();return[t,r,n,a,l,c]}function A0(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform().invertSelf();return[t,r,n,a,l,c]}function H4(e,t,r=!1,n=!0){if(t instanceof hC){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:c}=e,d=vc.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=d?`round(${p}, 1px)`:`calc(${p})`,m=d?`round(${u}, 1px)`:`calc(${u})`;!r||t.rotation%180===0?(c.width=h,c.height=m):(c.width=m,c.height=h)}n&&e.setAttribute("data-main-rotation",t.rotation)}class IX{#e=null;#t=null;#o;#i=null;constructor(t){this.#o=t}render(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const r=this.#o._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:r}),t.addEventListener("pointerdown",IX.#s,{signal:r});const n=this.#i=document.createElement("div");n.className="buttons",t.append(n);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,c=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*c}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),t}static#s(t){t.stopPropagation()}#r(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#n(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#l(t){const r=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:r}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:r}),t.addEventListener("contextmenu",Ec,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#d(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#o.editorType}-button`),this.#l(t),t.addEventListener("click",r=>{this.#o._uiManager.delete()},{signal:this.#o._uiManager._signal}),this.#i.append(t)}get#p(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#l(t),this.#i.prepend(t,this.#p)}addColorPicker(t){this.#t=t;const r=t.renderButton();this.#l(r),this.#i.prepend(r,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class qOt{#e=null;#t=null;#o;constructor(t){this.#o=t}#i(){const t=this.#t=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Ec,{signal:this.#o._signal});const r=this.#e=document.createElement("div");return r.className="buttons",t.append(r),this.#r(),t}#s(t,r){let n=0,a=0;for(const l of t){const c=l.y+l.height;if(c<n)continue;const d=l.x+(r?l.width:0);if(c>n){a=d,n=c;continue}r?d>a&&(a=d):d<a&&(a=d)}return[r?1-a:a,n]}show(t,r,n){const[a,l]=this.#s(r,n),{style:c}=this.#t||=this.#i();t.append(this.#t),c.insetInlineEnd=`${100*a}%`,c.top=`calc(${100*l}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const r=document.createElement("span");t.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=this.#o._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:n}),this.#e.append(t)}}function jL(e,t,r){for(const n of r)t.addEventListener(n,e[n].bind(e))}function ZOt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class JOt{#e=0;get id(){return`${jOt}${this.#e++}`}}class jX{#e=VOt();#t=0;#o=null;static get _isSVGFittingCanvas(){const t='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>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=t;const l=a.decode().then(()=>(n.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return mi(this,"_isSVGFittingCanvas",l)}async#i(t,r){this.#o||=new Map;let n=this.#o.get(t);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof r=="string"?(n.url=r,a=await zM(r,"blob")):a=n.file=r,a.type==="image/svg+xml"){const l=jX._isSVGFittingCanvas,c=new FileReader,d=new Image,p=new Promise((u,h)=>{d.onload=()=>{n.bitmap=d,n.isSvg=!0,u()},c.onload=async()=>{const m=n.svgUrl=c.result;d.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},d.onerror=c.onerror=h});c.readAsDataURL(a),await p}else n.bitmap=await createImageBitmap(a);n.refCounter=1}catch(a){console.error(a),n=null}return this.#o.set(t,n),n&&this.#o.set(n.id,n),n}async getFromFile(t){const{lastModified:r,name:n,size:a,type:l}=t;return this.#i(`${r}_${n}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const r=this.#o.get(t);return r?r.bitmap?(r.refCounter+=1,r):r.file?this.getFromFile(r.file):this.getFromUrl(r.url):null}getSvgUrl(t){const r=this.#o.get(t);return r?.isSvg?r.svgUrl:null}deleteId(t){this.#o||=new Map;const r=this.#o.get(t);r&&(r.refCounter-=1,r.refCounter===0&&(r.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class XOt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:r,post:n,mustExec:a,type:l=NaN,overwriteIfSameType:c=!1,keepUndo:d=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:r,post:n,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(c&&this.#e[this.#i].type===l){d&&(p.undo=this.#e[this.#i].undo),this.#e[this.#i]=p;return}const u=this.#i+1;u===this.#o?this.#e.splice(0,1):(this.#i=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(p)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:t,post:r}=this.#e[this.#i];t(),r?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:r}=this.#e[this.#i];t(),r?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class mC{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:r}=vc.platform;for(const[n,a,l={}]of t)for(const c of n){const d=c.startsWith("mac+");r&&d?(this.callbacks.set(c.slice(4),{callback:a,options:l}),this.allKeys.add(c.split("+").at(-1))):!r&&!d&&(this.callbacks.set(c,{callback:a,options:l}),this.allKeys.add(c.split("+").at(-1)))}}#e(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const r=this.buffer.join("+");return this.buffer.length=0,r}exec(t,r){if(!this.allKeys.has(r.key))return;const n=this.callbacks.get(this.#e(r));if(!n)return;const{callback:a,options:{bubbles:l=!1,args:c=[],checker:d=null}}=n;d&&!d(t,r)||(a.bind(t,...c,r)(),l||(r.stopPropagation(),r.preventDefault()))}}class MX{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return KOt(t),mi(this,"_colors",t)}convert(t){const r=LX(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(const[n,a]of this._colors)if(a.every((l,c)=>l===r[c]))return MX._colorsMapping.get(n);return r}getHexCode(t){const r=this._colors.get(t);return r?jo.makeHexColor(...r):t}}class yg{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new XOt;#d=0;#p=new Set;#h=null;#c=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#b=null;#v=new JOt;#A=!1;#k=!1;#S=null;#j=null;#$=null;#w=ai.NONE;#x=new Set;#C=null;#E=null;#L=null;#B=this.blur.bind(this);#M=this.focus.bind(this);#T=this.copy.bind(this);#D=this.cut.bind(this);#z=this.paste.bind(this);#P=this.keydown.bind(this);#U=this.keyup.bind(this);#Q=this.onEditingAction.bind(this);#_=this.onPageChanging.bind(this);#N=this.onScaleChanging.bind(this);#R=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#V=[0,0];#F=null;#H=null;#q=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=yg.prototype,r=c=>c.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&c.hasSomethingToControl(),n=(c,{target:d})=>{if(d instanceof HTMLInputElement){const{type:p}=d;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return mi(this,"_keyboardManager",new mC([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],t.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:n}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(d)&&!c.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:r}]]))}constructor(t,r,n,a,l,c,d,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=r,this.#s=n,this._eventBus=a,this._eventBus._on("editingaction",this.#Q),this._eventBus._on("pagechanging",this.#_),this._eventBus._on("scalechanging",this.#N),this._eventBus._on("rotationchanging",this.#R),this.#ie(),this.#le(),this.#Z(),this.#r=l.annotationStorage,this.#f=l.filterFactory,this.#E=c,this.#y=d||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:U8.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#e?.abort(),this.#e=null,this._signal=null,this._eventBus._off("editingaction",this.#Q),this._eventBus._off("pagechanging",this.#_),this._eventBus._off("scalechanging",this.#N),this._eventBus._off("rotationchanging",this.#R);for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#t=null,this.#x.clear(),this.#l.destroy(),this.#s?.destroy(),this.#b?.hide(),this.#b=null,this.#u&&(clearTimeout(this.#u),this.#u=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}async mlGuess(t){return this.#$?.guess(t)||null}get hasMLManager(){return!!this.#$}get hcmFilter(){return mi(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return mi(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return mi(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(r=>r.trim()))):null)}get highlightColorNames(){return mi(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#j=t}editAltText(t){this.#s?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#d=t-1}focusMainContainer(){this.#H.focus()}findParent(t,r){for(const n of this.#i.values()){const{x:a,y:l,width:c,height:d}=n.div.getBoundingClientRect();if(t>=a&&t<=a+c&&r>=l&&r<=l+d)return n}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#a.add(t)}removeShouldRescale(t){this.#a.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*U8.PDF_TO_CSS_UNITS;for(const r of this.#a)r.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#G({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:n,anchorOffset:a,focusNode:l,focusOffset:c}=r,d=r.toString(),u=this.#G(r).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){r.empty(),this.#w===ai.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:ai.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#i.values())if(m.hasTextLayer(u)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:n,anchorOffset:a,focusNode:l,focusOffset:c,text:d});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const n=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(n);a&&(this.#b||=new qOt(this),this.#b.show(n,a,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}#re(){const t=document.getSelection();if(!t||t.isCollapsed){this.#C&&(this.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}const{anchorNode:r}=t;if(r===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}if(this.#b?.hide(),this.#C=r,this.#I({hasSelectedText:!0}),!(this.#w!==ai.HIGHLIGHT&&this.#w!==ai.NONE)&&(this.#w===ai.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,c=d=>{d.type==="pointerup"&&d.button!==0||(window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),d.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}}#Y(t=""){this.#w===ai.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#oe()}#ie(){document.addEventListener("selectionchange",this.#re.bind(this),{signal:this._signal})}#ne(){const t=this._signal;window.addEventListener("focus",this.#M,{signal:t}),window.addEventListener("blur",this.#B,{signal:t})}#ae(){window.removeEventListener("focus",this.#M),window.removeEventListener("blur",this.#B)}blur(){if(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const r of this.#x)if(r.div.contains(t)){this.#S=[r,t],r._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,r]=this.#S;this.#S=null,r.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.focus()}#Z(){const t=this._signal;window.addEventListener("keydown",this.#P,{signal:t}),window.addEventListener("keyup",this.#U,{signal:t})}#se(){window.removeEventListener("keydown",this.#P),window.removeEventListener("keyup",this.#U)}#J(){const t=this._signal;document.addEventListener("copy",this.#T,{signal:t}),document.addEventListener("cut",this.#D,{signal:t}),document.addEventListener("paste",this.#z,{signal:t})}#X(){document.removeEventListener("copy",this.#T),document.removeEventListener("cut",this.#D),document.removeEventListener("paste",this.#z)}#le(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#se(),this.#X()}dragOver(t){for(const{type:r}of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const r of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const r=[];for(const n of this.#x){const a=n.serialize(!0);a&&r.push(a)}r.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:r}=t;for(const l of r.items)for(const c of this.#c)if(c.isHandlingMimeForPasting(l.type)){c.paste(l,this.currentLayer);return}let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(l){Nr(`paste: "${l.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of n){const u=a.deserialize(p);if(!u)return;l.push(u)}const c=()=>{for(const p of l)this.#ee(p);this.#te(l)},d=()=>{for(const p of l)p.remove()};this.addCommands({cmd:c,undo:d,mustExec:!0})}catch(l){Nr(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#w!==ai.NONE&&!this.isEditorHandlingKeyboard&&yg._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#I(t){Object.entries(t).some(([n,a])=>this.#K[n]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#w===ai.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[gr.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#I({isEditing:this.#w!==ai.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ae(),this.#X(),this.#I({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const r of this.#c)this.#O(r.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#d)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#d}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,r=null,n=!1){if(this.#w!==t){if(this.#w=t,t===ai.NONE){this.setEditingState(!1),this.#de();return}this.setEditingState(!0),this.#ce(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!r&&n){this.addNewEditorFromKeyboard();return}if(r){for(const a of this.#o.values())if(a.annotationElementId===r){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#w&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,r){if(this.#c){switch(t){case gr.CREATE:this.currentLayer.addNewEditor();return;case gr.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(r);break;case gr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,r),this.showAllEditors("highlight",r);break}for(const n of this.#x)n.updateParams(t,r);for(const n of this.#c)n.updateDefaultParams(t,r)}}showAllEditors(t,r,n=!1){for(const l of this.#o.values())l.editorType===t&&l.show(r);(this.#L?.get(gr.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#O([[gr.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const r of this.#i.values())t?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",t)}}#ce(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#de(){if(this.unselectAll(),this.#A){this.#A=!1;for(const t of this.#i.values())t.disable();for(const t of this.#o.values())t.disable()}}getEditors(t){const r=[];for(const n of this.#o.values())n.pageIndex===t&&r.push(n);return r}getEditor(t){return this.#o.get(t)}addEditor(t){this.#o.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{this.focusMainContainer(),this.#u=null},0)),this.#o.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#r?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#ee(t){const r=this.#i.get(t.pageIndex);r?r.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#O(t.propertiesToUpdate))}get#pe(){let t=null;for(t of this.#x);return t}updateUI(t){this.#pe===t&&this.#O(t.propertiesToUpdate)}toggleSelected(t){if(this.#x.has(t)){this.#x.delete(t),t.unselect(),this.#I({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}setSelected(t){for(const r of this.#x)r!==t&&r.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}isSelected(t){return this.#x.has(t)}get firstSelectedEditor(){return this.#x.values().next().value}unselect(t){t.unselect(),this.#x.delete(t),this.#I({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#x.size!==0}get isEnterHandled(){return this.#x.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#I({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#l.redo(),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(t){this.#l.add(t),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#W()})}#W(){if(this.#o.size===0)return!0;if(this.#o.size===1)for(const t of this.#o.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#x],r=()=>{for(const a of t)a.remove()},n=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:r,undo:n,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const r of this.#x)r.unselect();this.#x.clear();for(const r of t)r.isEmpty()||(this.#x.add(r),r.select());this.#I({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#x)t.commit();this.#te(this.#o.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#w!==ai.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(t,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=r;const[a,l]=this.#V,c=[...this.#x],d=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#V[0]=this.#V[1]=0,this.addCommands({cmd:()=>{for(const p of c)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of c)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},d);for(const p of c)p.translateInPage(t,r)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(const t of this.#x)this.#h.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);const t=this.#h;this.#h=null;let r=!1;for(const[{x:a,y:l,pageIndex:c},d]of t)d.newX=a,d.newY=l,d.newPageIndex=c,r||=a!==d.savedX||l!==d.savedY||c!==d.savedPageIndex;if(!r)return!1;const n=(a,l,c,d)=>{if(this.#o.has(a.id)){const p=this.#i.get(d);p?a._setParentAndPosition(p,l,c):(a.pageIndex=d,a.x=l,a.y=c)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:c,newPageIndex:d}]of t)n(a,l,c,d)},undo:()=>{for(const[a,{savedX:l,savedY:c,savedPageIndex:d}]of t)n(a,l,c,d)},mustExec:!0}),!0}dragSelectedEditors(t,r){if(this.#h)for(const n of this.#h.keys())n.drag(t,r)}rebuild(t){if(t.parent===null){const r=this.getLayer(t.pageIndex);r?(r.changeParent(t),r.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#w}get imageManager(){return mi(this,"imageManager",new jX)}getSelectionBoxes(t){if(!t)return null;const r=document.getSelection();for(let u=0,h=r.rangeCount;u<h;u++)if(!t.contains(r.getRangeAt(u).commonAncestorContainer))return null;const{x:n,y:a,width:l,height:c}=t.getBoundingClientRect();let d;switch(t.getAttribute("data-main-rotation")){case"90":d=(u,h,m,f)=>({x:(h-a)/c,y:1-(u+m-n)/l,width:f/c,height:m/l});break;case"180":d=(u,h,m,f)=>({x:1-(u+m-n)/l,y:1-(h+f-a)/c,width:m/l,height:f/c});break;case"270":d=(u,h,m,f)=>({x:1-(h+f-a)/c,y:(u-n)/l,width:f/c,height:m/l});break;default:d=(u,h,m,f)=>({x:(u-n)/l,y:(h-a)/c,width:m/l,height:f/c});break}const p=[];for(let u=0,h=r.rangeCount;u<h;u++){const m=r.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:b}of m.getClientRects())y===0||b===0||p.push(d(f,x,y,b))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:r}){(this.#n||=new Map).set(t,r)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const r=this.#n?.get(t.data.id);if(!r)return;const n=this.#r.getRawValue(r);n&&(this.#w===ai.NONE&&!n.hasBeenModified||n.renderAnnotationElement(t))}}class p4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){p4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const r=await p4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=r,t.setAttribute("aria-label",r),t.tabIndex="0";const n=this.#n._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:n});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:n}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:n}),await this.#l(),t}finish(){this.#o&&(this.#o.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:r}){this.#e===t&&this.#t===r||(this.#e=t,this.#t=r,this.#l())}toggle(t=!1){this.#o&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o.disabled=!t)}destroy(){this.#o?.remove(),this.#o=null,this.#i=null}async#l(){const t=this.#o;if(!t)return;if(!this.#e&&!this.#t){t.classList.remove("done"),this.#i?.remove();return}t.classList.add("done"),p4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let r=this.#i;if(!r){this.#i=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip");const a=r.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,c=this.#n._uiManager._signal;c.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#i.classList.add("show"),this.#n._reportTelemetry({action:"alt_text_tooltip"})},l)},{signal:c}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:c})}r.innerText=this.#t?await p4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,r.parentNode||t.append(r),this.#n.getImageForAltText()?.setAttribute("aria-describedby",r.id)}}class ur{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#d=this.focusout.bind(this);#p=null;#h="";#c=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#b=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=ur._zIndex++;static _borderLineWidth=-1;static _colorManager=new MX;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=ur.prototype._resizeWithKeyboard,r=yg.TRANSLATE_SMALL,n=yg.TRANSLATE_BIG;return mi(this,"_resizerKeyboardManager",new mC([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,n]}],[["Escape","mac+Escape"],ur.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===ur&&Gi("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:r,rawDims:{pageWidth:n,pageHeight:a,pageX:l,pageY:c}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,a],this.pageTranslation=[l,c];const[d,p]=this.parentDimensions;this.x=t.x/d,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return mi(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const r=new eNt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(t,r,n){if(ur._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(l=>[l,t.get(l.replaceAll(/([A-Z])/g,c=>`-${c.toLowerCase()}`))])),n?.strings)for(const l of n.strings)ur._l10nPromise.set(l,t.get(l));if(ur._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);ur._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,r){Gi("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(t*2),this.y+=this.width*t/(r*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(t*2),this.y-=this.width*t/(r*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#P(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#c?this.#c=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,r,n,a){const[l,c]=this.parentDimensions;[n,a]=this.screenToPageTranslation(n,a),this.x=(t+n)/l,this.y=(r+a)/c,this.fixAndSetPosition()}#S([t,r],n,a){[n,a]=this.screenToPageTranslation(n,a),this.x+=n/t,this.y+=a/r,this.fixAndSetPosition()}translate(t,r){this.#S(this.parentDimensions,t,r)}translateInPage(t,r){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,r),this.div.scrollIntoView({block:"nearest"})}drag(t,r){this.#a||=[this.x,this.y];const[n,a]=this.parentDimensions;if(this.x+=t/n,this.y+=r/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:l,y:c}=this;const[d,p]=this.getBaseTranslation();l+=d,c+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*c).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}getBaseTranslation(){const[t,r]=this.parentDimensions,{_borderLineWidth:n}=ur,a=n/t,l=n/r;switch(this.rotation){case 90:return[-a,l];case 180:return[a,l];case 270:return[a,-l];default:return[-a,-l]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[r,n]=this.pageDimensions;let{x:a,y:l,width:c,height:d}=this;if(c*=r,d*=n,a*=r,l*=n,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(r-c,a)),l=Math.max(0,Math.min(n-d,l));break;case 90:a=Math.max(0,Math.min(r-d,a)),l=Math.min(n,Math.max(c,l));break;case 180:a=Math.min(r,Math.max(c,a)),l=Math.min(n,Math.max(d,l));break;case 270:a=Math.min(r,Math.max(d,a)),l=Math.max(0,Math.min(n-c,l));break}this.x=a/=r,this.y=l/=n;const[p,u]=this.getBaseTranslation();a+=p,l+=u;const{style:h}=this.div;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*l).toFixed(2)}%`,this.moveInDOM()}static#j(t,r,n){switch(n){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}screenToPageTranslation(t,r){return ur.#j(t,r,this.parentRotation)}pageTranslationToScreen(t,r){return ur.#j(t,r,360-this.parentRotation)}#$(t){switch(t){case 90:{const[r,n]=this.pageDimensions;return[0,-r/n,n/r,0]}case 180:return[-1,0,0,-1];case 270:{const[r,n]=this.pageDimensions;return[0,r/n,-n/r,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[r,n]}=this,a=r*t,l=n*t;return vc.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,r){const[n,a]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*r/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:r,width:n}=t,a=n.endsWith("%"),l=!this.#s&&r.endsWith("%");if(a&&l)return;const[c,d]=this.parentDimensions;a||(t.width=`${(100*parseFloat(n)/c).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(r)/d).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#w(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],r=this._uiManager._signal;for(const n of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",n),a.setAttribute("data-resizer-name",n),a.addEventListener("pointerdown",this.#x.bind(this,n),{signal:r}),a.addEventListener("contextmenu",Ec,{signal:r}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,r){r.preventDefault();const{isMac:n}=vc.platform;if(r.button!==0||r.ctrlKey&&n)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const c=this._uiManager._signal,d={passive:!0,capture:!0,signal:c};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,d),window.addEventListener("contextmenu",Ec,{signal:c});const p=this.x,u=this.y,h=this.width,m=this.height,f=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;const y=()=>{this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=l,window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),window.removeEventListener("pointermove",a,d),window.removeEventListener("contextmenu",Ec),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:c}),window.addEventListener("blur",y,{signal:c})}#C(t,r,n,a){const l=this.x,c=this.y,d=this.width,p=this.height;l===t&&c===r&&d===n&&p===a||this.addCommands({cmd:()=>{this.width=d,this.height=p,this.x=l,this.y=c;const[u,h]=this.parentDimensions;this.setDims(u*d,h*p),this.fixAndSetPosition()},undo:()=>{this.width=n,this.height=a,this.x=t,this.y=r;const[u,h]=this.parentDimensions;this.setDims(u*n,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,r){const[n,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,p=this.height,u=ur.MIN_SIZE/n,h=ur.MIN_SIZE/a,m=V=>Math.round(V*1e4)/1e4,f=this.#$(this.rotation),x=(V,O)=>[f[0]*V+f[2]*O,f[1]*V+f[3]*O],y=this.#$(360-this.rotation),b=(V,O)=>[y[0]*V+y[2]*O,y[1]*V+y[3]*O];let w,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,w=(V,O)=>[0,0],v=(V,O)=>[V,O];break;case"topMiddle":w=(V,O)=>[V/2,0],v=(V,O)=>[V/2,O];break;case"topRight":A=!0,w=(V,O)=>[V,0],v=(V,O)=>[0,O];break;case"middleRight":S=!0,w=(V,O)=>[V,O/2],v=(V,O)=>[0,O/2];break;case"bottomRight":A=!0,w=(V,O)=>[V,O],v=(V,O)=>[0,0];break;case"bottomMiddle":w=(V,O)=>[V/2,O],v=(V,O)=>[V/2,0];break;case"bottomLeft":A=!0,w=(V,O)=>[0,O],v=(V,O)=>[V,0];break;case"middleLeft":S=!0,w=(V,O)=>[0,O/2],v=(V,O)=>[V,O/2];break}const E=w(d,p),I=v(d,p);let L=x(...I);const B=m(l+L[0]),D=m(c+L[1]);let P=1,T=1,[R,N]=this.screenToPageTranslation(r.movementX,r.movementY);if([R,N]=b(R/n,N/a),A){const V=Math.hypot(d,p);P=T=Math.max(Math.min(Math.hypot(I[0]-E[0]-R,I[1]-E[1]-N)/V,1/d,1/p),u/d,h/p)}else S?P=Math.max(u,Math.min(1,Math.abs(I[0]-E[0]-R)))/d:T=Math.max(h,Math.min(1,Math.abs(I[1]-E[1]-N)))/p;const K=m(d*P),q=m(p*T);L=x(...v(K,q));const F=B-L[0],_=D-L[1];this.width=K,this.height=q,this.x=F,this.y=_,this.setDims(n*K,a*q),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new IX(this),this.div.append(this.#p.render()),this.#o&&this.#p.addAltTextButton(await this.#o.render()),this.#p)}removeEditToolbar(){this.#p&&(this.#p.remove(),this.#p=null,this.#o?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(p4.initialize(ur._l10nPromise),this.#o=new p4(this),this.#e&&(this.#o.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}hasAltText(){return!this.#o?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#l,{signal:t}),this.div.addEventListener("focusout",this.#d,{signal:t});const[r,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/r).toFixed(2)}%`,this.div.style.maxHeight=`${(100*r/n).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),jL(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:r}=vc.platform;if(t.button!==0||t.ctrlKey&&r){t.preventDefault();return}if(this.#c=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:r}=vc.platform;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const r=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let n,a;const l=this._uiManager._signal;r&&(this.div.classList.add("moving"),n={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#b=t.clientY,a=d=>{const{clientX:p,clientY:u}=d,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#b);this.#g=p,this.#b=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,n));const c=()=>{window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),r&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,n)),this.#c=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,r,n){t.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition()}getRect(t,r,n=this.rotation){const a=this.parentScale,[l,c]=this.pageDimensions,[d,p]=this.pageTranslation,u=t/a,h=r/a,m=this.x*l,f=this.y*c,x=this.width*l,y=this.height*c;switch(n){case 0:return[m+u+d,c-f-h-y+p,m+u+x+d,c-f-h+p];case 90:return[m+h+d,c-f+u+p,m+h+y+d,c-f+u+x+p];case 180:return[m-u-x+d,c-f+h+p,m-u+d,c-f+h+y+p];case 270:return[m-h-y+d,c-f-u-x+p,m-h+d,c-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,r){const[n,a,l,c]=t,d=l-n,p=c-a;switch(this.rotation){case 0:return[n,r-c,d,p];case 90:return[n,r-a,p,d];case 180:return[l,r-a,d,p];case 270:return[l,r-c,p,d];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#u}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#l,{signal:t}),this.div?.addEventListener("focusout",this.#d,{signal:t})}rotate(t){}serialize(t=!1,r=null){Gi("An editor must be serializable")}static deserialize(t,r,n){const a=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,c]=a.pageDimensions,[d,p,u,h]=a.getRectInCurrentCoords(t.rect,c);return a.x=d/l,a.y=p/c,a.width=u/l,a.height=h/c,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#d),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#P(),this.removeEditToolbar(),this.#v){for(const t of this.#v.values())clearTimeout(t);this.#v=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#w(),this.#r.classList.remove("hidden"),jL(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#n={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const r=this.#r.children;if(!this.#t){this.#t=Array.from(r);const c=this.#M.bind(this),d=this.#T.bind(this),p=this._uiManager._signal;for(const u of this.#t){const h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",c,{signal:p}),u.addEventListener("blur",d,{signal:p}),u.addEventListener("focus",this.#D.bind(this,h),{signal:p}),ur._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const n=this.#t[0];let a=0;for(const c of r){if(c===n)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let d=0;d<a-l;d++)this.#r.append(this.#r.firstChild);else if(l>a)for(let d=0;d<l-a;d++)this.#r.firstChild.before(this.#r.lastChild);let c=0;for(const d of r){const u=this.#t[c++].getAttribute("data-resizer-name");ur._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>d.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){ur._resizerKeyboardManager.exec(this,t)}#T(t){this.#u&&t.relatedTarget?.parentNode!==this.#r&&this.#P()}#D(t){this.#h=this.#u?t:""}#z(t){if(this.#t)for(const r of this.#t)r.tabIndex=t}_resizeWithKeyboard(t,r){this.#u&&this.#E(this.#h,{movementX:t,movementY:r})}#P(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:r,savedWidth:n,savedHeight:a}=this.#n;this.#C(t,r,n,a),this.#n=null}}_stopResizingWithKeyboard(){this.#P(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#p){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#p?.show()});return}this.#p?.show()}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#p?.hide()}updateParams(t,r){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,r){this.#s=!0;const n=t/r,{style:a}=this.div;a.aspectRatio=n,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,r=!1){if(r){this.#v||=new Map;const{action:n}=t;let a=this.#v.get(n);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(n),this.#v.size===0&&(this.#v=null)},ur._telemetryTimeout),this.#v.set(n,a);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(t){let r=t.container.querySelector(".annotationContent");if(!r)r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),t.container.prepend(r);else if(r.nodeName==="CANVAS"){const n=r;r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),n.before(r)}return r}resetAnnotationElement(t){const{firstChild:r}=t.container;r.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class eNt extends ur{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const bme=3285377520,Pd=4294901760,Tu=65535;class eRe{constructor(t){this.h1=t?t&4294967295:bme,this.h2=t?t&4294967295:bme}update(t){let r,n;if(typeof t=="string"){r=new Uint8Array(t.length*2),n=0;for(let b=0,w=t.length;b<w;b++){const v=t.charCodeAt(b);v<=255?r[n++]=v:(r[n++]=v>>>8,r[n++]=v&255)}}else if(ArrayBuffer.isView(t))r=t.slice(),n=r.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=n>>2,l=n-a*4,c=new Uint32Array(r.buffer,0,a);let d=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&Tu,y=f&Tu;for(let b=0;b<a;b++)b&1?(d=c[b],d=d*m&Pd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Pd|d*y&Tu,u^=d,u=u<<13|u>>>19,u=u*5+3864292196):(p=c[b],p=p*m&Pd|p*x&Tu,p=p<<15|p>>>17,p=p*f&Pd|p*y&Tu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(d=0,l){case 3:d^=r[a*4+2]<<16;case 2:d^=r[a*4+1]<<8;case 1:d^=r[a*4],d=d*m&Pd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Pd|d*y&Tu,a&1?u^=d:h^=d}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,r=this.h2;return t^=r>>>1,t=t*3981806797&Pd|t*36045&Tu,r=r*4283543511&Pd|((r<<16|t>>>16)*2950163797&Pd)>>>16,t^=r>>>1,t=t*444984403&Pd|t*60499&Tu,r=r*3301882366&Pd|((r<<16|t>>>16)*3120437893&Pd)>>>16,t^=r>>>1,(t>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}const LY=Object.freeze({map:null,hash:"",transfer:void 0});class BX{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,r){const n=this.#t.get(t);return n===void 0?r:Object.assign(r,n)}getRawValue(t){return this.#t.get(t)}remove(t){if(this.#t.delete(t),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const r of this.#t.values())if(r instanceof ur)return;this.onAnnotationEditor(null)}}setValue(t,r){const n=this.#t.get(t);let a=!1;if(n!==void 0)for(const[l,c]of Object.entries(r))n[l]!==c&&(a=!0,n[l]=c);else a=!0,this.#t.set(t,r);a&&this.#o(),r instanceof ur&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?CX(this.#t):null}setAll(t){for(const[r,n]of Object.entries(t))this.setValue(r,n)}get size(){return this.#t.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new tRe(this)}get serializable(){if(this.#t.size===0)return LY;const t=new Map,r=new eRe,n=[],a=Object.create(null);let l=!1;for(const[c,d]of this.#t){const p=d instanceof ur?d.serialize(!1,a):d;p&&(t.set(c,p),r.update(`${c}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const c of t.values())c.bitmap&&n.push(c.bitmap);return t.size>0?{map:t,hash:r.hexdigest(),transfer:n}:LY}get editorStats(){let t=null;const r=new Map;for(const n of this.#t.values()){if(!(n instanceof ur))continue;const a=n.telemetryFinalData;if(!a)continue;const{type:l}=a;r.has(l)||r.set(l,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const c=t[l]||=new Map;for(const[d,p]of Object.entries(a)){if(d==="type")continue;let u=c.get(d);u||(u=new Map,c.set(d,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[n,a]of r)t[n]=a.computeTelemetryFinalData(t[n]);return t}}class tRe extends BX{#e;constructor(t){super();const{map:r,hash:n,transfer:a}=t.serializable,l=structuredClone(r,a?{transfer:a}:null);this.#e={map:l,hash:n,transfer:a}}get print(){Gi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class tNt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:r=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const r=this.styleElement.sheet;r.insertRule(t,r.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:r}){if(!(!t||this.#e.has(t.loadedName))){if(Wa(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:a,style:l}=t,c=new FontFace(n,a,l);this.addNativeFontFace(c);try{await c.load(),this.#e.add(n),r?.(t)}catch{Nr(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(c)}return}Gi("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const n=t.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(a){throw Nr(`Failed to load font '${n.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const r=t.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const a=this._queueLoadingCallback(n);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return mi(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(ul||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),mi(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function r(){for(Wa(!a.done,"completeRequest() cannot be called twice."),a.done=!0;n.length>0&&n[0].done;){const l=n.shift();setTimeout(l.callback,0)}}const{loadingRequests:n}=this,a={done:!1,complete:r,callback:t};return n.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return mi(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,r){function n(E,I){return E.charCodeAt(I)<<24|E.charCodeAt(I+1)<<16|E.charCodeAt(I+2)<<8|E.charCodeAt(I+3)&255}function a(E,I,L,B){const D=E.substring(0,I),P=E.substring(I+L);return D+B+P}let l,c;const d=this._document.createElement("canvas");d.width=1,d.height=1;const p=d.getContext("2d");let u=0;function h(E,I){if(++u>30){Nr("Load test font never loaded."),I();return}if(p.font="30px "+E,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){I();return}setTimeout(h.bind(null,E,I))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=a(f,976,m.length,m);const y=16,b=1482184792;let w=n(f,y);for(l=0,c=m.length-3;l<c;l+=4)w=w-b+n(m,l)|0;l<m.length&&(w=w-b+n(m+"XXX",l)|0),f=a(f,y,4,FOt(w));const v=`url(data:font/opentype;base64,${btoa(f)});`,A=`@font-face {font-family:"${m}";src:${v}}`;this.insertRule(A);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const E of[t.loadedName,m]){const I=this._document.createElement("span");I.textContent="Hi",I.style.fontFamily=E,S.append(I)}this._document.body.append(S),h(m,()=>{S.remove(),r.complete()})}}class oNt{constructor(t,{disableFontFace:r=!1,inspectFont:n=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=r===!0,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=Yze(this.data),r=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${r}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${r}}`}return this._inspectFont?.(this,r),n}getPathGenerator(t,r){if(this.compiledGlyphs[r]!==void 0)return this.compiledGlyphs[r];let n;try{n=t.get(this.loadedName+"_path_"+r)}catch(l){Nr(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(n)||n.length===0)return this.compiledGlyphs[r]=function(l,c){};const a=[];for(let l=0,c=n.length;l<c;)switch(n[l++]){case C0.BEZIER_CURVE_TO:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.bezierCurveTo(d,p,u,h,m,f)),l+=6}break;case C0.MOVE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.moveTo(d,p)),l+=2}break;case C0.LINE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.lineTo(d,p)),l+=2}break;case C0.QUADRATIC_CURVE_TO:{const[d,p,u,h]=n.slice(l,l+4);a.push(m=>m.quadraticCurveTo(d,p,u,h)),l+=4}break;case C0.RESTORE:a.push(d=>d.restore());break;case C0.SAVE:a.push(d=>d.save());break;case C0.SCALE:Wa(a.length===2,"Scale command is only valid at the third position.");break;case C0.TRANSFORM:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.transform(d,p,u,h,m,f)),l+=6}break;case C0.TRANSLATE:{const[d,p]=n.slice(l,l+2);a.push(u=>u.translate(d,p)),l+=2}break}return this.compiledGlyphs[r]=function(c,d){a[0](c),a[1](c),c.scale(d,-d);for(let p=2,u=a.length;p<u;p++)a[p](c)}}}if(ul){var IY=Promise.withResolvers(),jY=null;(async()=>{const t=await r4(()=>import("./empty-Bnn0zo5b.js").then(d=>d.e),__vite__mapDeps([0,1,2])),r=await r4(()=>import("./index-DlGmElBC.js").then(d=>d.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),n=await r4(()=>import("./index-Cy6_UeJ6.js").then(d=>d.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await r4(()=>import("./url-DtZG2OD7.js").then(d=>d.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,c;return new Map(Object.entries({fs:t,http:r,https:n,url:a,canvas:l,path2d:c}))})().then(t=>{jY=t,IY.resolve()},t=>{Nr(`loadPackages: ${t}`),jY=new Map,IY.resolve()})}class Rh{static get promise(){return IY.promise}static get(t){return jY?.get(t)}}const oRe=function(e){return Rh.get("fs").promises.readFile(e).then(r=>new Uint8Array(r))};class rNt extends BM{}class iNt extends DM{_createCanvas(t,r){return Rh.get("canvas").createCanvas(t,r)}}class nNt extends PM{_fetchData(t,r){return oRe(t).then(n=>({cMapData:n,compressionType:r}))}}class aNt extends TM{_fetchData(t){return oRe(t)}}const Tl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function MY(e,t){if(!t)return;const r=t[2]-t[0],n=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],r,n),e.clip(a)}class gC{constructor(){this.constructor===gC&&Gi("Cannot initialize BaseShadingPattern.")}getPattern(){Gi("Abstract method `getPattern` called.")}}class sNt extends gC{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let r;this._type==="axial"?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)r.addColorStop(n[0],n[1]);return r}getPattern(t,r,n,a){let l;if(a===Tl.STROKE||a===Tl.FILL){const c=r.current.getClippedPathBoundingBox(a,Dn(t))||[0,0,0,0],d=Math.ceil(c[2]-c[0])||1,p=Math.ceil(c[3]-c[1])||1,u=r.cachedCanvases.getCanvas("pattern",d,p,!0),h=u.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(-c[0],-c[1]),n=jo.transform(n,[1,0,0,1,c[0],c[1]]),h.transform(...r.baseTransform),this.matrix&&h.transform(...this.matrix),MY(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(n);l.setTransform(m)}else MY(t,this._bbox),l=this._createGradient(t);return l}}function n_(e,t,r,n,a,l,c,d){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f),p[n+1]>p[a+1]&&(f=n,n=a,a=f,f=c,c=d,d=f),p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f);const x=(p[r]+t.offsetX)*t.scaleX,y=(p[r+1]+t.offsetY)*t.scaleY,b=(p[n]+t.offsetX)*t.scaleX,w=(p[n+1]+t.offsetY)*t.scaleY,v=(p[a]+t.offsetX)*t.scaleX,A=(p[a+1]+t.offsetY)*t.scaleY;if(y>=A)return;const S=u[l],E=u[l+1],I=u[l+2],L=u[c],B=u[c+1],D=u[c+2],P=u[d],T=u[d+1],R=u[d+2],N=Math.round(y),K=Math.round(A);let q,F,_,V,O,z,H,ee;for(let Y=N;Y<=K;Y++){if(Y<w){const xe=Y<y?0:(y-Y)/(y-w);q=x-(x-b)*xe,F=S-(S-L)*xe,_=E-(E-B)*xe,V=I-(I-D)*xe}else{let xe;Y>A?xe=1:w===A?xe=0:xe=(w-Y)/(w-A),q=b-(b-v)*xe,F=L-(L-P)*xe,_=B-(B-T)*xe,V=D-(D-R)*xe}let G;Y<y?G=0:Y>A?G=1:G=(y-Y)/(y-A),O=x-(x-v)*G,z=S-(S-P)*G,H=E-(E-T)*G,ee=I-(I-R)*G;const X=Math.round(Math.min(q,O)),J=Math.round(Math.max(q,O));let ae=m*Y+X*4;for(let xe=X;xe<=J;xe++)G=(q-xe)/(q-O),G<0?G=0:G>1&&(G=1),h[ae++]=F-(F-z)*G|0,h[ae++]=_-(_-H)*G|0,h[ae++]=V-(V-ee)*G|0,h[ae++]=255}}function lNt(e,t,r){const n=t.coords,a=t.colors;let l,c;switch(t.type){case"lattice":const d=t.verticesPerRow,p=Math.floor(n.length/d)-1,u=d-1;for(l=0;l<p;l++){let h=l*d;for(let m=0;m<u;m++,h++)n_(e,r,n[h],n[h+1],n[h+d],a[h],a[h+1],a[h+d]),n_(e,r,n[h+d+1],n[h+1],n[h+d],a[h+d+1],a[h+1],a[h+d])}break;case"triangles":for(l=0,c=n.length;l<c;l+=3)n_(e,r,n[l],n[l+1],n[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class cNt extends gC{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,r,n){const d=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-d,h=Math.ceil(this._bounds[3])-p,m=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),x=u/m,y=h/f,b={coords:this._coords,colors:this._colors,offsetX:-d,offsetY:-p,scaleX:1/x,scaleY:1/y},w=m+4,v=f+4,A=n.getCanvas("mesh",w,v,!1),S=A.context,E=S.createImageData(m,f);if(r){const L=E.data;for(let B=0,D=L.length;B<D;B+=4)L[B]=r[0],L[B+1]=r[1],L[B+2]=r[2],L[B+3]=255}for(const L of this._figures)lNt(E,L,b);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:d-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,r,n,a){MY(t,this._bbox);let l;if(a===Tl.SHADING)l=jo.singularValueDecompose2dScale(Dn(t));else if(l=jo.singularValueDecompose2dScale(r.baseTransform),this.matrix){const d=jo.singularValueDecompose2dScale(this.matrix);l=[l[0]*d[0],l[1]*d[1]]}const c=this._createMeshCanvas(l,a===Tl.SHADING?null:this._background,r.cachedCanvases);return a!==Tl.SHADING&&(t.setTransform(...r.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(c.offsetX,c.offsetY),t.scale(c.scaleX,c.scaleY),t.createPattern(c.canvas,"no-repeat")}}class dNt extends gC{getPattern(){return"hotpink"}}function pNt(e){switch(e[0]){case"RadialAxial":return new sNt(e);case"Mesh":return new cNt(e);case"Dummy":return new dNt}throw new Error(`Unknown IR type: ${e[0]}`)}const wme={COLORED:1,UNCOLORED:2};class DX{static MAX_PATTERN_SIZE=3e3;constructor(t,r,n,a,l){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=r,this.ctx=n,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const r=this.operatorList,n=this.bbox,a=this.xstep,l=this.ystep,c=this.paintType,d=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;IM("TilingType: "+d);const h=n[0],m=n[1],f=n[2],x=n[3],y=jo.singularValueDecompose2dScale(this.matrix),b=jo.singularValueDecompose2dScale(this.baseTransform),w=[y[0]*b[0],y[1]*b[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,w[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,w[1]),S=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),E=S.context,I=u.createCanvasGraphics(E);I.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(I,c,p);let L=h,B=m,D=f,P=x;return h<0&&(L=0,D+=Math.abs(h)),m<0&&(B=0,P+=Math.abs(m)),E.translate(-(v.scale*L),-(A.scale*B)),I.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(I,L,B,D,P),I.baseTransform=Dn(I.ctx),I.executeOperatorList(r),I.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:B}}getSizeAndScale(t,r,n){t=Math.abs(t);const a=Math.max(DX.MAX_PATTERN_SIZE,r);let l=Math.ceil(t*n);return l>=a?l=a:n=l/t,{scale:n,size:l}}clipBbox(t,r,n,a,l){const c=a-r,d=l-n;t.ctx.rect(r,n,c,d),t.current.updateRectMinMax(Dn(t.ctx),[r,n,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,r,n){const a=t.ctx,l=t.current;switch(r){case wme.COLORED:const c=this.ctx;a.fillStyle=c.fillStyle,a.strokeStyle=c.strokeStyle,l.fillColor=c.fillStyle,l.strokeColor=c.strokeStyle;break;case wme.UNCOLORED:const d=jo.makeHexColor(n[0],n[1],n[2]);a.fillStyle=d,a.strokeStyle=d,l.fillColor=d,l.strokeColor=d;break;default:throw new ROt(`Unsupported paint type: ${r}`)}}getPattern(t,r,n,a){let l=n;a!==Tl.SHADING&&(l=jo.transform(l,r.baseTransform),this.matrix&&(l=jo.transform(l,this.matrix)));const c=this.createPatternCanvas(r);let d=new DOMMatrix(l);d=d.translate(c.offsetX,c.offsetY),d=d.scale(1/c.scaleX,1/c.scaleY);const p=t.createPattern(c.canvas,"repeat");return p.setTransform(d),p}}function uNt({src:e,srcPos:t=0,dest:r,width:n,height:a,nonBlackColor:l=4294967295,inverseDecode:c=!1}){const d=vc.isLittleEndian?4278190080:255,[p,u]=c?[l,d]:[d,l],h=n>>3,m=n&7,f=e.length;r=new Uint32Array(r.buffer);let x=0;for(let y=0;y<a;y++){for(const w=t+h;t<w;t++){const v=t<f?e[t]:255;r[x++]=v&128?u:p,r[x++]=v&64?u:p,r[x++]=v&32?u:p,r[x++]=v&16?u:p,r[x++]=v&8?u:p,r[x++]=v&4?u:p,r[x++]=v&2?u:p,r[x++]=v&1?u:p}if(m===0)continue;const b=t<f?e[t++]:255;for(let w=0;w<m;w++)r[x++]=b&1<<7-w?u:p}return{srcPos:t,destPos:x}}const vme=16,Cme=100,hNt=15,Ame=10,$me=1e3,dc=16;function mNt(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(n,a){t.translate(n,a),this.__originalTranslate(n,a)},e.scale=function(n,a){t.scale(n,a),this.__originalScale(n,a)},e.transform=function(n,a,l,c,d,p){t.transform(n,a,l,c,d,p),this.__originalTransform(n,a,l,c,d,p)},e.setTransform=function(n,a,l,c,d,p){t.setTransform(n,a,l,c,d,p),this.__originalSetTransform(n,a,l,c,d,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(n){t.rotate(n),this.__originalRotate(n)},e.clip=function(n){t.clip(n),this.__originalClip(n)},e.moveTo=function(r,n){t.moveTo(r,n),this.__originalMoveTo(r,n)},e.lineTo=function(r,n){t.lineTo(r,n),this.__originalLineTo(r,n)},e.bezierCurveTo=function(r,n,a,l,c,d){t.bezierCurveTo(r,n,a,l,c,d),this.__originalBezierCurveTo(r,n,a,l,c,d)},e.rect=function(r,n,a,l){t.rect(r,n,a,l),this.__originalRect(r,n,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class gNt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,r,n){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,r,n)):(a=this.canvasFactory.create(r,n),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const r=this.cache[t];this.canvasFactory.destroy(r),delete this.cache[t]}}}function m$(e,t,r,n,a,l,c,d,p,u){const[h,m,f,x,y,b]=Dn(e);if(m===0&&f===0){const A=c*h+y,S=Math.round(A),E=d*x+b,I=Math.round(E),L=(c+p)*h+y,B=Math.abs(Math.round(L)-S)||1,D=(d+u)*x+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,I),e.drawImage(t,r,n,a,l,0,0,B,P),e.setTransform(h,m,f,x,y,b),[B,P]}if(h===0&&x===0){const A=d*f+y,S=Math.round(A),E=c*m+b,I=Math.round(E),L=(d+u)*f+y,B=Math.abs(Math.round(L)-S)||1,D=(c+p)*m+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,I),e.drawImage(t,r,n,a,l,0,0,P,B),e.setTransform(h,m,f,x,y,b),[P,B]}e.drawImage(t,r,n,a,l,c,d,p,u);const w=Math.hypot(h,m),v=Math.hypot(f,x);return[w*p,v*u]}function fNt(e){const{width:t,height:r}=e;if(t>$me||r>$me)return null;const n=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let c=new Uint8Array(l*(r+1)),d,p,u;const h=t+7&-8;let m=new Uint8Array(h*r),f=0;for(const v of e.data){let A=128;for(;A>0;)m[f++]=v&A?0:255,A>>=1}let x=0;for(f=0,m[f]!==0&&(c[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(c[p]=2,++x),d=1;d<r;d++){f=d*h,u=d*l,m[f-h]!==m[f]&&(c[u]=m[f]?1:8,++x);let v=(m[f]?4:0)+(m[f-h]?8:0);for(p=1;p<t;p++)v=(v>>2)+(m[f+1]?4:0)+(m[f-h+1]?8:0),a[v]&&(c[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(c[u+p]=m[f]?2:4,++x),x>n)return null}for(f=h*(r-1),u=d*l,m[f]!==0&&(c[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(c[u+p]=4,++x),x>n)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),b=new Path2D;for(d=0;x&&d<=r;d++){let v=d*l;const A=v+t;for(;v<A&&!c[v];)v++;if(v===A)continue;b.moveTo(v%l,d);const S=v;let E=c[v];do{const I=y[E];do v+=I;while(!c[v]);const L=c[v];L!==5&&L!==10?(E=L,c[v]=0):(E=L&51*E>>4,c[v]&=E>>2|E<<2),b.lineTo(v%l,v/l|0),c[v]||--x}while(S!==v);--d}return m=null,c=null,function(v){v.save(),v.scale(1/t,-1/r),v.translate(0,-r),v.fill(b),v.beginPath(),v.restore()}}class kme{constructor(t,r){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Wze,this.textMatrixScale=1,this.fontMatrix=$Y,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=il.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,r])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,r){this.x=t,this.y=r}updatePathMinMax(t,r,n){[r,n]=jo.applyTransform([r,n],t),this.minX=Math.min(this.minX,r),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,r),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,r){const n=jo.applyTransform(r,t),a=jo.applyTransform(r.slice(2),t),l=jo.applyTransform([r[0],r[3]],t),c=jo.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,n[0],a[0],l[0],c[0]),this.minY=Math.min(this.minY,n[1],a[1],l[1],c[1]),this.maxX=Math.max(this.maxX,n[0],a[0],l[0],c[0]),this.maxY=Math.max(this.maxY,n[1],a[1],l[1],c[1])}updateScalingPathMinMax(t,r){jo.scaleMinMax(t,r),this.minX=Math.min(this.minX,r[0]),this.minY=Math.min(this.minY,r[1]),this.maxX=Math.max(this.maxX,r[2]),this.maxY=Math.max(this.maxY,r[3])}updateCurvePathMinMax(t,r,n,a,l,c,d,p,u,h){const m=jo.bezierBoundingBox(r,n,a,l,c,d,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=Tl.FILL,r=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===Tl.STROKE){r||Gi("Stroke bounding box must include transform.");const a=jo.singularValueDecompose2dScale(r),l=a[0]*this.lineWidth/2,c=a[1]*this.lineWidth/2;n[0]-=l,n[1]-=c,n[2]+=l,n[3]+=c}return n}updateClipFromPath(){const t=jo.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Tl.FILL,r=null){return jo.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}function Sme(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0,u;const h=t.data,m=d.data;let f,x,y,b;if(t.kind===iE.GRAYSCALE_1BPP){const w=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=n+7>>3,E=4294967295,I=vc.isLittleEndian?4278190080:255;for(f=0;f<c;f++){for(y=f<l?dc:a,u=0,x=0;x<y;x++){const L=w-p;let B=0;const D=L>S?n:L*8-7,P=D&-8;let T=0,R=0;for(;B<P;B+=8)R=h[p++],v[u++]=R&128?E:I,v[u++]=R&64?E:I,v[u++]=R&32?E:I,v[u++]=R&16?E:I,v[u++]=R&8?E:I,v[u++]=R&4?E:I,v[u++]=R&2?E:I,v[u++]=R&1?E:I;for(;B<D;B++)T===0&&(R=h[p++],T=128),v[u++]=R&T?E:I,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(d,0,f*dc)}}else if(t.kind===iE.RGBA_32BPP){for(x=0,b=n*dc*4,f=0;f<l;f++)m.set(h.subarray(p,p+b)),p+=b,e.putImageData(d,0,x),x+=dc;f<c&&(b=n*a*4,m.set(h.subarray(p,p+b)),e.putImageData(d,0,x))}else if(t.kind===iE.RGB_24BPP)for(y=dc,b=n*y,f=0;f<c;f++){for(f>=l&&(y=a,b=n*y),u=0,x=b;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(d,0,f*dc)}else throw new Error(`bad image kind: ${t.kind}`)}function Eme(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0;const u=t.data,h=d.data;for(let m=0;m<c;m++){const f=m<l?dc:a;({srcPos:p}=uNt({src:u,srcPos:p,dest:h,width:n,height:f,nonBlackColor:0})),e.putImageData(d,0,m*dc)}}function uy(e,t){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function g$(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0),!ul){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function Lme(e,t){if(t)return!0;const r=jo.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*U8.PDF_TO_CSS_UNITS);return r[0]<=n&&r[1]<=n}const xNt=["butt","round","square"],yNt=["miter","round","bevel"],bNt={},Ime={};class d8{constructor(t,r,n,a,l,{optionalContentConfig:c,markedContentStack:d=null},p,u){this.ctx=t,this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,this.canvasFactory=a,this.filterFactory=l,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=d||[],this.optionalContentConfig=c,this.cachedCanvases=new gNt(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,r=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):r}beginDrawing({transform:t,viewport:r,transparency:n=!1,background:a=null}){const l=this.ctx.canvas.width,c=this.ctx.canvas.height,d=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,c),this.ctx.fillStyle=d,n){const p=this.cachedCanvases.getCanvas("transparent",l,c);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...Dn(this.compositeCtx))}this.ctx.save(),g$(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=Dn(this.ctx)}executeOperatorList(t,r,n,a){const l=t.argsArray,c=t.fnArray;let d=r||0;const p=l.length;if(p===d)return d;const u=p-d>Ame&&typeof n=="function",h=u?Date.now()+hNt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&d===a.nextBreakPoint)return a.breakIt(d,n),d;if(y=c[d],y!==X1.dependency)this[y].apply(this,l[d]);else for(const b of l[d]){const w=b.startsWith("g_")?f:x;if(!w.has(b))return w.get(b,n),d}if(d++,d===p)return d;if(u&&++m>Ame){if(Date.now()>h)return n(),d;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const r of t.values())typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&(r.width=r.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const r=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(t,r){const n=t.width,a=t.height;let l=Math.max(Math.hypot(r[0],r[1]),1),c=Math.max(Math.hypot(r[2],r[3]),1),d=n,p=a,u="prescale1",h,m;for(;l>2&&d>1||c>2&&p>1;){let f=d,x=p;l>2&&d>1&&(f=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d/2),l/=d/f),c>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,c/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,d,p,0,0,f,x),t=h.canvas,d=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:d,paintHeight:p}}_createMaskCanvas(t){const r=this.ctx,{width:n,height:a}=t,l=this.current.fillColor,c=this.current.patternFill,d=Dn(r);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;u=JSON.stringify(c?d:[d.slice(0,4),l]),p=this._cachedBitmapsMap.get(D),p||(p=new Map,this._cachedBitmapsMap.set(D,p));const P=p.get(u);if(P&&!c){const T=Math.round(Math.min(d[0],d[2])+d[4]),R=Math.round(Math.min(d[1],d[3])+d[5]);return{canvas:P,offsetX:T,offsetY:R}}h=P}h||(m=this.cachedCanvases.getCanvas("maskCanvas",n,a),Eme(m.context,t));let f=jo.transform(d,[1/n,0,0,-1/a,0,0]);f=jo.transform(f,[1,0,0,1,0,-a]);const[x,y,b,w]=jo.getAxialAlignedBoundingBox([0,0,n,a],f),v=Math.round(b-x)||1,A=Math.round(w-y)||1,S=this.cachedCanvases.getCanvas("fillCanvas",v,A),E=S.context,I=x,L=y;E.translate(-I,-L),E.transform(...f),h||(h=this._scaleImage(m.canvas,A0(E)),h=h.img,p&&c&&p.set(u,h)),E.imageSmoothingEnabled=Lme(Dn(E),t.interpolate),m$(E,h,0,0,h.width,h.height,0,0,n,a),E.globalCompositeOperation="source-in";const B=jo.transform(A0(E),[1,0,0,1,-I,-L]);return E.fillStyle=c?l.getPattern(r,this,B,Tl.FILL):l,E.fillRect(0,0,n,a),p&&!c&&(this.cachedCanvases.delete("fillCanvas"),p.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(I),offsetY:Math.round(L)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=xNt[t]}setLineJoin(t){this.ctx.lineJoin=yNt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,r){const n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(t),n.lineDashOffset=r)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[r,n]of t)switch(r){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,r=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,t,r);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...Dn(this.suspendedCtx)),uy(this.suspendedCtx,l),mNt(l,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),uy(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,r,n,a){const l=a[0],c=a[1],d=a[2]-l,p=a[3]-c;d===0||p===0||(this.genericComposeSMask(r.context,n,d,p,r.subtype,r.backdrop,r.transferMap,l,c,r.offsetX,r.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}genericComposeSMask(t,r,n,a,l,c,d,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(c){if(x<0||y<0||x+n>f.width||y+a>f.height){const w=this.cachedCanvases.getCanvas("maskExtension",n,a),v=w.context;v.drawImage(f,-x,-y),c.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=jo.makeHexColor(...c),v.fillRect(0,0,n,a),v.globalCompositeOperation="source-over"),f=w.canvas,x=y=0}else if(c.some(w=>w!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(x,y,n,a),t.clip(w),t.globalCompositeOperation="destination-atop",t.fillStyle=jo.makeHexColor(...c),t.fillRect(x,y,n,a),t.restore()}}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),l==="Alpha"&&d?r.filter=this.filterFactory.addAlphaFilter(d):l==="Luminosity"&&(r.filter=this.filterFactory.addLuminosityFilter(d));const b=new Path2D;b.rect(p,u,n,a),r.clip(b),r.globalCompositeOperation="destination-in",r.drawImage(f,x,y,n,a,p,u,n,a),r.restore()}save(){this.inSMaskMode?(uy(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),uy(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,r,n,a,l,c){this.ctx.transform(t,r,n,a,l,c),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,r,n){const a=this.ctx,l=this.current;let c=l.x,d=l.y,p,u;const h=Dn(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?n.slice(0):null;for(let x=0,y=0,b=t.length;x<b;x++)switch(t[x]|0){case X1.rectangle:c=r[y++],d=r[y++];const w=r[y++],v=r[y++],A=c+w,S=d+v;a.moveTo(c,d),w===0||v===0?a.lineTo(A,S):(a.lineTo(A,d),a.lineTo(A,S),a.lineTo(c,S)),m||l.updateRectMinMax(h,[c,d,A,S]),a.closePath();break;case X1.moveTo:c=r[y++],d=r[y++],a.moveTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.lineTo:c=r[y++],d=r[y++],a.lineTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.curveTo:p=c,u=d,c=r[y+4],d=r[y+5],a.bezierCurveTo(r[y],r[y+1],r[y+2],r[y+3],c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],r[y+2],r[y+3],c,d,f),y+=6;break;case X1.curveTo2:p=c,u=d,a.bezierCurveTo(c,d,r[y],r[y+1],r[y+2],r[y+3]),l.updateCurvePathMinMax(h,p,u,c,d,r[y],r[y+1],r[y+2],r[y+3],f),c=r[y+2],d=r[y+3],y+=4;break;case X1.curveTo3:p=c,u=d,c=r[y+2],d=r[y+3],a.bezierCurveTo(r[y],r[y+1],c,d,c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],c,d,c,d,f),y+=4;break;case X1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(t=!0){const r=this.ctx,n=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof n=="object"&&n?.getPattern?(r.save(),r.strokeStyle=n.getPattern(r,this,A0(r),Tl.STROKE),this.rescaleAndStroke(!1),r.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),r.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(r.save(),r.fillStyle=n.getPattern(r,this,A0(r),Tl.FILL),l=!0);const c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(r.fill("evenodd"),this.pendingEOFill=!1):r.fill()),l&&r.restore(),t&&this.consumePath(c)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=bNt}eoClip(){this.pendingClip=Ime}beginText(){this.current.textMatrix=Wze,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,r=this.ctx;if(t===void 0){r.beginPath();return}r.save(),r.beginPath();for(const n of t)r.setTransform(...n.transform),r.translate(n.x,n.y),n.addToPath(r,n.fontSize);r.restore(),r.clip(),r.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,r){const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||$Y,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Nr("Invalid font matrix for font "+t),r<0?(r=-r,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=r,n.isType3Font)return;const l=n.loadedName||"sans-serif",c=n.systemFontInfo?.css||`"${l}", ${n.fallbackName}`;let d="normal";n.black?d="900":n.bold&&(d="bold");const p=n.italic?"italic":"normal";let u=r;r<vme?u=vme:r>Cme&&(u=Cme),this.current.fontSizeScale=r/u,this.ctx.font=`${p} ${d} ${u}px ${c}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,r){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,r){this.setLeading(-r),this.moveText(t,r)}setTextMatrix(t,r,n,a,l,c){this.current.textMatrix=[t,r,n,a,l,c],this.current.textMatrixScale=Math.hypot(t,r),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,r,n,a){const l=this.ctx,c=this.current,d=c.font,p=c.textRenderingMode,u=c.fontSize/c.fontSizeScale,h=p&il.FILL_STROKE_MASK,m=!!(p&il.ADD_TO_PATH_FLAG),f=c.patternFill&&!d.missingFile;let x;(d.disableFontFace||m||f)&&(x=d.getPathGenerator(this.commonObjs,t)),d.disableFontFace||f?(l.save(),l.translate(r,n),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===il.FILL||h===il.FILL_STROKE)&&l.fill(),(h===il.STROKE||h===il.FILL_STROKE)&&l.stroke(),l.restore()):((h===il.FILL||h===il.FILL_STROKE)&&l.fillText(t,r,n),(h===il.STROKE||h===il.FILL_STROKE)&&l.strokeText(t,r,n)),m&&(this.pendingTextPaths||=[]).push({transform:Dn(l),x:r,y:n,fontSize:u,addToPath:x})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const r=t.getImageData(0,0,10,10).data;let n=!1;for(let a=3;a<r.length;a+=4)if(r[a]>0&&r[a]<255){n=!0;break}return mi(this,"isFontSubpixelAAEnabled",n)}showText(t){const r=this.current,n=r.font;if(n.isType3Font)return this.showType3Text(t);const a=r.fontSize;if(a===0)return;const l=this.ctx,c=r.fontSizeScale,d=r.charSpacing,p=r.wordSpacing,u=r.fontDirection,h=r.textHScale*u,m=t.length,f=n.vertical,x=f?1:-1,y=n.defaultVMetrics,b=a*r.fontMatrix[0],w=r.textRenderingMode===il.FILL&&!n.disableFontFace&&!r.patternFill;l.save(),l.transform(...r.textMatrix),l.translate(r.x,r.y+r.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(r.patternFill){l.save();const L=r.fillColor.getPattern(l,this,A0(l),Tl.FILL);v=Dn(l),l.restore(),l.fillStyle=L}let A=r.lineWidth;const S=r.textMatrixScale;if(S===0||A===0){const L=r.textRenderingMode&il.FILL_STROKE_MASK;(L===il.STROKE||L===il.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(c!==1&&(l.scale(c,c),A/=c),l.lineWidth=A,n.isInvalidPDFjsFont){const L=[];let B=0;for(const D of t)L.push(D.unicode),B+=D.width;l.fillText(L.join(""),0,0),r.x+=B*b*h,l.restore(),this.compose();return}let E=0,I;for(I=0;I<m;++I){const L=t[I];if(typeof L=="number"){E+=x*L*a/1e3;continue}let B=!1;const D=(L.isSpace?p:0)+d,P=L.fontChar,T=L.accent;let R,N,K=L.width;if(f){const F=L.vmetric||y,_=-(L.vmetric?F[1]:K*.5)*b,V=F[2]*b;K=F?-F[0]:K,R=_/c,N=(E+V)/c}else R=E/c,N=0;if(n.remeasure&&K>0){const F=l.measureText(P).width*1e3/a*c;if(K<F&&this.isFontSubpixelAAEnabled){const _=K/F;B=!0,l.save(),l.scale(_,1),R/=_}else K!==F&&(R+=(K-F)/2e3*a/c)}if(this.contentVisible&&(L.isInFont||n.missingFile)){if(w&&!T)l.fillText(P,R,N);else if(this.paintChar(P,R,N,v),T){const F=R+a*T.offset.x/c,_=N-a*T.offset.y/c;this.paintChar(T.fontChar,F,_,v)}}const q=f?K*b-D*u:K*b+D*u;E+=q,B&&l.restore()}f?r.y-=E:r.x+=E*h,l.restore(),this.compose()}showType3Text(t){const r=this.ctx,n=this.current,a=n.font,l=n.fontSize,c=n.fontDirection,d=a.vertical?1:-1,p=n.charSpacing,u=n.wordSpacing,h=n.textHScale*c,m=n.fontMatrix||$Y,f=t.length,x=n.textRenderingMode===il.INVISIBLE;let y,b,w,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),r.transform(...n.textMatrix),r.translate(n.x,n.y),r.scale(h,c),y=0;y<f;++y){if(b=t[y],typeof b=="number"){v=d*b*l/1e3,this.ctx.translate(v,0),n.x+=v*h;continue}const A=(b.isSpace?u:0)+p,S=a.charProcOperatorList[b.operatorListId];if(!S){Nr(`Type3 character "${b.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=b,this.save(),r.scale(l,l),r.transform(...m),this.executeOperatorList(S),this.restore()),w=jo.applyTransform([b.width,0],m)[0]*l+A,r.translate(w,0),n.x+=w*h}r.restore(),this.processingType3=null}}setCharWidth(t,r){}setCharWidthAndBounds(t,r,n,a,l,c){this.ctx.rect(n,a,l-n,c-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let r;if(t[0]==="TilingPattern"){const n=t[1],a=this.baseTransform||Dn(this.ctx),l={createCanvasGraphics:c=>new d8(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};r=new DX(t,n,this.ctx,l,a)}else r=this._getPattern(t[1],t[2]);return r}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,r=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=pNt(this.getObject(t)),this.cachedPatterns.set(t,n)),r&&(n.matrix=r),n}shadingFill(t){if(!this.contentVisible)return;const r=this.ctx;this.save();const n=this._getPattern(t);r.fillStyle=n.getPattern(r,this,A0(r),Tl.SHADING);const a=A0(r);if(a){const{width:l,height:c}=r.canvas,[d,p,u,h]=jo.getAxialAlignedBoundingBox([0,0,l,c],a);this.ctx.fillRect(d,p,u-d,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Gi("Should not call beginInlineImage")}beginImageData(){Gi("Should not call beginImageData")}paintFormXObjectBegin(t,r){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Dn(this.ctx),r)){const n=r[2]-r[0],a=r[3]-r[1];this.ctx.rect(r[0],r[1],n,a),this.current.updateRectMinMax(Dn(this.ctx),r),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const r=this.ctx;t.isolated||IM("TODO: Support non-isolated groups."),t.knockout&&Nr("Knockout groups not supported.");const n=Dn(r);if(t.matrix&&r.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=jo.getAxialAlignedBoundingBox(t.bbox,Dn(r));const l=[0,0,r.canvas.width,r.canvas.height];a=jo.intersect(a,l)||[0,0,0,0];const c=Math.floor(a[0]),d=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-c,1),u=Math.max(Math.ceil(a[3])-d,1);this.current.startNewPathAndClipBox([0,0,p,u]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(h,p,u),f=m.context;f.translate(-c,-d),f.transform(...n),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:c,offsetY:d,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(r.setTransform(1,0,0,1,0,0),r.translate(c,d),r.save()),uy(r,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=Dn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=jo.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a);this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,r,n,a,l){if(this.#e(),g$(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const c=r[2]-r[0],d=r[3]-r[1];if(l&&this.annotationCanvasMap){n=n.slice(),n[4]-=r[0],n[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=c,r[3]=d;const[p,u]=jo.singularValueDecompose2dScale(Dn(this.ctx)),{viewportScale:h}=this,m=Math.ceil(c*this.outputScaleX*h),f=Math.ceil(d*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(m,f);const{canvas:x,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,x),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(p,0,0,-u,0,d*u),g$(this.ctx)}else g$(this.ctx),this.ctx.rect(r[0],r[1],c,d),this.ctx.clip(),this.endPath()}this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const r=t.count;t=this.getObject(t.data,t),t.count=r;const n=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=fNt(t)),a.compiled)){a.compiled(n);return}const l=this._createMaskCanvas(t),c=l.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(c,l.offsetX,l.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,r,n=0,a=0,l,c){if(!this.contentVisible)return;t=this.getObject(t.data,t);const d=this.ctx;d.save();const p=Dn(d);d.transform(r,n,a,l,0,0);const u=this._createMaskCanvas(t);d.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=c.length;h<m;h+=2){const f=jo.transform(p,[r,n,a,l,c[h],c[h+1]]),[x,y]=jo.applyTransform([0,0],f);d.drawImage(u.canvas,x,y)}d.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:c,width:d,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",d,p),m=h.context;m.save();const f=this.getObject(c,l);Eme(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?n.getPattern(m,this,A0(r),Tl.FILL):n,m.fillRect(0,0,d,p),m.restore(),r.save(),r.transform(...u),r.scale(1,-1),m$(r,h.canvas,0,0,d,p,0,-1,1,1),r.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const r=this.getObject(t);if(!r){Nr("Dependent image isn't ready yet");return}this.paintInlineImageXObject(r)}paintImageXObjectRepeat(t,r,n,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Nr("Dependent image isn't ready yet");return}const c=l.width,d=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[r,0,0,n,a[u],a[u+1]],x:0,y:0,w:c,h:d});this.paintInlineImageXObjectGroup(l,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:r,width:n,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",n,a),c=l.context;return c.filter=this.current.transferMaps,c.drawImage(r,0,0),c.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const r=t.width,n=t.height,a=this.ctx;if(this.save(),!ul){const{filter:d}=a;d!=="none"&&d!==""&&(a.filter="none")}a.scale(1/r,-1/n);let l;if(t.bitmap)l=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.cachedCanvases.getCanvas("inlineImage",r,n).context;Sme(p,t),l=this.applyTransferMapsToCanvas(p)}const c=this._scaleImage(l,A0(a));a.imageSmoothingEnabled=Lme(Dn(a),t.interpolate),m$(a,c.img,0,0,c.paintWidth,c.paintHeight,0,-n,r,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,r){if(!this.contentVisible)return;const n=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,c=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,c).context;Sme(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of r)n.save(),n.transform(...l.transform),n.scale(1,-1),m$(n,a,l.x,l.y,l.w,l.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,r){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,r){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(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===Ime?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Dn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const r=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,a)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:r,b:n,c:a,d:l}=this.ctx.getTransform();let c,d;if(n===0&&a===0){const p=Math.abs(r),u=Math.abs(l);if(p===u)if(t===0)c=d=1/p;else{const h=p*t;c=d=h<1?1/h:1}else if(t===0)c=1/p,d=1/u;else{const h=p*t,m=u*t;c=h<1?1/h:1,d=m<1?1/m:1}}else{const p=Math.abs(r*l-n*a),u=Math.hypot(r,n),h=Math.hypot(a,l);if(t===0)c=h/p,d=u/p;else{const m=t*p;c=h>m?h/m:1,d=u>m?u/m:1}}this._cachedScaleForStroking[0]=c,this._cachedScaleForStroking[1]=d}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:r}=this,{lineWidth:n}=this.current,[a,l]=this.getScaleForStroking();if(r.lineWidth=n||1,a===1&&l===1){r.stroke();return}const c=r.getLineDash();if(t&&r.save(),r.scale(a,l),c.length>0){const d=Math.max(a,l);r.setLineDash(c.map(p=>p/d)),r.lineDashOffset/=d}r.stroke(),t&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in X1)d8.prototype[e]!==void 0&&(d8.prototype[X1[e]]=d8.prototype[e]);class ov{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#e=t}static get workerSrc(){return this.#t}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#t=t}}const f$={DATA:1,ERROR:2},Ca={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function qc(e){switch(e instanceof Error||typeof e=="object"&&e!==null||Gi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new p5(e.message);case"MissingPDFException":return new d5(e.message);case"PasswordException":return new SY(e.message,e.code);case"UnexpectedResponseException":return new jM(e.message,e.status);case"UnknownErrorException":return new EY(e.message,e.details);default:return new EY(e.message,e.toString())}}class wb{constructor(t,r,n){this.sourceName=t,this.targetName=r,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const l=a.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#t(l);return}if(l.callback){const d=l.callbackId,p=this.callbackCapabilities[d];if(!p)throw new Error(`Cannot resolve callback ${d}`);if(delete this.callbackCapabilities[d],l.callback===f$.DATA)p.resolve(l.data);else if(l.callback===f$.ERROR)p.reject(qc(l.reason));else throw new Error("Unexpected callback case");return}const c=this.actionHandler[l.action];if(!c)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const d=this.sourceName,p=l.sourceName;new Promise(function(u){u(c(l.data))}).then(function(u){n.postMessage({sourceName:d,targetName:p,callback:f$.DATA,callbackId:l.callbackId,data:u})},function(u){n.postMessage({sourceName:d,targetName:p,callback:f$.ERROR,callbackId:l.callbackId,reason:qc(u)})});return}if(l.streamId){this.#e(l);return}c(l.data)},n.addEventListener("message",this._onComObjOnMessage)}on(t,r){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=r}send(t,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},n)}sendWithPromise(t,r,n){const a=this.callbackId++,l=Promise.withResolvers();this.callbackCapabilities[a]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:r},n)}catch(c){l.reject(c)}return l.promise}sendWithStream(t,r,n,a){const l=this.streamId++,c=this.sourceName,d=this.targetName,p=this.comObj;return new ReadableStream({start:u=>{const h=Promise.withResolvers();return this.streamControllers[l]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:c,targetName:d,action:t,streamId:l,data:r,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:c,targetName:d,stream:Ca.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Wa(u instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[l].cancelCall=h,this.streamControllers[l].isClosed=!0,p.postMessage({sourceName:c,targetName:d,stream:Ca.CANCEL,streamId:l,reason:qc(u)}),h.promise}},n)}#e(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this,d=this.actionHandler[t.action],p={enqueue(u,h=1,m){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),l.postMessage({sourceName:n,targetName:a,stream:Ca.ENQUEUE,streamId:r,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.CLOSE,streamId:r}),delete c.streamSinks[r])},error(u){Wa(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.ERROR,streamId:r,reason:qc(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[r]=p,new Promise(function(u){u(d(t.data,p))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,success:!0})},function(u){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,reason:qc(u)})})}#t(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this.streamControllers[r],d=this.streamSinks[r];switch(t.stream){case Ca.START_COMPLETE:t.success?c.startCall.resolve():c.startCall.reject(qc(t.reason));break;case Ca.PULL_COMPLETE:t.success?c.pullCall.resolve():c.pullCall.reject(qc(t.reason));break;case Ca.PULL:if(!d){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0});break}d.desiredSize<=0&&t.desiredSize>0&&d.sinkCapability.resolve(),d.desiredSize=t.desiredSize,new Promise(function(p){p(d.onPull?.())}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,reason:qc(p)})});break;case Ca.ENQUEUE:if(Wa(c,"enqueue should have stream controller"),c.isClosed)break;c.controller.enqueue(t.chunk);break;case Ca.CLOSE:if(Wa(c,"close should have stream controller"),c.isClosed)break;c.isClosed=!0,c.controller.close(),this.#o(c,r);break;case Ca.ERROR:Wa(c,"error should have stream controller"),c.controller.error(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL_COMPLETE:t.success?c.cancelCall.resolve():c.cancelCall.reject(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL:if(!d)break;new Promise(function(p){p(d.onCancel?.(qc(t.reason)))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,reason:qc(p)})}),d.sinkCapability.reject(qc(t.reason)),d.isCancelled=!0,delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}async#o(t,r){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class wNt{#e;#t;constructor({parsedData:t,rawData:r}){this.#e=t,this.#t=r}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return CX(this.#e)}has(t){return this.#e.has(t)}}const Sm=Symbol("INTERNAL");class vNt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:r,intent:n,usage:a}){this.#e=!!(t&Nd.DISPLAY),this.#t=!!(t&Nd.PRINT),this.name=r,this.intent=n,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:r}=this.usage;return this.#e?r?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,r,n=!1){t!==Sm&&Gi("Internal method `_setVisible` called."),this.#o=n,this.#i=r}}class CNt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,r=Nd.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const n of t.groups)this.#t.set(n.id,new vNt(r,n));if(t.baseState==="OFF")for(const n of this.#t.values())n._setVisible(Sm,!1);for(const n of t.on)this.#t.get(n)._setVisible(Sm,!0);for(const n of t.off)this.#t.get(n)._setVisible(Sm,!1);this.#o=this.getHash()}}#s(t){const r=t.length;if(r<2)return!0;const n=t[0];for(let a=1;a<r;a++){const l=t[a];let c;if(Array.isArray(l))c=this.#s(l);else if(this.#t.has(l))c=this.#t.get(l).visible;else return Nr(`Optional content group not found: ${l}`),!0;switch(n){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return n==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return IM("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Nr(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#s(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!1}return!0}return Nr(`Unknown optional content policy ${t.policy}.`),!0}return Nr(`Unknown group type ${t.type}.`),!0}setVisibility(t,r=!0){const n=this.#t.get(t);if(!n){Nr(`Optional content group not found: ${t}`);return}n._setVisible(Sm,!!r,!0),this.#e=null}setOCGState({state:t,preserveRB:r}){let n;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":n=a;continue}const l=this.#t.get(a);if(l)switch(n){case"ON":l._setVisible(Sm,!0);break;case"OFF":l._setVisible(Sm,!1);break;case"Toggle":l._setVisible(Sm,!l.visible);break}}this.#e=null}get hasInitialVisibility(){return this.#o===null||this.getHash()===this.#o}getOrder(){return this.#t.size?this.#i?this.#i.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?CX(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new eRe;for(const[r,n]of this.#t)t.update(`${r}:${n.visible}`);return this.#e=t.hexdigest()}}class ANt{constructor(t,{disableRange:r=!1,disableStream:n=!1}){Wa(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:c,contentDispositionFilename:d}=t;if(this._queuedChunks=[],this._progressiveDone=c,this._contentDispositionFilename=d,l?.length>0){const p=l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!r,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,u)=>{this._onReceiveData({begin:p,chunk:u})}),t.addProgressListener((p,u)=>{this._onProgress({loaded:p,total:u})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:r}){const n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(n),!0)});Wa(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){Wa(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new $Nt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new kNt(this,t,r);return this._pdfDataRangeTransport.requestDataRange(t,r),this._rangeReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeReaders.slice(0))r.cancel(t);this._pdfDataRangeTransport.abort()}}class $Nt{constructor(t,r,n=!1,a=null){this._stream=t,this._done=n||!1,this._filename=EX(a)?a:null,this._queuedChunks=r||[],this._loaded=0;for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class kNt{constructor(t,r,n){this._stream=t,this._begin=r,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const n of this._requests)n.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 r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function SNt(e){let t=!0,r=n("filename\\*","i").exec(e);if(r){r=r[1];let h=d(r);return h=unescape(h),h=p(h),h=u(h),l(h)}if(r=c(e),r){const h=u(r);return l(h)}if(r=n("filename","i").exec(e),r){r=r[1];let h=d(r);return h=u(h),l(h)}function n(h,m){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function a(h,m){if(h){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const f=new TextDecoder(h,{fatal:!0}),x=MM(m);m=f.decode(x),t=!1}catch{}}return m}function l(h){return t&&/[\x80-\xff]/.test(h)&&(h=a("utf-8",h),t&&(h=a("iso-8859-1",h))),h}function c(h){const m=[];let f;const x=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,b,w,v]=f;if(b=parseInt(b,10),b in m){if(b===0)break;continue}m[b]=[w,v]}const y=[];for(let b=0;b<m.length&&b in m;++b){let[w,v]=m[b];v=d(v),w&&(v=unescape(v),b===0&&(v=p(v))),y.push(v)}return y.join("")}function d(h){if(h.startsWith('"')){const m=h.slice(1).split('\\"');for(let f=0;f<m.length;++f){const x=m[f].indexOf('"');x!==-1&&(m[f]=m[f].slice(0,x),m.length=f+1),m[f]=m[f].replaceAll(/\\(.)/g,"$1")}h=m.join('"')}return h}function p(h){const m=h.indexOf("'");if(m===-1)return h;const f=h.slice(0,m),y=h.slice(m+1).replace(/^[^']*'/,"");return a(f,y)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,f,x,y){if(x==="q"||x==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(b,w){return String.fromCharCode(parseInt(w,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function PX({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:n}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*r)||n||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function TX(e){const t=e("Content-Disposition");if(t){let r=SNt(t);if(r.includes("%"))try{r=decodeURIComponent(r)}catch{}if(EX(r))return r}return null}function RM(e,t){return e===404||e===0&&t.startsWith("file:")?new d5('Missing PDF "'+t+'".'):new jM(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function rRe(e){return e===200||e===206}function iRe(e,t,r){return{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function nRe(e){const t=new Headers;for(const r in e){const n=e[r];n!==void 0&&t.append(r,n)}return t}function aRe(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Nr(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class jme{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Wa(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new ENt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new LNt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class ENt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const r=t.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._headers=nRe(this._stream.httpHeaders);const n=r.url;fetch(n,iRe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!rRe(a.status))throw RM(a.status,n);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:c,suggestedLength:d}=PX({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=d||this._contentLength,this._filename=TX(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p5("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class LNt{constructor(t,r,n){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=nRe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${r}-${n-1}`);const l=a.url;fetch(l,iRe(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!rRe(c.status))throw RM(c.status,l);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const a_=200,s_=206;function INt(e){const t=e.response;return typeof t!="string"?t:MM(t).buffer}class jNt{constructor(t,r={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null),this.withCredentials=r.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,r,n){const a={begin:t,end:r};for(const l in n)a[l]=n[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const r=new XMLHttpRequest,n=this.currXhrId++,a=this.pendingRequests[n]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const c=this.httpHeaders[l];c!==void 0&&r.setRequestHeader(l,c)}return this.isHttp&&"begin"in t&&"end"in t?(r.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=s_):a.expectedStatus=a_,r.responseType="arraybuffer",t.onError&&(r.onerror=function(l){t.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,r.send(null),n}onProgress(t,r){const n=this.pendingRequests[t];n&&n.onProgress?.(r)}onStateChange(t,r){const n=this.pendingRequests[t];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){n.onError?.(a.status);return}const l=a.status||a_;if(!(l===a_&&n.expectedStatus===s_)&&l!==n.expectedStatus){n.onError?.(a.status);return}const d=INt(a);if(l===s_){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);n.onDone({begin:parseInt(u[1],10),chunk:d})}else d?n.onDone({begin:0,chunk:d}):n.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const r=this.pendingRequests[t].xhr;delete this.pendingRequests[t],r.abort()}}class MNt{constructor(t){this._source=t,this._manager=new jNt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return Wa(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new BNt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,r){const n=new DNt(this._manager,t,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class BNt{constructor(t,r){this._manager=t;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,r=this._manager.getRequestXhr(t),n=c=>r.getResponseHeader(c),{allowRangeRequests:a,suggestedLength:l}=PX({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=TX(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=RM(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class DNt{constructor(t,r,n){this._manager=t;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(r,n,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const r=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=RM(t,this._url);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const sRe=/^file:\/\/\/[a-zA-Z]:\//;function PNt(e){const t=Rh.get("url"),r=t.parse(e);return r.protocol==="file:"||r.host?r:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(r.host||(r.protocol="file:"),r)}class TNt{constructor(t){this.source=t,this.url=PNt(t.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Wa(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new FNt(this):new zNt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=this.isFsUrl?new ONt(this,t,r):new RNt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class lRe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const r=t.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",r=>{this._error(r)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p5("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class cRe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const r=t.source;this._isStreamingSupported=!r.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",r=>{this._error(r)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ML(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class zNt extends lRe{constructor(t){super(t);const r=n=>{if(n.statusCode===404){const d=new d5(`Missing PDF "${this._url}".`);this._storedError=d,this._headersCapability.reject(d);return}this._headersCapability.resolve(),this._setReadableStream(n);const a=d=>this._readableStream.headers[d.toLowerCase()],{allowRangeRequests:l,suggestedLength:c}=PX({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=c||this._contentLength,this._filename=TX(a)};if(this._request=null,this._url.protocol==="http:"){const n=Rh.get("http");this._request=n.request(ML(this._url,t.httpHeaders),r)}else{const n=Rh.get("https");this._request=n.request(ML(this._url,t.httpHeaders),r)}this._request.on("error",n=>{this._storedError=n,this._headersCapability.reject(n)}),this._request.end()}}class RNt extends cRe{constructor(t,r,n){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const c=t.httpHeaders[l];c!==void 0&&(this._httpHeaders[l]=c)}this._httpHeaders.Range=`bytes=${r}-${n-1}`;const a=l=>{if(l.statusCode===404){const c=new d5(`Missing PDF "${this._url}".`);this._storedError=c;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=Rh.get("http");this._request=l.request(ML(this._url,this._httpHeaders),a)}else{const l=Rh.get("https");this._request=l.request(ML(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class FNt extends lRe{constructor(t){super(t);let r=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(r=r.replace(/^\//,""));const n=Rh.get("fs");n.promises.lstat(r).then(a=>{this._contentLength=a.size,this._setReadableStream(n.createReadStream(r)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new d5(`Missing PDF "${r}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class ONt extends cRe{constructor(t,r,n){super(t);let a=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=Rh.get("fs");this._setReadableStream(l.createReadStream(a,{start:r,end:n-1}))}}const NNt=1e5,rc=30,HNt=.8;let BL=class Nu{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#d=null;#p=null;#h=0;#c=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#b=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:r,viewport:n}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#p=r,this.#c=n.scale*(globalThis.devicePixelRatio||1),this.#h=n.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:c,pageY:d}=n.rawDims;this.#g=[1,0,0,-1,-c,d+l],this.#l=a,this.#n=l,Nu.#x(),H4(r,n),this.#e.promise.catch(()=>{}).then(()=>{Nu.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#d.read().then(({value:r,done:n})=>{if(n){this.#e.resolve();return}this.#s??=r.lang,Object.assign(this.#a,r.styles),this.#S(r.items),t()},this.#e.reject)};return this.#d=this.#f.getReader(),Nu.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:r=null}){const n=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(r?.(),this.#h=a,H4(this.#p,{rotation:a})),n!==this.#c){r?.(),this.#c=n;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Nu.#w(this.#s)};for(const c of this.#u)l.properties=this.#y.get(c),l.div=c,this.#$(l)}}cancel(){const t=new p5("TextLayer task cancelled.");this.#d?.cancel(t).catch(()=>{}),this.#d=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=Nu.#w(this.#s);const r=this.#u,n=this.#m;for(const a of t){if(r.length>NNt){Nr("Ignoring additional textDivs for performance reasons."),this.#o=!0;return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),a.id!==null&&this.#t.setAttribute("id",`${a.id}`),l.append(this.#t)}else a.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}n.push(a.str),this.#j(a)}}#j(t){const r=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(r);const a=jo.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const c=this.#a[t.fontName];c.vertical&&(l+=Math.PI/2);const d=this.#i&&c.fontSubstitution||c.fontFamily,p=Math.hypot(a[2],a[3]),u=p*Nu.#C(d,this.#s);let h,m;l===0?(h=a[4],m=a[5]-u):(h=a[4]+u*Math.sin(l),m=a[5]-u*Math.cos(l));const f="calc(var(--scale-factor)*",x=r.style;this.#t===this.#p?(x.left=`${(100*h/this.#l).toFixed(2)}%`,x.top=`${(100*m/this.#n).toFixed(2)}%`):(x.left=`${f}${h.toFixed(2)}px)`,x.top=`${f}${m.toFixed(2)}px)`),x.fontSize=`${f}${(Nu.#A*p).toFixed(2)}px)`,x.fontFamily=d,n.fontSize=p,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,this.#i&&(r.dataset.fontName=c.fontSubstitutionLoadedName||t.fontName),l!==0&&(n.angle=l*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const b=Math.abs(t.transform[0]),w=Math.abs(t.transform[3]);b!==w&&Math.max(b,w)/Math.min(b,w)>1.5&&(y=!0)}if(y&&(n.canvasWidth=c.vertical?t.height:t.width),this.#y.set(r,n),this.#r.div=r,this.#r.properties=n,this.#$(this.#r),n.hasText&&this.#t.append(r),n.hasEOL){const b=document.createElement("br");b.setAttribute("role","presentation"),this.#t.append(b)}}#$(t){const{div:r,properties:n,ctx:a,prevFontSize:l,prevFontFamily:c}=t,{style:d}=r;let p="";if(Nu.#A>1&&(p=`scale(${1/Nu.#A})`),n.canvasWidth!==0&&n.hasText){const{fontFamily:u}=d,{canvasWidth:h,fontSize:m}=n;(l!==m||c!==u)&&(a.font=`${m*this.#c}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(r.textContent);f>0&&(p=`scaleX(${h*this.#c/f}) ${p}`)}n.angle!==0&&(p=`rotate(${n.angle}deg) ${p}`),p.length>0&&(d.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#b.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#w(t=null){let r=this.#v.get(t||="");if(!r){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=t,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,r)}return r}static#x(){if(this.#A!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#A=t.getBoundingClientRect().height,t.remove()}static#C(t,r){const n=this.#b.get(t);if(n)return n;const a=this.#w(r),l=a.font;a.canvas.width=a.canvas.height=rc,a.font=`${rc}px ${t}`;const c=a.measureText("");let d=c.fontBoundingBoxAscent,p=Math.abs(c.fontBoundingBoxDescent);if(d){const m=d/(d+p);return this.#b.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,rc,rc),a.strokeText("g",0,0);let u=a.getImageData(0,0,rc,rc).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/rc);break}a.clearRect(0,0,rc,rc),a.strokeText("A",0,rc),u=a.getImageData(0,0,rc,rc).data,d=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){d=rc-Math.floor(m/4/rc);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=d?d/(d+p):HNt;return this.#b.set(t,h),h}};function _Nt(){Jze("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:r,...n}=arguments[0],a=Object.keys(n);a.length>0&&Nr("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new BL({textContentSource:e,container:t,viewport:r}),{textDivs:c,textContentItemsStr:d}=l;return{promise:l.render(),textDivs:c,textContentItemsStr:d}}function VNt(){Jze("`updateTextLayer`, please use `TextLayer` instead.")}class rv{static textContent(t){const r=[],n={items:r,styles:Object.create(null)};function a(l){if(!l)return;let c=null;const d=l.name;if(d==="#text")c=l.value;else if(rv.shouldBuildText(d))l?.attributes?.textContent?c=l.attributes.textContent:l.value&&(c=l.value);else return;if(c!==null&&r.push({str:c}),!!l.children)for(const p of l.children)a(p)}return a(t),n}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const UNt=65536,QNt=100,WNt=5e3,GNt=ul?iNt:QOt,YNt=ul?nNt:qze,KNt=ul?rNt:UOt,qNt=ul?aNt:Zze;function ZNt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new zX,{docId:r}=t,n=e.url?JNt(e.url):null,a=e.data?XNt(e.data):null,l=e.httpHeaders||null,c=e.withCredentials===!0,d=e.password??null,p=e.range instanceof dRe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:UNt;let h=e.worker instanceof Qd?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!SX(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,b=e.CMapReaderFactory||YNt,w=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||qNt,A=e.stopAtErrors!==!0,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,I=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!ul,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,B=typeof e.disableFontFace=="boolean"?e.disableFontFace:ul,D=e.fontExtraProperties===!0,P=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,R=e.disableRange===!0,N=e.disableStream===!0,K=e.disableAutoFetch===!0,q=e.pdfBug===!0,F=e.enableHWA===!0,_=p?p.length:e.length??NaN,V=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!ul&&!B,O=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:b===qze&&v===Zze&&x&&w&&bb(x,document.baseURI)&&bb(w,document.baseURI),z=e.canvasFactory||new GNt({ownerDocument:T,enableHWA:F}),H=e.filterFactory||new KNt({docId:r,ownerDocument:T}),ee=null;DOt(m);const Y={canvasFactory:z,filterFactory:H};if(O||(Y.cMapReaderFactory=new b({baseUrl:x,isCompressed:y}),Y.standardFontDataFactory=new v({baseUrl:w})),!h){const J={verbosity:m,port:ov.workerPort};h=J.port?Qd.fromPort(J):new Qd(J),t._worker=h}const G={docId:r,apiVersion:"4.4.168",data:a,password:d,disableAutoFetch:K,rangeChunkSize:u,length:_,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:S,disableFontFace:B,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:L,fontExtraProperties:D,useSystemFonts:V,cMapUrl:O?x:null,standardFontDataUrl:O?w:null}},X={disableFontFace:B,fontExtraProperties:D,ownerDocument:T,pdfBug:q,styleElement:ee,loadingParams:{disableAutoFetch:K,enableXfa:P}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const J=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let ae;if(p)ae=new ANt(p,{disableRange:R,disableStream:N});else if(!a){if(!n)throw new Error("getDocument - no `url` parameter provided.");ae=(me=>ul?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&bb(me.url)?new jme(me):new TNt(me):bb(me.url)?new jme(me):new MNt(me))({url:n,length:_,httpHeaders:l,withCredentials:c,rangeChunkSize:u,disableRange:R,disableStream:N})}return J.then(xe=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new wb(r,xe,h.port),de=new rHt(me,t,ae,X,Y);t._transport=de,me.send("Ready",null)})}).catch(t._capability.reject),t}function JNt(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(ul&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function XNt(e){if(ul&&typeof CE<"u"&&e instanceof CE)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e=="string")return MM(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e=="object"&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Mme(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class zX{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${zX.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let dRe=class{constructor(t,r,n=!1,a=null){this.length=t,this.initialData=r,this.progressiveDone=n,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,r){for(const n of this._rangeListeners)n(t,r)}onDataProgress(t,r){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(t,r)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const r of this._progressiveReadListeners)r(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,r){Gi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class eHt{constructor(t,r){this._pdfInfo=t,this._transport=r}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return mi(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(r)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class tHt{#e=null;#t=!1;constructor(t,r,n,a=!1){this._pageIndex=t,this._pageInfo=r,this._transport=n,this._stats=a?new xme:null,this._pdfBug=a,this.commonObjs=n.commonObjs,this.objs=new pRe,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:r=this.rotate,offsetX:n=0,offsetY:a=0,dontFlip:l=!1}={}){return new hC({viewBox:this.view,scale:t,rotation:r,offsetX:n,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return mi(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:r,intent:n="display",annotationMode:a=Fm.ENABLE,transform:l=null,background:c=null,optionalContentConfigPromise:d=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(n,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),d||=this._transport.getOptionalContentConfig(f);let y=this._intentStates.get(x);y||(y=Object.create(null),this._intentStates.set(x,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const b=!!(f&Nd.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const w=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||b)&&(this.#t=!0),this.#o(!b),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new W6({callback:w,params:{canvasContext:t,viewport:r,transform:l,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,d]).then(([S,E])=>{if(this.destroyed){w();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:E}),v.operatorListChanged()}).catch(w),A}getOperatorList({intent:t="display",annotationMode:r=Fm.ENABLE,printAnnotationStorage:n=null}={}){function a(){c.operatorList.lastChunk&&(c.opListReadCapability.resolve(c.operatorList),c.renderTasks.delete(d))}const l=this._transport.getRenderingIntent(t,r,n,!0);let c=this._intentStates.get(l.cacheKey);c||(c=Object.create(null),this._intentStates.set(l.cacheKey,c));let d;return c.opListReadCapability||(d=Object.create(null),d.operatorListChanged=a,c.opListReadCapability=Promise.withResolvers(),(c.renderTasks||=new Set).add(d),c.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),c.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:r===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>rv.textContent(n));const r=this.streamTextContent(t);return new Promise(function(n,a){function l(){c.read().then(function({value:p,done:u}){if(u){n(d);return}d.lang??=p.lang,Object.assign(d.styles,p.styles),d.items.push(...p.items),l()},a)}const c=r.getReader(),d={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(const n of r.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const r=this.#o(!1);return t&&r&&(this._stats&&=new xme),r}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},WNt),!1;for(const{renderTasks:r,operatorList:n}of this._intentStates.values())if(r.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(t,r){const n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(t))}_renderPageChunk(t,r){for(let n=0,a=t.length;n<a;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);r.operatorList.lastChunk=t.lastChunk,r.operatorList.separateAnnots=t.separateAnnots;for(const n of r.renderTasks)n.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:r,annotationStorageSerializable:n}){const{map:a,transfer:l}=n,d=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:r,annotationStorage:a},l).getReader(),p=this._intentStates.get(r);p.streamReader=d;const u=()=>{d.read().then(({value:h,done:m})=>{if(m){p.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,p),u())},h=>{if(p.streamReader=null,!this._transport.destroyed){if(p.operatorList){p.operatorList.lastChunk=!0;for(const m of p.renderTasks)m.operatorListChanged();this.#o(!0)}if(p.displayReadyCapability)p.displayReadyCapability.reject(h);else if(p.opListReadCapability)p.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:t,reason:r,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(r instanceof kX){let a=QNt;r.extraDelay>0&&r.extraDelay<1e3&&(a+=r.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:r,force:!0})},a);return}}if(t.streamReader.cancel(new p5(r.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,l]of this._intentStates)if(l===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class oHt{#e=new Set;#t=Promise.resolve();postMessage(t,r){const n={data:structuredClone(t,r?{transfer:r}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,n)})}addEventListener(t,r){this.#e.add(r)}removeEventListener(t,r){this.#e.delete(r)}terminate(){this.#e.clear()}}const N0={isWorkerDisabled:!1,fakeWorkerId:0};ul&&(N0.isWorkerDisabled=!0,ov.workerSrc||="./pdf.worker.mjs"),N0.isSameOrigin=function(e,t){let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const n=new URL(t,r);return r.origin===n.origin},N0.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class Qd{static#e;constructor({name:t=null,port:r=null,verbosity:n=POt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,r){if(Qd.#e?.has(r))throw new Error("Cannot use more than one PDFWorker per port.");(Qd.#e||=new WeakMap).set(r,this),this._initializeFromPort(r);return}this._initialize()}get promise(){return ul?Promise.all([Rh.promise,this._readyCapability.promise]):this._readyCapability.promise}#t(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new wb("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(N0.isWorkerDisabled||Qd.#o){this._setupFakeWorker();return}let{workerSrc:t}=Qd;try{N0.isSameOrigin(window.location.href,t)||(t=N0.createCDNWrapper(new URL(t,window.location).href));const r=new Worker(t,{type:"module"}),n=new wb("main","worker",r),a=()=>{l.abort(),n.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;r.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),n.on("test",d=>{if(l.abort(),this.destroyed||!d){a();return}this._messageHandler=n,this._port=r,this._webWorker=r,this.#t()}),n.on("ready",d=>{if(l.abort(),this.destroyed){a();return}try{c()}catch{this._setupFakeWorker()}});const c=()=>{const d=new Uint8Array;n.send("test",d,[d.buffer])};c();return}catch{IM("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){N0.isWorkerDisabled||(Nr("Setting up fake worker."),N0.isWorkerDisabled=!0),Qd._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new oHt;this._port=r;const n=`fake${N0.fakeWorkerId++}`,a=new wb(n+"_worker",n,r);t.setup(a,r),this._messageHandler=new wb(n,n+"_worker",r),this.#t()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Qd.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const r=this.#e?.get(t.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new Qd(t)}static get workerSrc(){if(ov.workerSrc)return ov.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return mi(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class rHt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,r,n,a,l){this.messageHandler=t,this.loadingTask=r,this.commonObjs=new pRe,this.fontLoader=new tNt({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=l.canvasFactory,this.filterFactory=l.filterFactory,this.cMapReaderFactory=l.cMapReaderFactory,this.standardFontDataFactory=l.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,r=null){const n=this.#e.get(t);if(n)return n;const a=this.messageHandler.sendWithPromise(t,r);return this.#e.set(t,a),a}get annotationStorage(){return mi(this,"annotationStorage",new BX)}getRenderingIntent(t,r=Fm.ENABLE,n=null,a=!1){let l=Nd.DISPLAY,c=LY;switch(t){case"any":l=Nd.ANY;break;case"display":break;case"print":l=Nd.PRINT;break;default:Nr(`getRenderingIntent - invalid intent: ${t}`)}switch(r){case Fm.DISABLE:l+=Nd.ANNOTATIONS_DISABLE;break;case Fm.ENABLE:break;case Fm.ENABLE_FORMS:l+=Nd.ANNOTATIONS_FORMS;break;case Fm.ENABLE_STORAGE:l+=Nd.ANNOTATIONS_STORAGE,c=(l&Nd.PRINT&&n instanceof tRe?n:this.annotationStorage).serializable;break;default:Nr(`getRenderingIntent - invalid annotationMode: ${r}`)}return a&&(l+=Nd.OPLIST),{renderingIntent:l,cacheKey:`${l}_${c.hash}`,annotationStorageSerializable:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const n of this.#t.values())t.push(n._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),BL.cleanup(),this._networkStream?.cancelAllRequests(new p5("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:r}=this;t.on("GetReader",(n,a)=>{Wa(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=l=>{this._lastProgress={loaded:l.loaded,total:l.total}},a.onPull=()=>{this._fullReader.read().then(function({value:l,done:c}){if(c){a.close();return}Wa(l instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{a.error(l)})},a.onCancel=l=>{this._fullReader.cancel(l),a.ready.catch(c=>{if(!this.destroyed)throw c})}}),t.on("ReaderHeadersReady",n=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&r.onProgress?.(this._lastProgress),l.onProgress=c=>{r.onProgress?.({loaded:c.loaded,total:c.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(n,a)=>{Wa(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(n.begin,n.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:c,done:d}){if(d){a.close();return}Wa(c instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{a.error(c)})},a.onCancel=c=>{l.cancel(c),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,r._capability.resolve(new eHt(n,this))}),t.on("DocException",function(n){let a;switch(n.name){case"PasswordException":a=new SY(n.message,n.code);break;case"InvalidPDFException":a=new Gze(n.message);break;case"MissingPDFException":a=new d5(n.message);break;case"UnexpectedResponseException":a=new jM(n.message,n.status);break;case"UnknownErrorException":a=new EY(n.message,n.details);break;default:Gi("DocException - expected a valid Error.")}r._capability.reject(a)}),t.on("PasswordRequest",n=>{if(this.#s=Promise.withResolvers(),r.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{r.onPassword(a,n.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new SY(n.message,n.code));return this.#s.promise}),t.on("DataLoaded",n=>{r.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),t.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),t.on("commonobj",([n,a,l])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(a){case"Font":const{disableFontFace:c,fontExtraProperties:d,pdfBug:p}=this._params;if("error"in l){const f=l.error;Nr(`Error during font loading: ${f}`),this.commonObjs.resolve(n,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new oNt(l,{disableFontFace:c,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!d&&h.data&&(h.data=null),this.commonObjs.resolve(n,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Wa(m,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,x]of f.objs)if(x?.ref===m)return x.dataLen?(this.commonObjs.resolve(n,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([n,a,l,c])=>{if(this.destroyed)return;const d=this.#t.get(a);if(!d.objs.has(n)){if(d._intentStates.size===0){c?.bitmap?.close();return}switch(l){case"Image":d.objs.resolve(n,c),c?.dataLen>IOt&&(d._maybeCleanupAfterRender=!0);break;case"Pattern":d.objs.resolve(n,c);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",n=>{this.destroyed||r.onProgress?.({loaded:n.loaded,total:n.total})}),t.on("FetchBuiltInCMap",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(n):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(n):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Nr("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const r=t-1,n=this.#o.get(r);if(n)return n;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const c=new tHt(r,l,this,this._params.pdfBug);return this.#t.set(r,c),c});return this.#o.set(r,a),a}getPageIndex(t){return Mme(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(r=>new CNt(r,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",r=this.#e.get(t);if(r)return r;const n=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new wNt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const r of this.#t.values())if(!r.cleanup())throw new Error(`startCleanup: Page ${r.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),BL.cleanup()}}cachedPageNumber(t){if(!Mme(t))return null;const r=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(r)??null}}const x$=Symbol("INITIAL_DATA");class pRe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:x$}}get(t,r=null){if(r){const a=this.#t(t);return a.promise.then(()=>r(a.data)),null}const n=this.#e[t];if(!n||n.data===x$)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const r=this.#e[t];return!!r&&r.data!==x$}resolve(t,r=null){const n=this.#t(t);n.data=r,n.resolve()}clear(){for(const t in this.#e){const{data:r}=this.#e[t];r?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:r}=this.#e[t];r!==x$&&(yield[t,r])}}}class iHt{#e=null;constructor(t){this.#e=t,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(t=0){this.#e.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#e.operatorList;if(!t)return!1;const{annotationCanvasMap:r}=this.#e;return t.form||t.canvas&&r?.size>0}}class W6{#e=null;static#t=new WeakSet;constructor({callback:t,params:r,objs:n,commonObjs:a,annotationCanvasMap:l,operatorList:c,pageIndex:d,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=r,this.objs=n,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=c,this._pageIndex=d,this.canvasFactory=p,this.filterFactory=u,this._pdfBug=m,this.pageColors=f,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 iHt(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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(W6.#t.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.");W6.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:a,transform:l,background:c}=this.params;this.gfx=new d8(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:c}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),W6.#t.delete(this._canvas),this.callback(t||new kX(`Rendering cancelled, page ${this._pageIndex+1}`,r))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),W6.#t.delete(this._canvas),this.callback())))}}const nHt="4.4.168",aHt="19fbc8998";function Bme(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function hy(e){return Math.max(0,Math.min(255,255*e))}class Dme{static CMYK_G([t,r,n,a]){return["G",1-Math.min(1,.3*t+.59*n+.11*r+a)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=hy(t),[t,t,t]}static G_HTML([t]){const r=Bme(t);return`#${r}${r}${r}`}static RGB_G([t,r,n]){return["G",.3*t+.59*r+.11*n]}static RGB_rgb(t){return t.map(hy)}static RGB_HTML(t){return`#${t.map(Bme).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,r,n,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,n+a),1-Math.min(1,r+a)]}static CMYK_rgb([t,r,n,a]){return[hy(1-Math.min(1,t+a)),hy(1-Math.min(1,n+a)),hy(1-Math.min(1,r+a))]}static CMYK_HTML(t){const r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([t,r,n]){const a=1-t,l=1-r,c=1-n,d=Math.min(a,l,c);return["CMYK",a,l,c,d]}}class uRe{static setupStorage(t,r,n,a,l){const c=a.getValue(r,{value:null});switch(n.name){case"textarea":if(c.value!==null&&(t.textContent=c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(c.value===n.attributes.xfaOn?t.setAttribute("checked",!0):c.value===n.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",d=>{a.setValue(r,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(c.value!==null&&t.setAttribute("value",c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})})}break;case"select":if(c.value!==null){t.setAttribute("value",c.value);for(const d of n.children)d.attributes.value===c.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}t.addEventListener("input",d=>{const p=d.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(r,{value:u})});break}}static setAttributes({html:t,element:r,storage:n=null,intent:a,linkService:l}){const{attributes:c}=r,d=t instanceof HTMLAnchorElement;c.type==="radio"&&(c.name=`${c.name}-${a}`);for(const[p,u]of Object.entries(c))if(u!=null)switch(p){case"class":u.length&&t.setAttribute(p,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!d||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}d&&l.addLinkAttributes(t,c.href,c.newWindow),n&&c.dataId&&this.setupStorage(t,c.dataId,r,n)}static render(t){const r=t.annotationStorage,n=t.linkService,a=t.xfaHtml,l=t.intent||"display",c=document.createElement(a.name);a.attributes&&this.setAttributes({html:c,element:a,intent:l,linkService:n});const d=l!=="richText",p=t.div;if(p.append(c),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}d&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);c.append(m),d&&rv.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,c]];for(;h.length>0;){const[m,f,x]=h.at(-1);if(f+1===m.children.length){h.pop();continue}const y=m.children[++h.at(-1)[1]];if(y===null)continue;const{name:b}=y;if(b==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const w=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,b):document.createElement(b);if(x.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:r,intent:l,linkService:n}),y.children?.length>0)h.push([y,-1,w]);else if(y.value){const v=document.createTextNode(y.value);d&&rv.shouldBuildText(b)&&u.push(v),w.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const r=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=r,t.div.hidden=!1}}const fC=1e3,sHt=9,_4=new WeakSet;function u2(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class lHt{static create(t){switch(t.data.annotationType){case Ha.LINK:return new hRe(t);case Ha.TEXT:return new cHt(t);case Ha.WIDGET:switch(t.data.fieldType){case"Tx":return new dHt(t);case"Btn":return t.data.radioButton?new mRe(t):t.data.checkBox?new uHt(t):new hHt(t);case"Ch":return new mHt(t);case"Sig":return new pHt(t)}return new u5(t);case Ha.POPUP:return new BY(t);case Ha.FREETEXT:return new gRe(t);case Ha.LINE:return new fHt(t);case Ha.SQUARE:return new xHt(t);case Ha.CIRCLE:return new yHt(t);case Ha.POLYLINE:return new fRe(t);case Ha.CARET:return new wHt(t);case Ha.INK:return new xRe(t);case Ha.POLYGON:return new bHt(t);case Ha.HIGHLIGHT:return new vHt(t);case Ha.UNDERLINE:return new CHt(t);case Ha.SQUIGGLY:return new AHt(t);case Ha.STRIKEOUT:return new $Ht(t);case Ha.STAMP:return new yRe(t);case Ha.FILEATTACHMENT:return new kHt(t);default:return new ua(t)}}}class ua{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=r,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,r&&(this.container=this._createContainer(n)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:r,richText:n}){return!!(t?.str||r?.str||n?.str)}get hasPopupData(){return ua._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:r}=t;r&&this.#i(r),this.#o?.popup.updateEdited(t)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#o?.popup.resetEdited(),this.#e=null)}#i(t){const{container:{style:r},data:{rect:n,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:c,pageX:d,pageY:p}}}}=this;n?.splice(0,4,...t);const{width:u,height:h}=u2(t);r.left=`${100*(t[0]-d)/l}%`,r.top=`${100*(c-t[3]+p)/c}%`,a===0?(r.width=`${100*u/l}%`,r.height=`${100*h/c}%`):this.setRotation(a)}_createContainer(t){const{data:r,parent:{page:n,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",r.id),this instanceof u5||(l.tabIndex=fC);const{style:c}=l;if(c.zIndex=this.parent.zIndex++,r.popupRef&&l.setAttribute("aria-haspopup","dialog"),r.alternativeText&&(l.title=r.alternativeText),r.noRotate&&l.classList.add("norotate"),!r.rect||this instanceof BY){const{rotation:b}=r;return!r.hasOwnCanvas&&b!==0&&this.setRotation(b,l),l}const{width:d,height:p}=u2(r.rect);if(!t&&r.borderStyle.width>0){c.borderWidth=`${r.borderStyle.width}px`;const b=r.borderStyle.horizontalCornerRadius,w=r.borderStyle.verticalCornerRadius;if(b>0||w>0){const A=`calc(${b}px * var(--scale-factor)) / calc(${w}px * var(--scale-factor))`;c.borderRadius=A}else if(this instanceof mRe){const A=`calc(${d}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;c.borderRadius=A}switch(r.borderStyle.style){case py.SOLID:c.borderStyle="solid";break;case py.DASHED:c.borderStyle="dashed";break;case py.BEVELED:Nr("Unimplemented border style: beveled");break;case py.INSET:Nr("Unimplemented border style: inset");break;case py.UNDERLINE:c.borderBottomStyle="solid";break}const v=r.borderColor||null;v?(this.#t=!0,c.borderColor=jo.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):c.borderWidth=0}const u=jo.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;c.left=`${100*(u[0]-f)/h}%`,c.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=r;return r.hasOwnCanvas||y===0?(c.width=`${100*d/h}%`,c.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,r=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:c}=u2(this.data.rect);let d,p;t%180===0?(d=100*l/n,p=100*c/a):(d=100*c/n,p=100*l/a),r.style.width=`${d}%`,r.style.height=`${p}%`,r.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(r,n,a)=>{const l=a.detail[r],c=l[0],d=l.slice(1);a.target.style[n]=Dme[`${c}_HTML`](d),this.annotationStorage.setValue(this.data.id,{[n]:Dme[`${c}_rgb`](d)})};return mi(this,"_commonActions",{display:r=>{const{display:n}=r.detail,a=n%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:n===1||n===2})},print:r=>{this.annotationStorage.setValue(this.data.id,{noPrint:!r.detail.print})},hidden:r=>{const{hidden:n}=r.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:r=>{setTimeout(()=>r.target.focus({preventScroll:!1}),0)},userName:r=>{r.target.title=r.detail.userName},readonly:r=>{r.target.disabled=r.detail.readonly},required:r=>{this._setRequired(r.target,r.detail.required)},bgColor:r=>{t("bgColor","backgroundColor",r)},fillColor:r=>{t("fillColor","backgroundColor",r)},fgColor:r=>{t("fgColor","color",r)},textColor:r=>{t("textColor","color",r)},borderColor:r=>{t("borderColor","borderColor",r)},strokeColor:r=>{t("strokeColor","borderColor",r)},rotation:r=>{const n=r.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(t,r){const n=this._commonActions;for(const a of Object.keys(r.detail))(t[a]||n[a])?.(r)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;const n=this._commonActions;for(const[a,l]of Object.entries(r)){const c=n[a];if(c){const d={detail:{[a]:l},target:t};c(d),delete r[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[r,n,a,l]=this.data.rect.map(b=>Math.fround(b));if(t.length===8){const[b,w,v,A]=t.subarray(2,6);if(a===b&&l===w&&r===v&&n===A)return}const{style:c}=this.container;let d;if(this.#t){const{borderColor:b,borderWidth:w}=c;c.borderWidth=0,d=["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 p=a-r,u=l-n,{svgFactory:h}=this,m=h.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const f=h.createElement("defs");m.append(f);const x=h.createElement("clipPath"),y=`clippath_${this.data.id}`;x.setAttribute("id",y),x.setAttribute("clipPathUnits","objectBoundingBox"),f.append(x);for(let b=2,w=t.length;b<w;b+=8){const v=t[b],A=t[b+1],S=t[b+2],E=t[b+3],I=h.createElement("rect"),L=(S-r)/p,B=(l-A)/u,D=(v-S)/p,P=(A-E)/u;I.setAttribute("x",L),I.setAttribute("y",B),I.setAttribute("width",D),I.setAttribute("height",P),x.append(I),d?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${B}" width="${D}" height="${P}"/>`)}this.#t&&(d.push("</g></svg>')"),c.backgroundImage=d.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:r}=this;t.setAttribute("aria-haspopup","dialog");const n=this.#o=new BY({data:{color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,parentRect:r.rect,borderStyle:0,id:`popup_${r.id}`,rotation:r.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){Gi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,r=null){const n=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:c,exportValues:d}of a){if(l===-1||c===r)continue;const p=typeof d=="string"?d:null,u=document.querySelector(`[data-element-id="${c}"]`);if(u&&!_4.has(u)){Nr(`_getElementsByName - element not allowed: ${c}`);continue}n.push({id:c,exportValue:p,domElement:u})}return n}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,c=a.getAttribute("data-element-id");c!==r&&_4.has(a)&&n.push({id:c,exportValue:l,domElement:a})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const r of t)r.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:r})})}}class hRe extends ua{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let a=!1;return t.url?(r.addLinkAttributes(n,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(n,t.action),a=!0):t.attachment?(this.#t(n,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(n,t.setOCGState),a=!0):t.dest?(this._bindLink(n,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),a=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&this.#e()}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),this.#e()}#t(t,r,n=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,n),!1),this.#e()}#o(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),this.#e()}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(r.actions)){const l=n.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,r){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Nr('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{n?.();const{fields:a,refs:l,include:c}=r,d=[];if(a.length!==0||l.length!==0){const h=new Set(l);for(const m of a){const f=this._fieldObjects[m]||[];for(const{id:x}of f)h.add(x)}for(const m of Object.values(this._fieldObjects))for(const f of m)h.has(f.id)===c&&d.push(f)}else for(const h of Object.values(this._fieldObjects))d.push(...h);const p=this.annotationStorage,u=[];for(const h of d){const{id:m}=h;switch(u.push(m),h.type){case"text":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}case"checkbox":case"radiobutton":{const x=h.defaultValue===h.exportValues;p.setValue(m,{value:x});break}case"combobox":case"listbox":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}default:continue}const f=document.querySelector(`[data-element-id="${m}"]`);if(f){if(!_4.has(f)){Nr(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}}class cHt extends ua{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class u5 extends ua{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return vc.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,r,n,a,l){n.includes("mouse")?t.addEventListener(n,c=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c),shift:c.shiftKey,modifier:this._getKeyModifier(c)}})}):t.addEventListener(n,c=>{if(n==="blur"){if(!r.focused||!c.relatedTarget)return;r.focused=!1}else if(n==="focus"){if(r.focused)return;r.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c)}})})}_setEventListeners(t,r,n,a){for(const[l,c]of n)(c==="Action"||this.data.actions?.[c])&&((c==="Focus"||c==="Blur")&&(r||={focused:!1}),this._setEventListener(t,r,l,c,a),c==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,r,"blur","Blur",null):c==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,r,"focus","Focus",null))}_setBackgroundColor(t){const r=this.data.backgroundColor||null;t.style.backgroundColor=r===null?"transparent":jo.makeHexColor(r[0],r[1],r[2])}_setTextStyle(t){const r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||sHt,l=t.style;let c;const d=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d),h=Math.round(u/(o_*a))||1,m=u/h;c=Math.min(a,p(m/o_))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d);c=Math.min(a,p(u/o_))}l.fontSize=`calc(${c}px * var(--scale-factor))`,l.color=jo.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(l.textAlign=r[this.data.textAlignment])}_setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",r)}}class dHt extends u5{constructor(t){const r=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:r})}setPropertyOnSiblings(t,r,n,a){const l=this.annotationStorage;for(const c of this._getElementsByName(t.name,t.id))c.domElement&&(c.domElement[r]=n),l.setValue(c.id,{[a]:n})}render(){const t=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const a=t.getValue(r,{value:this.data.fieldValue});let l=a.value||"";const c=t.getValue(r,{charLimit:this.data.maxLen}).charLimit;c&&l.length>c&&(l=l.slice(0,c));let d=a.formattedValue||this.data.textContent?.join(`
247
247
  `)||null;d&&this.data.comb&&(d=d.replaceAll(/\s+/g,""));const p={userValue:l,formattedValue:d,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=d??l,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",d??l),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),_4.add(n),n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=fC,this._setRequired(n,this.data.required),c&&(n.maxLength=c),n.addEventListener("input",h=>{t.setValue(r,{value:h.target.value}),this.setPropertyOnSiblings(n,"value",h.target.value,"value"),p.formattedValue=null}),n.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue??"";n.value=p.userValue=m,p.formattedValue=null});let u=h=>{const{formattedValue:m}=p;m!=null&&(h.target.value=m),h.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",m=>{if(p.focused)return;const{target:f}=m;p.userValue&&(f.value=p.userValue),p.lastCommittedValue=f.value,p.commitKey=1,this.data.actions?.Focus||(p.focused=!0)}),n.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const f={value(x){p.userValue=x.detail.value??"",t.setValue(r,{value:p.userValue.toString()}),x.target.value=p.userValue},formattedValue(x){const{formattedValue:y}=x.detail;p.formattedValue=y,y!=null&&x.target!==document.activeElement&&(x.target.value=y),t.setValue(r,{formattedValue:y})},selRange(x){x.target.setSelectionRange(...x.detail.selRange)},charLimit:x=>{const{charLimit:y}=x.detail,{target:b}=x;if(y===0){b.removeAttribute("maxLength");return}b.setAttribute("maxLength",y);let w=p.userValue;!w||w.length<=y||(w=w.slice(0,y),b.value=p.userValue=w,t.setValue(r,{value:w}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:w,willCommit:!0,commitKey:1,selStart:b.selectionStart,selEnd:b.selectionEnd}}))}};this._dispatchEventFromSandbox(f,m)}),n.addEventListener("keydown",m=>{p.commitKey=1;let f=-1;if(m.key==="Escape"?f=0:m.key==="Enter"&&!this.data.multiLine?f=2:m.key==="Tab"&&(p.commitKey=3),f===-1)return;const{value:x}=m.target;p.lastCommittedValue!==x&&(p.lastCommittedValue=x,p.userValue=x,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:x,willCommit:!0,commitKey:f,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const h=u;u=null,n.addEventListener("blur",m=>{if(!p.focused||!m.relatedTarget)return;this.data.actions?.Blur||(p.focused=!1);const{value:f}=m.target;p.userValue=f,p.lastCommittedValue!==f&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:f,willCommit:!0,commitKey:p.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),h(m)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",m=>{p.lastCommittedValue=null;const{data:f,target:x}=m,{value:y,selectionStart:b,selectionEnd:w}=x;let v=b,A=w;switch(m.inputType){case"deleteWordBackward":{const S=y.substring(0,b).match(/\w*[^\w]*$/);S&&(v-=S[0].length);break}case"deleteWordForward":{const S=y.substring(b).match(/^[^\w]*\w*/);S&&(A+=S[0].length);break}case"deleteContentBackward":b===w&&(v-=1);break;case"deleteContentForward":b===w&&(A+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:y,change:f||"",willCommit:!1,selStart:v,selEnd:A}})}),this._setEventListeners(n,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(u&&n.addEventListener("blur",u),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/c;n.classList.add("comb"),n.style.letterSpacing=`calc(${m}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class pHt extends u5{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class uHt extends u5{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,r=this.data,n=r.id;let a=t.getValue(n,{value:r.exportValue===r.fieldValue}).value;typeof a=="string"&&(a=a!=="Off",t.setValue(n,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const l=document.createElement("input");return _4.add(l),l.setAttribute("data-element-id",n),l.disabled=r.readOnly,this._setRequired(l,this.data.required),l.type="checkbox",l.name=r.fieldName,a&&l.setAttribute("checked",!0),l.setAttribute("exportValue",r.exportValue),l.tabIndex=fC,l.addEventListener("change",c=>{const{name:d,checked:p}=c.target;for(const u of this._getElementsByName(d,n)){const h=p&&u.exportValue===r.exportValue;u.domElement&&(u.domElement.checked=h),t.setValue(u.id,{value:h})}t.setValue(n,{value:p})}),l.addEventListener("resetform",c=>{const d=r.defaultFieldValue||"Off";c.target.checked=d===r.exportValue}),this.enableScripting&&this.hasJSActions&&(l.addEventListener("updatefromsandbox",c=>{const d={value(p){p.target.checked=p.detail.value!=="Off",t.setValue(n,{value:p.target.checked})}};this._dispatchEventFromSandbox(d,c)}),this._setEventListeners(l,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],c=>c.target.checked)),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class mRe extends u5{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,r=this.data,n=r.id;let a=t.getValue(n,{value:r.fieldValue===r.buttonValue}).value;if(typeof a=="string"&&(a=a!==r.buttonValue,t.setValue(n,{value:a})),a)for(const c of this._getElementsByName(r.fieldName,n))t.setValue(c.id,{value:!1});const l=document.createElement("input");if(_4.add(l),l.setAttribute("data-element-id",n),l.disabled=r.readOnly,this._setRequired(l,this.data.required),l.type="radio",l.name=r.fieldName,a&&l.setAttribute("checked",!0),l.tabIndex=fC,l.addEventListener("change",c=>{const{name:d,checked:p}=c.target;for(const u of this._getElementsByName(d,n))t.setValue(u.id,{value:!1});t.setValue(n,{value:p})}),l.addEventListener("resetform",c=>{const d=r.defaultFieldValue;c.target.checked=d!=null&&d===r.buttonValue}),this.enableScripting&&this.hasJSActions){const c=r.buttonValue;l.addEventListener("updatefromsandbox",d=>{const p={value:u=>{const h=c===u.detail.value;for(const m of this._getElementsByName(u.target.name)){const f=h&&m.id===n;m.domElement&&(m.domElement.checked=f),t.setValue(m.id,{value:f})}}};this._dispatchEventFromSandbox(p,d)}),this._setEventListeners(l,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.checked)}return this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class hHt extends hRe{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const r=t.lastChild;return this.enableScripting&&this.hasJSActions&&r&&(this._setDefaultPropertiesFromJS(r),r.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),t}}class mHt extends u5{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,r=this.data.id,n=t.getValue(r,{value:this.data.fieldValue}),a=document.createElement("select");_4.add(a),a.setAttribute("data-element-id",r),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=fC;let l=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue;for(const f of a.options)f.selected=f.value===m});for(const h of this.data.options){const m=document.createElement("option");m.textContent=h.displayValue,m.value=h.exportValue,n.value.includes(h.exportValue)&&(m.setAttribute("selected",!0),l=!1),a.append(m)}let c=null;if(l){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),a.prepend(h),c=()=>{h.remove(),a.removeEventListener("input",c),c=null},a.addEventListener("input",c)}const d=h=>{const m=h?"value":"textContent",{options:f,multiple:x}=a;return x?Array.prototype.filter.call(f,y=>y.selected).map(y=>y[m]):f.selectedIndex===-1?null:f[f.selectedIndex][m]};let p=d(!1);const u=h=>{const m=h.target.options;return Array.prototype.map.call(m,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",h=>{const m={value(f){c?.();const x=f.detail.value,y=new Set(Array.isArray(x)?x:[x]);for(const b of a.options)b.selected=y.has(b.value);t.setValue(r,{value:d(!0)}),p=d(!1)},multipleSelection(f){a.multiple=!0},remove(f){const x=a.options,y=f.detail.remove;x[y].selected=!1,a.remove(y),x.length>0&&Array.prototype.findIndex.call(x,w=>w.selected)===-1&&(x[0].selected=!0),t.setValue(r,{value:d(!0),items:u(f)}),p=d(!1)},clear(f){for(;a.length!==0;)a.remove(0);t.setValue(r,{value:null,items:[]}),p=d(!1)},insert(f){const{index:x,displayValue:y,exportValue:b}=f.detail.insert,w=a.children[x],v=document.createElement("option");v.textContent=y,v.value=b,w?w.before(v):a.append(v),t.setValue(r,{value:d(!0),items:u(f)}),p=d(!1)},items(f){const{items:x}=f.detail;for(;a.length!==0;)a.remove(0);for(const y of x){const{displayValue:b,exportValue:w}=y,v=document.createElement("option");v.textContent=b,v.value=w,a.append(v)}a.options.length>0&&(a.options[0].selected=!0),t.setValue(r,{value:d(!0),items:u(f)}),p=d(!1)},indices(f){const x=new Set(f.detail.indices);for(const y of f.target.options)y.selected=x.has(y.index);t.setValue(r,{value:d(!0)}),p=d(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(m,h)}),a.addEventListener("input",h=>{const m=d(!0),f=d(!1);t.setValue(r,{value:m}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:p,change:f,changeEx:m,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(a,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)):a.addEventListener("input",function(h){t.setValue(r,{value:d(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class BY extends ua{constructor(t){const{data:r,elements:n}=t;super(t,{isRenderable:ua._hasPopupData(r)}),this.elements=n,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new gHt({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,r.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(n=>`${Kze}${n}`).join(",")),this.container}}class gHt{#e=this.#j.bind(this);#t=this.#C.bind(this);#o=this.#x.bind(this);#i=this.#w.bind(this);#s=null;#r=null;#n=null;#l=null;#d=null;#p=null;#h=null;#c=!1;#a=null;#m=null;#f=null;#u=null;#y=null;#g=null;#b=!1;constructor({container:t,color:r,elements:n,titleObj:a,modificationDate:l,contentsObj:c,richText:d,parent:p,rect:u,parentRect:h,open:m}){this.#r=t,this.#y=a,this.#n=c,this.#u=d,this.#p=p,this.#s=r,this.#f=u,this.#h=h,this.#d=n,this.#l=Xze.toDateObject(l),this.trigger=n.flatMap(f=>f.getElementsToTriggerPopup());for(const f of this.trigger)f.addEventListener("click",this.#i),f.addEventListener("mouseenter",this.#o),f.addEventListener("mouseleave",this.#t),f.classList.add("popupTriggerArea");for(const f of n)f.container?.addEventListener("keydown",this.#e);this.#r.hidden=!0,m&&this.#w()}render(){if(this.#a)return;const t=this.#a=document.createElement("div");if(t.className="popup",this.#s){const l=t.style.outlineColor=jo.makeHexColor(...this.#s);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${l} 30%, white)`:t.style.backgroundColor=jo.makeHexColor(...this.#s.map(d=>Math.floor(.7*(255-d)+d)))}const r=document.createElement("span");r.className="header";const n=document.createElement("h1");if(r.append(n),{dir:n.dir,str:n.textContent}=this.#y,t.append(r),this.#l){const l=document.createElement("span");l.classList.add("popupDate"),l.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),l.setAttribute("data-l10n-args",JSON.stringify({date:this.#l.toLocaleDateString(),time:this.#l.toLocaleTimeString()})),r.append(l)}const a=this.#v;if(a)uRe.render({xfaHtml:a,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const l=this._formatContents(this.#n);t.append(l)}this.#r.append(t)}get#v(){const t=this.#u,r=this.#n;return t?.str&&(!r?.str||r.str===t.str)&&this.#u.html||null}get#A(){return this.#v?.attributes?.style?.fontSize||0}get#k(){return this.#v?.attributes?.style?.color||null}#S(t){const r=[],n={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:r}]}},a={style:{color:this.#k,fontSize:this.#A?`calc(${this.#A}px * var(--scale-factor))`:""}};for(const l of t.split(`
248
248
  `))r.push({name:"span",value:l,attributes:a});return n}_formatContents({str:t,dir:r}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=r;const a=t.split(/(?:\r\n?|\n)/);for(let l=0,c=a.length;l<c;++l){const d=a[l];n.append(document.createTextNode(d)),l<c-1&&n.append(document.createElement("br"))}return n}#j(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#c)&&this.#w()}updateEdited({rect:t,popupContent:r}){this.#g||={contentsObj:this.#n,richText:this.#u},t&&(this.#m=null),r&&(this.#u=this.#S(r),this.#n=null),this.#a?.remove(),this.#a=null}resetEdited(){this.#g&&({contentsObj:this.#n,richText:this.#u}=this.#g,this.#g=null,this.#a?.remove(),this.#a=null,this.#m=null)}#$(){if(this.#m!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:r,pageHeight:n,pageX:a,pageY:l}}}=this.#p;let c=!!this.#h,d=c?this.#h:this.#f;for(const y of this.#d)if(!d||jo.intersect(y.data.rect,d)!==null){d=y.data.rect,c=!0;break}const p=jo.normalizeRect([d[0],t[3]-d[1]+t[1],d[2],t[3]-d[3]+t[1]]),h=c?d[2]-d[0]+5:0,m=p[0]+h,f=p[1];this.#m=[100*(m-a)/r,100*(f-l)/n];const{style:x}=this.#r;x.left=`${this.#m[0]}%`,x.top=`${this.#m[1]}%`}#w(){this.#c=!this.#c,this.#c?(this.#x(),this.#r.addEventListener("click",this.#i),this.#r.addEventListener("keydown",this.#e)):(this.#C(),this.#r.removeEventListener("click",this.#i),this.#r.removeEventListener("keydown",this.#e))}#x(){this.#a||this.render(),this.isVisible?this.#c&&this.#r.classList.add("focused"):(this.#$(),this.#r.hidden=!1,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)+1e3)}#C(){this.#r.classList.remove("focused"),!(this.#c||!this.isVisible)&&(this.#r.hidden=!0,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)-1e3)}forceHide(){this.#b=this.isVisible,this.#b&&(this.#r.hidden=!0)}maybeShow(){this.#b&&(this.#a||this.#x(),this.#b=!1,this.#r.hidden=!1)}get isVisible(){return this.#r.hidden===!1}}class gRe extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=ai.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const r of this.textContent){const n=document.createElement("span");n.textContent=r,t.append(n)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class fHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:r,height:n}=u2(t.rect),a=this.svgFactory.create(r,n,!0),l=this.#e=this.svgFactory.createElement("svg:line");return l.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),l.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),l.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),l.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),l.setAttribute("stroke-width",t.borderStyle.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class xHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:r,height:n}=u2(t.rect),a=this.svgFactory.create(r,n,!0),l=t.borderStyle.width,c=this.#e=this.svgFactory.createElement("svg:rect");return c.setAttribute("x",l/2),c.setAttribute("y",l/2),c.setAttribute("width",r-l),c.setAttribute("height",n-l),c.setAttribute("stroke-width",l||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),a.append(c),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class yHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:r,height:n}=u2(t.rect),a=this.svgFactory.create(r,n,!0),l=t.borderStyle.width,c=this.#e=this.svgFactory.createElement("svg:ellipse");return c.setAttribute("cx",r/2),c.setAttribute("cy",n/2),c.setAttribute("rx",r/2-l/2),c.setAttribute("ry",n/2-l/2),c.setAttribute("stroke-width",l||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),a.append(c),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class fRe extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:r,borderStyle:n,popupRef:a}}=this;if(!r)return this.container;const{width:l,height:c}=u2(t),d=this.svgFactory.create(l,c,!0);let p=[];for(let h=0,m=r.length;h<m;h+=2){const f=r[h]-t[0],x=t[3]-r[h+1];p.push(`${f},${x}`)}p=p.join(" ");const u=this.#e=this.svgFactory.createElement(this.svgElementName);return u.setAttribute("points",p),u.setAttribute("stroke-width",n.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),d.append(u),this.container.append(d),!a&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class bHt extends fRe{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class wHt extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class xRe extends ua{#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=ai.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:r,borderStyle:n,popupRef:a}}=this,{width:l,height:c}=u2(t),d=this.svgFactory.create(l,c,!0);for(const p of r){let u=[];for(let m=0,f=p.length;m<f;m+=2){const x=p[m]-t[0],y=t[3]-p[m+1];u.push(`${x},${y}`)}u=u.join(" ");const h=this.svgFactory.createElement(this.svgElementName);this.#e.push(h),h.setAttribute("points",u),h.setAttribute("stroke-width",n.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),!a&&this.hasPopupData&&this._createPopup(),d.append(h)}return this.container.append(d),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class vHt extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class CHt extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class AHt extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class $Ht extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class yRe extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class kHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0});const{file:r}=this.data;this.filename=r.filename,this.content=r.content,this.linkService.eventBus?.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",this.#t.bind(this)),this.#e=n;const{isMac:a}=vc.platform;return t.addEventListener("keydown",l=>{l.key==="Enter"&&(a?l.metaKey:l.ctrlKey)&&this.#t()}),!r.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),t.append(n),t}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}let SHt=class{#e=null;#t=null;#o=new Map;constructor({div:t,accessibilityManager:r,annotationCanvasMap:n,annotationEditorUIManager:a,page:l,viewport:c}){this.div=t,this.#e=r,this.#t=n,this.page=l,this.viewport=c,this.zIndex=0,this._annotationEditorUIManager=a}#i(t,r){const n=t.firstChild||t;n.id=`${Kze}${r}`,this.div.append(t),this.#e?.moveElementInDOM(this.div,t,n,!1)}async render(t){const{annotations:r}=t,n=this.div;H4(n,this.viewport);const a=new Map,l={data:null,layer:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new $X,annotationStorage:t.annotationStorage||new BX,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const c of r){if(c.noHTML)continue;const d=c.annotationType===Ha.POPUP;if(d){const h=a.get(c.id);if(!h)continue;l.elements=h}else{const{width:h,height:m}=u2(c.rect);if(h<=0||m<=0)continue}l.data=c;const p=lHt.create(l);if(!p.isRenderable)continue;if(!d&&c.popupRef){const h=a.get(c.popupRef);h?h.push(p):a.set(c.popupRef,[p])}const u=p.render();c.hidden&&(u.style.visibility="hidden"),this.#i(u,c.id),p.annotationEditorType>0&&(this.#o.set(p.data.id,p),this._annotationEditorUIManager?.renderAnnotationElement(p))}this.#s()}update({viewport:t}){const r=this.div;this.viewport=t,H4(r,{rotation:t.rotation}),this.#s(),r.hidden=!1}#s(){if(!this.#t)return;const t=this.div;for(const[r,n]of this.#t){const a=t.querySelector(`[data-annotation-id="${r}"]`);if(!a)continue;n.className="annotationContent";const{firstChild:l}=a;l?l.nodeName==="CANVAS"?l.replaceWith(n):l.classList.contains("annotationContent")?l.after(n):l.before(n):a.append(n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#o.values())}getEditableAnnotation(t){return this.#o.get(t)}};const y$=/\r\n?|\n/g;class Va extends ur{#e=this.editorDivBlur.bind(this);#t=this.editorDivFocus.bind(this);#o=this.editorDivInput.bind(this);#i=this.editorDivKeydown.bind(this);#s=this.editorDivPaste.bind(this);#r;#n="";#l=`${this.id}-editor`;#d;#p=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Va.prototype,r=l=>l.isEmpty(),n=yg.TRANSLATE_SMALL,a=yg.TRANSLATE_BIG;return mi(this,"_keyboardManager",new mC([[["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:[-a,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[n,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[a,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,n],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,a],checker:r}]]))}static _type="freetext";static _editorType=ai.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#r=t.color||Va._defaultColor||ur._defaultLineColor,this.#d=t.fontSize||Va._defaultFontSize}static initialize(t,r){ur.initialize(t,r,{strings:["pdfjs-free-text-default-content"]});const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,r){switch(t){case gr.FREETEXT_SIZE:Va._defaultFontSize=r;break;case gr.FREETEXT_COLOR:Va._defaultColor=r;break}}updateParams(t,r){switch(t){case gr.FREETEXT_SIZE:this.#h(r);break;case gr.FREETEXT_COLOR:this.#c(r);break}}static get defaultPropertiesToUpdate(){return[[gr.FREETEXT_SIZE,Va._defaultFontSize],[gr.FREETEXT_COLOR,Va._defaultColor||ur._defaultLineColor]]}get propertiesToUpdate(){return[[gr.FREETEXT_SIZE,this.#d],[gr.FREETEXT_COLOR,this.#r]]}#h(t){const r=a=>{this.editorDiv.style.fontSize=`calc(${a}px * var(--scale-factor))`,this.translate(0,-(a-this.#d)*this.parentScale),this.#d=a,this.#m()},n=this.#d;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:gr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#c(t){const r=a=>{this.#r=this.editorDiv.style.color=a},n=this.#r;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:gr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}getInitialTranslation(){const t=this.parentScale;return[-Va._internalPadding*t,-(Va._internalPadding+this.#d)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(ai.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",this.#i,{signal:t}),this.editorDiv.addEventListener("focus",this.#t,{signal:t}),this.editorDiv.addEventListener("blur",this.#e,{signal:t}),this.editorDiv.addEventListener("input",this.#o,{signal:t}),this.editorDiv.addEventListener("paste",this.#s,{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#l),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#i),this.editorDiv.removeEventListener("focus",this.#t),this.editorDiv.removeEventListener("blur",this.#e),this.editorDiv.removeEventListener("input",this.#o),this.editorDiv.removeEventListener("paste",this.#s),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#a(){const t=[];this.editorDiv.normalize();for(const r of this.editorDiv.childNodes)t.push(Va.#f(r));return t.join(`
249
249
  `)}#m(){const[t,r]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:a,div:l}=this,c=l.style.display,d=l.classList.contains("hidden");l.classList.remove("hidden"),l.style.display="hidden",a.div.append(this.div),n=l.getBoundingClientRect(),l.remove(),l.style.display=c,l.classList.toggle("hidden",d)}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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#n,r=this.#n=this.#a().trimEnd();if(t===r)return;const n=a=>{if(this.#n=a,!a){this.remove();return}this.#u(),this._uiManager.rebuild(this),this.#m()};this.addCommands({cmd:()=>{n(r)},undo:()=>{n(t)},mustExec:!1}),this.#m()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Va._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)}render(){if(this.div)return this.div;let t,r;this.width&&(t=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#l),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),ur._l10nPromise.get("pdfjs-free-text-default-content").then(a=>this.editorDiv?.setAttribute("default-content",a)),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#d}px * var(--scale-factor))`,n.color=this.#r,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),jL(this,this.div,["dblclick","keydown"]),this.width){const[a,l]=this.parentDimensions;if(this.annotationElementId){const{position:c}=this.#p;let[d,p]=this.getInitialTranslation();[d,p]=this.pageTranslationToScreen(d,p);const[u,h]=this.pageDimensions,[m,f]=this.pageTranslation;let x,y;switch(this.rotation){case 0:x=t+(c[0]-m)/u,y=r+this.height-(c[1]-f)/h;break;case 90:x=t+(c[0]-m)/u,y=r-(c[1]-f)/h,[d,p]=[p,-d];break;case 180:x=t-this.width+(c[0]-m)/u,y=r-(c[1]-f)/h,[d,p]=[-d,-p];break;case 270:x=t+(c[0]-m-this.height*h)/u,y=r+(c[1]-f-this.width*u)/h,[d,p]=[-p,d];break}this.setAt(x*a,y*l,d,p)}else this.setAt(t*a,r*l,this.width*a,this.height*l);this.#u(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#f(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(y$,"")}editorDivPaste(t){const r=t.clipboardData||window.clipboardData,{types:n}=r;if(n.length===1&&n[0]==="text/plain")return;t.preventDefault();const a=Va.#g(r.getData("text")||"").replaceAll(y$,`
@@ -23906,7 +23906,7 @@ to {
23906
23906
  ${({isMenuVisible:e})=>e===!1?pe`
23907
23907
  display: none;
23908
23908
  `:null};
23909
- `,B_e=e=>g.createElement("svg",{width:208,height:208,viewBox:"0 0 208 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{filter:"url(#filter0_f_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:44,fill:"url(#paint0_linear_251_38441)"}),g.createElement("circle",{cx:104,cy:104,r:50,stroke:"url(#paint1_linear_251_38441)",strokeWidth:12})),g.createElement("g",{filter:"url(#filter1_d_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:41.1429,fill:"#FAFAFA"}),g.createElement("circle",{cx:104,cy:104,r:43.1429,stroke:"url(#paint2_linear_251_38441)",strokeWidth:4})),g.createElement("g",{clipPath:"url(#clip0_251_38441)"},g.createElement("path",{d:"M120.16 102.411L96.2853 90.4684C96.0134 90.3343 95.7118 90.2718 95.409 90.2867C95.1062 90.3016 94.8122 90.3935 94.5548 90.5536C94.2974 90.7138 94.0851 90.9369 93.938 91.202C93.7908 91.467 93.7137 91.7652 93.7139 92.0684V115.931C93.7137 116.234 93.7908 116.533 93.938 116.798C94.0851 117.063 94.2974 117.286 94.5548 117.446C94.8122 117.606 95.1062 117.698 95.409 117.713C95.7118 117.728 96.0134 117.665 96.2853 117.531L120.16 105.588C120.456 105.442 120.706 105.216 120.88 104.935C121.055 104.654 121.147 104.33 121.147 104C121.147 103.669 121.055 103.345 120.88 103.065C120.706 102.784 120.456 102.558 120.16 102.411Z",fill:"black"})),g.createElement("defs",null,g.createElement("filter",{id:"filter0_f_251_38441",x:0,y:0,width:208,height:208,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),g.createElement("feGaussianBlur",{stdDeviation:24,result:"effect1_foregroundBlur_251_38441"})),g.createElement("filter",{id:"filter1_d_251_38441",x:54.8569,y:58.8571,width:98.2856,height:98.2857,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),g.createElement("feOffset",{dy:4}),g.createElement("feGaussianBlur",{stdDeviation:2}),g.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),g.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),g.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_251_38441"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_251_38441",result:"shape"})),g.createElement("linearGradient",{id:"paint0_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint2_linear_251_38441",x1:118.653,y1:118.653,x2:89.0159,y2:89.0164,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("clipPath",{id:"clip0_251_38441"},g.createElement("rect",{width:27.4286,height:27.4286,fill:"white",transform:"translate(93.7139 90.2849)"})))),K5e=g.lazy(()=>r4(()=>import("./index-CoGs120j.js"),__vite__mapDeps([13,5,1,6])));function GVo({src:e,autoPlay:t=!0,config:r,controls:n=!0,height:a="100%",isModalOpen:l,loop:c=!1,muted:d=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const b=Me(),[w,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};r?.youtube&&(A.youtube=r.youtube);const S=()=>{v(!0),y?.()},E=()=>{v(!1),x?.()},I=()=>{v(!1),f?.(),l!=null&&x?.()},L=()=>{v(!0),y?.()};return l!=null?l?Fn.createPortal(s.jsx(JVo,{windowSize:b,role:"presentation",children:s.jsx(cr,{onClickAway:E,children:s.jsx(XVo,{windowSize:b,"data-testid":"video-player-modal",children:s.jsxs(eUo,{children:[p&&!w&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(ZVo,{src:h,alt:"Video thumbnail"}),s.jsx(KVo,{onClick:S,children:s.jsx(qVo,{windowSize:b})})]}),(!p||w)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,width:"100%",height:"100%",onEnded:I,onPlay:L,config:A})})]})})})}),document.body):null:s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:m,height:a,...u}}),children:s.jsx(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,width:m,height:a,style:u,light:p&&!w?h??!0:!1,onEnded:I,onPlay:L,config:A})})}const YVo=_t`
23909
+ `,B_e=e=>g.createElement("svg",{width:208,height:208,viewBox:"0 0 208 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{filter:"url(#filter0_f_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:44,fill:"url(#paint0_linear_251_38441)"}),g.createElement("circle",{cx:104,cy:104,r:50,stroke:"url(#paint1_linear_251_38441)",strokeWidth:12})),g.createElement("g",{filter:"url(#filter1_d_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:41.1429,fill:"#FAFAFA"}),g.createElement("circle",{cx:104,cy:104,r:43.1429,stroke:"url(#paint2_linear_251_38441)",strokeWidth:4})),g.createElement("g",{clipPath:"url(#clip0_251_38441)"},g.createElement("path",{d:"M120.16 102.411L96.2853 90.4684C96.0134 90.3343 95.7118 90.2718 95.409 90.2867C95.1062 90.3016 94.8122 90.3935 94.5548 90.5536C94.2974 90.7138 94.0851 90.9369 93.938 91.202C93.7908 91.467 93.7137 91.7652 93.7139 92.0684V115.931C93.7137 116.234 93.7908 116.533 93.938 116.798C94.0851 117.063 94.2974 117.286 94.5548 117.446C94.8122 117.606 95.1062 117.698 95.409 117.713C95.7118 117.728 96.0134 117.665 96.2853 117.531L120.16 105.588C120.456 105.442 120.706 105.216 120.88 104.935C121.055 104.654 121.147 104.33 121.147 104C121.147 103.669 121.055 103.345 120.88 103.065C120.706 102.784 120.456 102.558 120.16 102.411Z",fill:"black"})),g.createElement("defs",null,g.createElement("filter",{id:"filter0_f_251_38441",x:0,y:0,width:208,height:208,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),g.createElement("feGaussianBlur",{stdDeviation:24,result:"effect1_foregroundBlur_251_38441"})),g.createElement("filter",{id:"filter1_d_251_38441",x:54.8569,y:58.8571,width:98.2856,height:98.2857,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),g.createElement("feOffset",{dy:4}),g.createElement("feGaussianBlur",{stdDeviation:2}),g.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),g.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),g.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_251_38441"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_251_38441",result:"shape"})),g.createElement("linearGradient",{id:"paint0_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint2_linear_251_38441",x1:118.653,y1:118.653,x2:89.0159,y2:89.0164,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("clipPath",{id:"clip0_251_38441"},g.createElement("rect",{width:27.4286,height:27.4286,fill:"white",transform:"translate(93.7139 90.2849)"})))),K5e=g.lazy(()=>r4(()=>import("./index-DzHZDGWq.js"),__vite__mapDeps([13,5,1,6])));function GVo({src:e,autoPlay:t=!0,config:r,controls:n=!0,height:a="100%",isModalOpen:l,loop:c=!1,muted:d=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const b=Me(),[w,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};r?.youtube&&(A.youtube=r.youtube);const S=()=>{v(!0),y?.()},E=()=>{v(!1),x?.()},I=()=>{v(!1),f?.(),l!=null&&x?.()},L=()=>{v(!0),y?.()};return l!=null?l?Fn.createPortal(s.jsx(JVo,{windowSize:b,role:"presentation",children:s.jsx(cr,{onClickAway:E,children:s.jsx(XVo,{windowSize:b,"data-testid":"video-player-modal",children:s.jsxs(eUo,{children:[p&&!w&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(ZVo,{src:h,alt:"Video thumbnail"}),s.jsx(KVo,{onClick:S,children:s.jsx(qVo,{windowSize:b})})]}),(!p||w)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,width:"100%",height:"100%",onEnded:I,onPlay:L,config:A})})]})})})}),document.body):null:s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:m,height:a,...u}}),children:s.jsx(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,width:m,height:a,style:u,light:p&&!w?h??!0:!1,onEnded:I,onPlay:L,config:A})})}const YVo=_t`
23910
23910
  0% {
23911
23911
  transform: rotate(0deg);
23912
23912
  }
@@ -77527,7 +77527,7 @@ to {
77527
77527
  display: flex;
77528
77528
  flex-direction: column;
77529
77529
  gap: ${o.sp3};
77530
- /* padding: ${o.sp5}; */
77530
+ padding-top: ${o.sp3};
77531
77531
  `;i.div`
77532
77532
  display: flex;
77533
77533
  align-items: center;
@@ -77566,9 +77566,8 @@ to {
77566
77566
  color: ${e=>e.theme.colors.champion};
77567
77567
  `;i.div`
77568
77568
  display: flex;
77569
- flex: 1 1 auto;
77569
+ flex: 1 0 auto;
77570
77570
  flex-direction: column;
77571
- min-height: 0;
77572
77571
  gap: ${o.sp3};
77573
77572
  margin: ${o.sp0} ${o.sp5};
77574
77573
  `;i.div`
@@ -84309,7 +84308,7 @@ to {
84309
84308
  display: flex;
84310
84309
  flex-direction: column;
84311
84310
  width: 100%;
84312
- `;const{common:{all:ygn,settings:{integrations:{connectorTooltips:{accountantSectionLabel:bgn}}},texts:{manual:wgn}}}=W.getLocalizedStrings(),{common:i0,dateFormat:{visual:{MMMDCommaYYYYformat:vgn,MMMYYYYFormat:Cgn}},expenseAutomation:Agn,uncategorizedTransactionList:{missingReceipt:{bulkUpload:$gn}}}=W.getLocalizedStrings();i0.footer;i0.texts.maxLimitReached;i0.texts.confirmAction;i0.headers;i0.create;i0.strings;i0.texts;i0.cancel;i0.confirm;i0.monthsByIndex;const rS=220;i.div`
84311
+ `;const{common:{all:ygn,settings:{integrations:{connectorTooltips:{accountantSectionLabel:bgn}}},texts:{manual:wgn}}}=W.getLocalizedStrings(),{common:i0,dateFormat:{visual:{MMMDCommaYYYYformat:vgn}},expenseAutomation:Cgn,uncategorizedTransactionList:{missingReceipt:{bulkUpload:Agn}}}=W.getLocalizedStrings();i0.footer;i0.texts.maxLimitReached;i0.texts.confirmAction;i0.headers;i0.create;i0.strings;i0.texts;i0.cancel;i0.confirm;i0.monthsByIndex;const rS=220;i.div`
84313
84312
  width: 100%;
84314
84313
  height: 100vh;
84315
84314
  display: flex;
@@ -84486,7 +84485,7 @@ to {
84486
84485
  display: flex;
84487
84486
  flex-direction: column;
84488
84487
  gap: ${o.sp2};
84489
- `;const{common:{currency:kgn,strings:{hyphen:Sgn}},expenseAutomation:{jeSchedules:{accrualDetail:qXr}}}=W.getLocalizedStrings();qXr.billingPattern;const PKe=160;i.div`
84488
+ `;const{common:{currency:$gn,strings:{hyphen:kgn}},expenseAutomation:{jeSchedules:{accrualDetail:qXr}}}=W.getLocalizedStrings();qXr.billingPattern;const PKe=160;i.div`
84490
84489
  display: flex;
84491
84490
  flex-direction: column;
84492
84491
  gap: ${o.sp3};
@@ -84652,7 +84651,7 @@ to {
84652
84651
  `;i(Wl)`
84653
84652
  color: ${e=>e.theme.colors.champion};
84654
84653
  font-variant-numeric: tabular-nums;
84655
- `;const tei="scheduled_date",oei="on_bill_match",{common:{strings:{hyphen:Egn},settings:{integrations:{connectorTooltips:{accountantSectionLabel:Lgn}}}},dateFormat:Ign,expenseAutomation:{jeSchedules:{accrualDetail:rei,newSchedule:iei}}}=W.getLocalizedStrings(),Sve=rei.details;iei.fields;Sve.reverseNextMonthOption,Sve.onInvoiceMatch;i.div`
84654
+ `;const tei="scheduled_date",oei="on_bill_match",{common:{strings:{hyphen:Sgn},settings:{integrations:{connectorTooltips:{accountantSectionLabel:Egn}}}},dateFormat:Lgn,expenseAutomation:{jeSchedules:{accrualDetail:rei,newSchedule:iei}}}=W.getLocalizedStrings(),Sve=rei.details;iei.fields;Sve.reverseNextMonthOption,Sve.onInvoiceMatch;i.div`
84656
84655
  display: flex;
84657
84656
  flex-direction: column;
84658
84657
  width: 100%;
@@ -84660,7 +84659,7 @@ to {
84660
84659
  border-top: 1px solid ${e=>e.theme.colors.grey2};
84661
84660
  border-radius: ${o.sp2};
84662
84661
  background: ${e=>e.theme.colors.grey5};
84663
- `;const{common:{currency:jgn,strings:{hyphen:Mgn}},dateFormat:Bgn,expenseAutomation:{jeSchedules:{accrualDetail:nei,oneTimeAccrualType:Dgn}}}=W.getLocalizedStrings();nei.details;const ej={containerPadding:new j(C[3],C[5]),containerMarginTop:new j(C[3],C[3]),containerMarginBottom:new j(C[2],C[2]),vendorTitleContainerWidth:new j(187,480)},Eve=C[5];Q.smallMedium.cssObject;i.div`
84662
+ `;const{common:{currency:Ign,strings:{hyphen:jgn}},dateFormat:Mgn,expenseAutomation:{jeSchedules:{accrualDetail:nei,oneTimeAccrualType:Bgn}}}=W.getLocalizedStrings();nei.details;const ej={containerPadding:new j(C[3],C[5]),containerMarginTop:new j(C[3],C[3]),containerMarginBottom:new j(C[2],C[2]),vendorTitleContainerWidth:new j(187,480)},Eve=C[5];Q.smallMedium.cssObject;i.div`
84664
84663
  display: flex;
84665
84664
  width: 100%;
84666
84665
  box-sizing: border-box;
@@ -84744,7 +84743,7 @@ to {
84744
84743
  text-align: right;
84745
84744
  `;i(aei)`
84746
84745
  font-style: italic;
84747
- `;const{common:{strings:{colon:Pgn,hyphen:Tgn,middleDot:zgn}},expenseAutomation:{jeSchedules:{accrualDetail:zKe,newSchedule:{journalEntryPreview:Rgn}}}}=W.getLocalizedStrings();zKe.details;zKe.journalEntryPreview;Q.superSmallSemiBold.cssObject;i.div`
84746
+ `;const{common:{strings:{colon:Dgn,hyphen:Pgn,middleDot:Tgn}},expenseAutomation:{jeSchedules:{accrualDetail:zKe,newSchedule:{journalEntryPreview:zgn}}}}=W.getLocalizedStrings();zKe.details;zKe.journalEntryPreview;Q.superSmallSemiBold.cssObject;i.div`
84748
84747
  display: flex;
84749
84748
  flex-direction: column;
84750
84749
  width: 100%;
@@ -84814,7 +84813,7 @@ to {
84814
84813
  min-width: 0;
84815
84814
  text-align: right;
84816
84815
  color: ${e=>e.theme.colors.hero};
84817
- `;const{common:{strings:{hyphen:Fgn},texts:{revert:Ogn}},dateFormat:Ngn,expenseAutomation:{jeSchedules:{accrualDetail:FKe,oneTimeAccrualType:Hgn}}}=W.getLocalizedStrings();FKe.details;FKe.journalEntryPreview;i.div`
84816
+ `;const{common:{strings:{hyphen:Rgn},texts:{revert:Fgn}},dateFormat:Ogn,expenseAutomation:{jeSchedules:{accrualDetail:FKe,oneTimeAccrualType:Ngn}}}=W.getLocalizedStrings();FKe.details;FKe.journalEntryPreview;i.div`
84818
84817
  display: flex;
84819
84818
  flex-direction: column;
84820
84819
  width: 100%;
@@ -84849,7 +84848,7 @@ to {
84849
84848
  color: ${e=>e.theme.colors.champion};
84850
84849
  `;i(nt)`
84851
84850
  color: ${e=>e.theme.colors.hero};
84852
- `;const{common:{strings:{hyphen:_gn}}}=W.getLocalizedStrings(),sei=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.7561 2.44085C9.6635 1.99753 8.46443 1.88546 7.30882 2.11956C6.15324 2.35377 5.09186 2.92363 4.25804 3.75726L4.25511 3.76019C3.80991 4.21107 3.41216 4.64721 3.00023 5.12445V4.00042C3.00023 3.72428 2.77637 3.50042 2.50023 3.50042C2.2242 3.50057 2.00023 3.72437 2.00023 4.00042V6.50042C2.00023 6.50864 2.00276 6.51672 2.00315 6.52484C2.00406 6.54292 2.00617 6.56067 2.00901 6.57855C2.01116 6.59213 2.01361 6.60539 2.01683 6.61859C2.02145 6.63755 2.02756 6.65587 2.0344 6.67425C2.03899 6.68653 2.04355 6.69858 2.04905 6.71038C2.05674 6.72692 2.06587 6.7425 2.07542 6.75824C2.08341 6.77138 2.09168 6.78401 2.10081 6.79632C2.11004 6.80876 2.11961 6.82077 2.13011 6.83245C2.14217 6.84589 2.15476 6.85847 2.16819 6.87054C2.17412 6.87585 2.17856 6.88304 2.1848 6.88812C2.19104 6.89321 2.19889 6.89608 2.2053 6.90081C2.21763 6.90991 2.23024 6.91825 2.24339 6.9262C2.25854 6.93539 2.2735 6.94419 2.28929 6.9516C2.30386 6.95843 2.31891 6.96375 2.33421 6.96917C2.34949 6.9746 2.36451 6.97994 2.38011 6.98382C2.39612 6.9878 2.41236 6.99022 2.42894 6.99261C2.44525 6.99497 2.46136 6.99675 2.47776 6.99749C2.48524 6.99783 2.49266 7.00042 2.50023 7.00042H5.00023C5.27634 7.00042 5.50018 6.77653 5.50023 6.50042C5.50023 6.22428 5.27637 6.00042 5.00023 6.00042H3.56761C4.03801 5.44612 4.47186 4.96388 4.96507 4.46429C5.6599 3.76965 6.54412 3.29519 7.50706 3.10003C8.47019 2.90485 9.46951 2.99813 10.3801 3.36761C11.2906 3.73707 12.0724 4.36622 12.6272 5.17718C13.182 5.98829 13.485 6.94557 13.4992 7.92816C13.5134 8.91068 13.2383 9.87578 12.7073 10.7026C12.1762 11.5294 11.4134 12.1819 10.5139 12.5776C9.61441 12.9733 8.618 13.0943 7.64964 12.9272C6.68128 12.76 5.78333 12.3115 5.06858 11.6371C4.86774 11.4476 4.55107 11.4568 4.36155 11.6576C4.17229 11.8585 4.18131 12.1752 4.38206 12.3647C5.23975 13.174 6.31767 13.7119 7.47972 13.9125C8.64164 14.1131 9.83695 13.9674 10.9162 13.4926C11.9957 13.0177 12.9118 12.2348 13.5491 11.2426C14.1862 10.2505 14.5163 9.09246 14.4992 7.91351C14.4822 6.7344 14.1181 5.58606 13.4524 4.61273C12.7866 3.63953 11.8487 2.88421 10.7561 2.44085Z",fill:"currentColor"})),{common:{back:Vgn,texts:{refresh:Ugn},strings:{hyphen:Qgn}},expenseAutomation:{jeSchedules:{actualMatching:OKe}}}=W.getLocalizedStrings();OKe.matchModal;const lei=OKe.matchDetail,{reversalFailed:Wgn,undoFailed:Ggn}=lei,cei=_t`
84851
+ `;const{common:{strings:{hyphen:Hgn}}}=W.getLocalizedStrings(),sei=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.7561 2.44085C9.6635 1.99753 8.46443 1.88546 7.30882 2.11956C6.15324 2.35377 5.09186 2.92363 4.25804 3.75726L4.25511 3.76019C3.80991 4.21107 3.41216 4.64721 3.00023 5.12445V4.00042C3.00023 3.72428 2.77637 3.50042 2.50023 3.50042C2.2242 3.50057 2.00023 3.72437 2.00023 4.00042V6.50042C2.00023 6.50864 2.00276 6.51672 2.00315 6.52484C2.00406 6.54292 2.00617 6.56067 2.00901 6.57855C2.01116 6.59213 2.01361 6.60539 2.01683 6.61859C2.02145 6.63755 2.02756 6.65587 2.0344 6.67425C2.03899 6.68653 2.04355 6.69858 2.04905 6.71038C2.05674 6.72692 2.06587 6.7425 2.07542 6.75824C2.08341 6.77138 2.09168 6.78401 2.10081 6.79632C2.11004 6.80876 2.11961 6.82077 2.13011 6.83245C2.14217 6.84589 2.15476 6.85847 2.16819 6.87054C2.17412 6.87585 2.17856 6.88304 2.1848 6.88812C2.19104 6.89321 2.19889 6.89608 2.2053 6.90081C2.21763 6.90991 2.23024 6.91825 2.24339 6.9262C2.25854 6.93539 2.2735 6.94419 2.28929 6.9516C2.30386 6.95843 2.31891 6.96375 2.33421 6.96917C2.34949 6.9746 2.36451 6.97994 2.38011 6.98382C2.39612 6.9878 2.41236 6.99022 2.42894 6.99261C2.44525 6.99497 2.46136 6.99675 2.47776 6.99749C2.48524 6.99783 2.49266 7.00042 2.50023 7.00042H5.00023C5.27634 7.00042 5.50018 6.77653 5.50023 6.50042C5.50023 6.22428 5.27637 6.00042 5.00023 6.00042H3.56761C4.03801 5.44612 4.47186 4.96388 4.96507 4.46429C5.6599 3.76965 6.54412 3.29519 7.50706 3.10003C8.47019 2.90485 9.46951 2.99813 10.3801 3.36761C11.2906 3.73707 12.0724 4.36622 12.6272 5.17718C13.182 5.98829 13.485 6.94557 13.4992 7.92816C13.5134 8.91068 13.2383 9.87578 12.7073 10.7026C12.1762 11.5294 11.4134 12.1819 10.5139 12.5776C9.61441 12.9733 8.618 13.0943 7.64964 12.9272C6.68128 12.76 5.78333 12.3115 5.06858 11.6371C4.86774 11.4476 4.55107 11.4568 4.36155 11.6576C4.17229 11.8585 4.18131 12.1752 4.38206 12.3647C5.23975 13.174 6.31767 13.7119 7.47972 13.9125C8.64164 14.1131 9.83695 13.9674 10.9162 13.4926C11.9957 13.0177 12.9118 12.2348 13.5491 11.2426C14.1862 10.2505 14.5163 9.09246 14.4992 7.91351C14.4822 6.7344 14.1181 5.58606 13.4524 4.61273C12.7866 3.63953 11.8487 2.88421 10.7561 2.44085Z",fill:"currentColor"})),{common:{back:_gn,texts:{refresh:Vgn},strings:{hyphen:Ugn}},expenseAutomation:{jeSchedules:{actualMatching:OKe}}}=W.getLocalizedStrings();OKe.matchModal;const lei=OKe.matchDetail,{reversalFailed:Qgn,undoFailed:Wgn}=lei,cei=_t`
84853
84852
  0% {
84854
84853
  transform: rotate(0deg);
84855
84854
  }
@@ -85280,7 +85279,7 @@ to {
85280
85279
  color: ${e=>e.status==="connected"?e.theme.colors.success:e.status==="reconnect"?e.theme.colors.important:e.theme.colors.link};
85281
85280
  cursor: pointer;
85282
85281
  text-decoration: underline;
85283
- `;const{common:Ygn,expenseAutomation:{accountRecon:Kgn}}=W.getLocalizedStrings(),{common:qgn,dateFormat:Zgn,expenseAutomation:{accountRecon:{reconciliation:{drawer:{dateRangeConflict:Jgn}}}}}=W.getLocalizedStrings();i.div`
85282
+ `;const{common:Ggn,expenseAutomation:{accountRecon:Ygn}}=W.getLocalizedStrings(),{common:Kgn,dateFormat:qgn,expenseAutomation:{accountRecon:{reconciliation:{drawer:{dateRangeConflict:Zgn}}}}}=W.getLocalizedStrings();i.div`
85284
85283
  width: 100%;
85285
85284
  box-sizing: border-box;
85286
85285
  padding: 0 ${o.sp4} ${o.sp4};
@@ -86027,7 +86026,7 @@ to {
86027
86026
  color: ${k.tagWarningColorLight};
86028
86027
  `,roi=i(nt)`
86029
86028
  color: ${k.tagWarningColorLight};
86030
- `,{expenseAutomation:{accountRecon:{statementProcessing:Xgn}},common:e3n}=W.getLocalizedStrings();i.div`
86029
+ `,{expenseAutomation:{accountRecon:{statementProcessing:Jgn}},common:Xgn}=W.getLocalizedStrings();i.div`
86031
86030
  flex: 1;
86032
86031
  display: flex;
86033
86032
  flex-direction: column;
@@ -86215,7 +86214,7 @@ to {
86215
86214
  align-items: center;
86216
86215
  justify-content: flex-end;
86217
86216
  flex-shrink: 0;
86218
- `;const ioi=64,noi="51px",{expenseAutomation:{accountRecon:{reconciliation:{drawer:t3n}}},common:{upload:o3n,texts:{uploading:r3n}}}=W.getLocalizedStrings(),Jve=e=>`url("data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'><rect width='100%' height='100%' rx='8' ry='8' fill='none' stroke='${e}' stroke-width='2' stroke-dasharray='8,8'/></svg>`)}")`;i.div`
86217
+ `;const ioi=64,noi="51px",{expenseAutomation:{accountRecon:{reconciliation:{drawer:e3n}}},common:{upload:t3n,texts:{uploading:o3n}}}=W.getLocalizedStrings(),Jve=e=>`url("data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'><rect width='100%' height='100%' rx='8' ry='8' fill='none' stroke='${e}' stroke-width='2' stroke-dasharray='8,8'/></svg>`)}")`;i.div`
86219
86218
  display: flex;
86220
86219
  flex-direction: column;
86221
86220
  width: 100%;
@@ -86290,7 +86289,7 @@ to {
86290
86289
  justify-content: center;
86291
86290
  `;i(ue)`
86292
86291
  color: ${k.success};
86293
- `;const{common:ZKe,expenseAutomation:{accountRecon:JKe}}=W.getLocalizedStrings(),{texts:{uploadStatement:i3n}}=ZKe,{texts:{review:n3n}}=ZKe;JKe.statementProcessing.steps.length;JKe.statementProcessing.steps.length;i.div`
86292
+ `;const{common:ZKe,expenseAutomation:{accountRecon:JKe}}=W.getLocalizedStrings(),{texts:{uploadStatement:r3n}}=ZKe,{texts:{review:i3n}}=ZKe;JKe.statementProcessing.steps.length;JKe.statementProcessing.steps.length;i.div`
86294
86293
  display: flex;
86295
86294
  flex-direction: column;
86296
86295
  background-color: ${e=>e.theme.colors.grey5};
@@ -86545,7 +86544,7 @@ to {
86545
86544
  color: ${e=>e.status==="connected"?e.theme.colors.success:e.status==="reconnect"?e.theme.colors.important:e.theme.colors.link};
86546
86545
  cursor: pointer;
86547
86546
  text-decoration: underline;
86548
- `;const{dateFormat:{visual:a3n},common:{documents:s3n,texts:{dragAndDropOrClick:l3n},strings:{colon:c3n}}}=W.getLocalizedStrings(),aoi={width:new j(343,580,756)};i.div`
86547
+ `;const{dateFormat:{visual:n3n},common:{documents:a3n,texts:{dragAndDropOrClick:s3n},strings:{colon:l3n}}}=W.getLocalizedStrings(),aoi={width:new j(343,580,756)};i.div`
86549
86548
  display: flex;
86550
86549
  flex-direction: column;
86551
86550
  `;i.div`
@@ -86555,7 +86554,7 @@ to {
86555
86554
  background-color: ${e=>e.theme.colors.grey5};
86556
86555
  border-top: 1px solid ${e=>e.theme.colors.grey2};
86557
86556
  border-radius: ${o.sp2};
86558
- `;const{common:d3n,commonSetUp:{internationalWire:p3n},dateFormat:{analytics:{YYYYDashMMDashDDFormat:u3n}}}=W.getLocalizedStrings(),$w={width:new j(343,580,756),titleWidth:new j(343,580,756,826),subTitlePaddingTop:new j(12,C[3]),subTitlePaddingBottom:new j(C[3],C[3]),verificationDetailsRowGap:new j(12,C[5],C[5])},soi={title:new vt("largeSemiBold","largeSemiBold")};i.div`
86557
+ `;const{common:c3n,commonSetUp:{internationalWire:d3n},dateFormat:{analytics:{YYYYDashMMDashDDFormat:p3n}}}=W.getLocalizedStrings(),$w={width:new j(343,580,756),titleWidth:new j(343,580,756,826),subTitlePaddingTop:new j(12,C[3]),subTitlePaddingBottom:new j(C[3],C[3]),verificationDetailsRowGap:new j(12,C[5],C[5])},soi={title:new vt("largeSemiBold","largeSemiBold")};i.div`
86559
86558
  display: flex;
86560
86559
  min-height: 100%;
86561
86560
  flex-direction: column;
@@ -86597,7 +86596,7 @@ to {
86597
86596
  margin-bottom: ${o.sp2};
86598
86597
  color: ${e=>e.theme.colors.champion};
86599
86598
  ${e=>`${soi.title.style(e.windowSize)}`};
86600
- `;const{spendManagement:{zeniAccounts:{expressPay:{progressBar:{stateOne:h3n,stateThree:m3n}}}},common:{texts:{paymentDetails:g3n}}}=W.getLocalizedStrings(),loi={progressBarWidth:new j(343,756)};i.div`
86599
+ `;const{spendManagement:{zeniAccounts:{expressPay:{progressBar:{stateOne:u3n,stateThree:h3n}}}},common:{texts:{paymentDetails:m3n}}}=W.getLocalizedStrings(),loi={progressBarWidth:new j(343,756)};i.div`
86601
86600
  display: flex;
86602
86601
  flex-direction: column;
86603
86602
  margin-top: ${o.sp3};
@@ -86637,7 +86636,7 @@ to {
86637
86636
  position: relative;
86638
86637
  height: ${e=>`${e.perSectionHeight}%`};
86639
86638
  color: ${e=>e.isRelevant?e.theme.colors.primary:e.theme.colors.grey2};
86640
- `;const{spendManagement:coi,dateFormat:f3n,common:x3n}=W.getLocalizedStrings();coi.billPay;const doi={containerWidth:new j(343,580,756)};i(nr)`
86639
+ `;const{spendManagement:coi,dateFormat:g3n,common:f3n}=W.getLocalizedStrings();coi.billPay;const doi={containerWidth:new j(343,580,756)};i(nr)`
86641
86640
  color: ${e=>e.theme.colors.primary};
86642
86641
  margin-bottom: ${o.sp3};
86643
86642
  `;i.div`
@@ -86677,7 +86676,7 @@ to {
86677
86676
  border-radius: ${o.sp0} ${o.sp0} ${o.sp2} ${o.sp2};
86678
86677
  text-align: ${e=>e.windowSize==="small"?"initial":"right"};
86679
86678
  color: ${e=>e.isError?k.important:e.theme.colors.grey1};
86680
- `;const{spendManagement:{zeniAccounts:{expressPay:y3n}},common:{texts:{selectType:b3n,addEmail:w3n}}}=W.getLocalizedStrings();i(nr)`
86679
+ `;const{spendManagement:{zeniAccounts:{expressPay:x3n}},common:{texts:{selectType:y3n,addEmail:b3n}}}=W.getLocalizedStrings();i(nr)`
86681
86680
  color: ${e=>e.theme.colors.primary};
86682
86681
  margin-bottom: ${o.sp3};
86683
86682
  `;i.div`
@@ -86688,7 +86687,7 @@ to {
86688
86687
  flex-direction: column;
86689
86688
  background-color: ${e=>e.theme.colors.grey5};
86690
86689
  border-radius: ${o.sp2};
86691
- `;const{spendManagement:{billPay:v3n},dateFormat:C3n,common:A3n}=W.getLocalizedStrings(),Oq={containerWidth:new j(343,580,756),reviewContainerMarginLeft:new j(C[3],C[6]),reviewContainerMarginRight:new j(C[3],C[8])};i.div``;i.div`
86690
+ `;const{spendManagement:{billPay:w3n},dateFormat:v3n,common:C3n}=W.getLocalizedStrings(),Oq={containerWidth:new j(343,580,756),reviewContainerMarginLeft:new j(C[3],C[6]),reviewContainerMarginRight:new j(C[3],C[8])};i.div``;i.div`
86692
86691
  display: flex;
86693
86692
  width: 100%;
86694
86693
  box-sizing: border-box;
@@ -86780,7 +86779,7 @@ to {
86780
86779
  &:last-child {
86781
86780
  border-bottom: none;
86782
86781
  }
86783
- `;const{common:poi,spendManagement:$3n}=W.getLocalizedStrings(),{texts:{sendMoney:k3n}}=poi;i.div`
86782
+ `;const{common:poi,spendManagement:A3n}=W.getLocalizedStrings(),{texts:{sendMoney:$3n}}=poi;i.div`
86784
86783
  display: flex;
86785
86784
  flex-wrap: wrap;
86786
86785
  height: 100%;
@@ -86812,7 +86811,7 @@ to {
86812
86811
  background-color: ${e=>e.theme.colors.grey5};
86813
86812
  border: ${e=>`1px solid ${e.theme.colors.grey3}`};
86814
86813
  outline: none;
86815
- `;const{common:{texts:{openInSidePanel:S3n,openInFullView:E3n}}}=W.getLocalizedStrings();i.div`
86814
+ `;const{common:{texts:{openInSidePanel:k3n,openInFullView:S3n}}}=W.getLocalizedStrings();i.div`
86816
86815
  position: relative;
86817
86816
  display: flex;
86818
86817
  flex-direction: column;
@@ -86941,7 +86940,7 @@ to {
86941
86940
  svg {
86942
86941
  scale: ${({scale:e})=>e};
86943
86942
  }
86944
- `;const{aiCfo:{tooltips:{chatWithAI:L3n}},common:{strings:{empty:I3n}}}=W.getLocalizedStrings();i.div`
86943
+ `;const{aiCfo:{tooltips:{chatWithAI:E3n}},common:{strings:{empty:L3n}}}=W.getLocalizedStrings();i.div`
86945
86944
  display: flex;
86946
86945
  align-items: center;
86947
86946
  justify-content: center;
@@ -87122,7 +87121,7 @@ to {
87122
87121
  `;i($i)`
87123
87122
  color: ${e=>e.theme.colors.primary};
87124
87123
  letter-spacing: -0.01em;
87125
- `;const moi=e=>g.createElement("svg",{width:255,height:189,viewBox:"0 0 255 189",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{clipPath:"url(#clip0_251_38259)"},g.createElement("path",{d:"M0 9.02466C73.8923 -8.35395 80.6314 49.7252 156.567 49.7252C232.502 49.7252 228.443 7.99003 304.378 7.99003C380.313 7.99003 376.254 49.7252 452.189 49.7252C528.124 49.7252 524.065 7.99003 600 7.99003C675.935 7.99003 671.876 49.7252 747.811 49.7252C823.746 49.7252 819.687 7.99003 895.622 7.99003C971.557 7.99003 967.498 49.7252 1043.43 49.7252C1119.37 49.7252 1126.11 -8.38048 1200 9.02466",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 18.9788C73.8923 1.60015 80.6314 59.6793 156.567 59.6793C232.502 59.6793 228.443 17.9441 304.378 17.9441C380.313 17.9441 376.254 59.6793 452.189 59.6793C528.124 59.6793 524.065 17.9441 600 17.9441C675.935 17.9441 671.876 59.6793 747.811 59.6793C823.746 59.6793 819.687 17.9441 895.622 17.9441C971.557 17.9441 967.498 59.6793 1043.43 59.6793C1119.37 59.6793 1126.11 1.57362 1200 18.9788",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 28.9329C73.8923 11.5543 80.6314 69.6334 156.567 69.6334C232.502 69.6334 228.443 27.8982 304.378 27.8982C380.313 27.8982 376.254 69.6334 452.189 69.6334C528.124 69.6334 524.065 27.8982 600 27.8982C675.935 27.8982 671.876 69.6334 747.811 69.6334C823.746 69.6334 819.687 27.8982 895.622 27.8982C971.557 27.8982 967.498 69.6334 1043.43 69.6334C1119.37 69.6334 1126.11 11.5277 1200 28.9329",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 38.887C73.8923 21.5084 80.6314 79.5875 156.567 79.5875C232.502 79.5875 228.443 37.8523 304.378 37.8523C380.313 37.8523 376.254 79.5875 452.189 79.5875C528.124 79.5875 524.065 37.8523 600 37.8523C675.935 37.8523 671.876 79.5875 747.811 79.5875C823.746 79.5875 819.687 37.8523 895.622 37.8523C971.557 37.8523 967.498 79.5875 1043.43 79.5875C1119.37 79.5875 1126.11 21.4818 1200 38.887",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 48.8411C73.8923 31.4625 80.6314 89.5416 156.567 89.5416C232.502 89.5416 228.443 47.8064 304.378 47.8064C380.313 47.8064 376.254 89.5416 452.189 89.5416C528.124 89.5416 524.065 47.8064 600 47.8064C675.935 47.8064 671.876 89.5416 747.811 89.5416C823.746 89.5416 819.687 47.8064 895.622 47.8064C971.557 47.8064 967.498 89.5416 1043.43 89.5416C1119.37 89.5416 1126.11 31.4359 1200 48.8411",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 58.7952C73.8923 41.4166 80.6314 99.4957 156.567 99.4957C232.502 99.4957 228.443 57.7605 304.378 57.7605C380.313 57.7605 376.254 99.4957 452.189 99.4957C528.124 99.4957 524.065 57.7605 600 57.7605C675.935 57.7605 671.876 99.4957 747.811 99.4957C823.746 99.4957 819.687 57.7605 895.622 57.7605C971.557 57.7605 967.498 99.4957 1043.43 99.4957C1119.37 99.4957 1126.11 41.39 1200 58.7952",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 68.7493C73.8923 51.3707 80.6314 109.45 156.567 109.45C232.502 109.45 228.443 67.7146 304.378 67.7146C380.313 67.7146 376.254 109.45 452.189 109.45C528.124 109.45 524.065 67.7146 600 67.7146C675.935 67.7146 671.876 109.45 747.811 109.45C823.746 109.45 819.687 67.7146 895.622 67.7146C971.557 67.7146 967.498 109.45 1043.43 109.45C1119.37 109.45 1126.11 51.3441 1200 68.7493",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 78.7034C73.8923 61.3248 80.6314 119.404 156.567 119.404C232.502 119.404 228.443 77.6687 304.378 77.6687C380.313 77.6687 376.254 119.404 452.189 119.404C528.124 119.404 524.065 77.6687 600 77.6687C675.935 77.6687 671.876 119.404 747.811 119.404C823.746 119.404 819.687 77.6687 895.622 77.6687C971.557 77.6687 967.498 119.404 1043.43 119.404C1119.37 119.404 1126.11 61.2982 1200 78.7034",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 88.6575C73.8923 71.2789 80.6314 129.358 156.567 129.358C232.502 129.358 228.443 87.6228 304.378 87.6228C380.313 87.6228 376.254 129.358 452.189 129.358C528.124 129.358 524.065 87.6228 600 87.6228C675.935 87.6228 671.876 129.358 747.811 129.358C823.746 129.358 819.687 87.6228 895.622 87.6228C971.557 87.6228 967.498 129.358 1043.43 129.358C1119.37 129.358 1126.11 71.2523 1200 88.6575",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 98.6116C73.8923 81.233 80.6314 139.312 156.567 139.312C232.502 139.312 228.443 97.5769 304.378 97.5769C380.313 97.5769 376.254 139.312 452.189 139.312C528.124 139.312 524.065 97.5769 600 97.5769C675.935 97.5769 671.876 139.312 747.811 139.312C823.746 139.312 819.687 97.5769 895.622 97.5769C971.557 97.5769 967.498 139.312 1043.43 139.312C1119.37 139.312 1126.11 81.2064 1200 98.6116",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 108.566C73.8923 91.1871 80.6314 149.266 156.567 149.266C232.502 149.266 228.443 107.531 304.378 107.531C380.313 107.531 376.254 149.266 452.189 149.266C528.124 149.266 524.065 107.531 600 107.531C675.935 107.531 671.876 149.266 747.811 149.266C823.746 149.266 819.687 107.531 895.622 107.531C971.557 107.531 967.498 149.266 1043.43 149.266C1119.37 149.266 1126.11 91.1605 1200 108.566",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 118.52C73.8923 101.141 80.6314 159.22 156.567 159.22C232.502 159.22 228.443 117.485 304.378 117.485C380.313 117.485 376.254 159.22 452.189 159.22C528.124 159.22 524.065 117.485 600 117.485C675.935 117.485 671.876 159.22 747.811 159.22C823.746 159.22 819.687 117.485 895.622 117.485C971.557 117.485 967.498 159.22 1043.43 159.22C1119.37 159.22 1126.11 101.115 1200 118.52",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 128.474C73.8923 111.095 80.6314 169.174 156.567 169.174C232.502 169.174 228.443 127.439 304.378 127.439C380.313 127.439 376.254 169.174 452.189 169.174C528.124 169.174 524.065 127.439 600 127.439C675.935 127.439 671.876 169.174 747.811 169.174C823.746 169.174 819.687 127.439 895.622 127.439C971.557 127.439 967.498 169.174 1043.43 169.174C1119.37 169.174 1126.11 111.069 1200 128.474",stroke:"#97C3B9",strokeWidth:1.5})),g.createElement("defs",null,g.createElement("clipPath",{id:"clip0_251_38259"},g.createElement("rect",{width:255,height:189,fill:"white"})))),goi=e=>g.createElement("svg",{width:255,height:189,viewBox:"0 0 255 189",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{clipPath:"url(#clip0_251_38273)"},g.createElement("path",{d:"M255 9.02466C181.108 -8.35395 174.369 49.7252 98.4333 49.7252C22.498 49.7252 26.5575 7.99003 -49.3778 7.99003C-125.313 7.99003 -121.254 49.7252 -197.189 49.7252C-273.124 49.7252 -269.065 7.99003 -345 7.99003C-420.935 7.99003 -416.876 49.7252 -492.811 49.7252C-568.746 49.7252 -564.687 7.99003 -640.622 7.99003C-716.557 7.99003 -712.498 49.7252 -788.433 49.7252C-864.369 49.7252 -871.108 -8.38048 -945 9.02466",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 18.9788C181.108 1.60015 174.369 59.6793 98.4333 59.6793C22.498 59.6793 26.5575 17.9441 -49.3778 17.9441C-125.313 17.9441 -121.254 59.6793 -197.189 59.6793C-273.124 59.6793 -269.065 17.9441 -345 17.9441C-420.935 17.9441 -416.876 59.6793 -492.811 59.6793C-568.746 59.6793 -564.687 17.9441 -640.622 17.9441C-716.557 17.9441 -712.498 59.6793 -788.433 59.6793C-864.369 59.6793 -871.108 1.57362 -945 18.9788",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 28.9329C181.108 11.5543 174.369 69.6334 98.4333 69.6334C22.498 69.6334 26.5575 27.8982 -49.3778 27.8982C-125.313 27.8982 -121.254 69.6334 -197.189 69.6334C-273.124 69.6334 -269.065 27.8982 -345 27.8982C-420.935 27.8982 -416.876 69.6334 -492.811 69.6334C-568.746 69.6334 -564.687 27.8982 -640.622 27.8982C-716.557 27.8982 -712.498 69.6334 -788.433 69.6334C-864.369 69.6334 -871.108 11.5277 -945 28.9329",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 38.887C181.108 21.5084 174.369 79.5875 98.4333 79.5875C22.498 79.5875 26.5575 37.8523 -49.3778 37.8523C-125.313 37.8523 -121.254 79.5875 -197.189 79.5875C-273.124 79.5875 -269.065 37.8523 -345 37.8523C-420.935 37.8523 -416.876 79.5875 -492.811 79.5875C-568.746 79.5875 -564.687 37.8523 -640.622 37.8523C-716.557 37.8523 -712.498 79.5875 -788.433 79.5875C-864.369 79.5875 -871.108 21.4818 -945 38.887",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 48.8411C181.108 31.4625 174.369 89.5416 98.4333 89.5416C22.498 89.5416 26.5575 47.8064 -49.3778 47.8064C-125.313 47.8064 -121.254 89.5416 -197.189 89.5416C-273.124 89.5416 -269.065 47.8064 -345 47.8064C-420.935 47.8064 -416.876 89.5416 -492.811 89.5416C-568.746 89.5416 -564.687 47.8064 -640.622 47.8064C-716.557 47.8064 -712.498 89.5416 -788.433 89.5416C-864.369 89.5416 -871.108 31.4359 -945 48.8411",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 58.7952C181.108 41.4166 174.369 99.4957 98.4333 99.4957C22.498 99.4957 26.5575 57.7605 -49.3778 57.7605C-125.313 57.7605 -121.254 99.4957 -197.189 99.4957C-273.124 99.4957 -269.065 57.7605 -345 57.7605C-420.935 57.7605 -416.876 99.4957 -492.811 99.4957C-568.746 99.4957 -564.687 57.7605 -640.622 57.7605C-716.557 57.7605 -712.498 99.4957 -788.433 99.4957C-864.369 99.4957 -871.108 41.39 -945 58.7952",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 68.7493C181.108 51.3707 174.369 109.45 98.4333 109.45C22.498 109.45 26.5575 67.7146 -49.3778 67.7146C-125.313 67.7146 -121.254 109.45 -197.189 109.45C-273.124 109.45 -269.065 67.7146 -345 67.7146C-420.935 67.7146 -416.876 109.45 -492.811 109.45C-568.746 109.45 -564.687 67.7146 -640.622 67.7146C-716.557 67.7146 -712.498 109.45 -788.433 109.45C-864.369 109.45 -871.108 51.3441 -945 68.7493",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 78.7034C181.108 61.3248 174.369 119.404 98.4333 119.404C22.498 119.404 26.5575 77.6687 -49.3778 77.6687C-125.313 77.6687 -121.254 119.404 -197.189 119.404C-273.124 119.404 -269.065 77.6687 -345 77.6687C-420.935 77.6687 -416.876 119.404 -492.811 119.404C-568.746 119.404 -564.687 77.6687 -640.622 77.6687C-716.557 77.6687 -712.498 119.404 -788.433 119.404C-864.369 119.404 -871.108 61.2982 -945 78.7034",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 88.6575C181.108 71.2789 174.369 129.358 98.4333 129.358C22.498 129.358 26.5575 87.6228 -49.3778 87.6228C-125.313 87.6228 -121.254 129.358 -197.189 129.358C-273.124 129.358 -269.065 87.6228 -345 87.6228C-420.935 87.6228 -416.876 129.358 -492.811 129.358C-568.746 129.358 -564.687 87.6228 -640.622 87.6228C-716.557 87.6228 -712.498 129.358 -788.433 129.358C-864.369 129.358 -871.108 71.2523 -945 88.6575",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 98.6116C181.108 81.233 174.369 139.312 98.4333 139.312C22.498 139.312 26.5575 97.5769 -49.3778 97.5769C-125.313 97.5769 -121.254 139.312 -197.189 139.312C-273.124 139.312 -269.065 97.5769 -345 97.5769C-420.935 97.5769 -416.876 139.312 -492.811 139.312C-568.746 139.312 -564.687 97.5769 -640.622 97.5769C-716.557 97.5769 -712.498 139.312 -788.433 139.312C-864.369 139.312 -871.108 81.2064 -945 98.6116",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 108.566C181.108 91.1871 174.369 149.266 98.4333 149.266C22.498 149.266 26.5575 107.531 -49.3778 107.531C-125.313 107.531 -121.254 149.266 -197.189 149.266C-273.124 149.266 -269.065 107.531 -345 107.531C-420.935 107.531 -416.876 149.266 -492.811 149.266C-568.746 149.266 -564.687 107.531 -640.622 107.531C-716.557 107.531 -712.498 149.266 -788.433 149.266C-864.369 149.266 -871.108 91.1605 -945 108.566",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 118.52C181.108 101.141 174.369 159.22 98.4333 159.22C22.498 159.22 26.5575 117.485 -49.3778 117.485C-125.313 117.485 -121.254 159.22 -197.189 159.22C-273.124 159.22 -269.065 117.485 -345 117.485C-420.935 117.485 -416.876 159.22 -492.811 159.22C-568.746 159.22 -564.687 117.485 -640.622 117.485C-716.557 117.485 -712.498 159.22 -788.433 159.22C-864.369 159.22 -871.108 101.115 -945 118.52",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 128.474C181.108 111.095 174.369 169.174 98.4333 169.174C22.498 169.174 26.5575 127.439 -49.3778 127.439C-125.313 127.439 -121.254 169.174 -197.189 169.174C-273.124 169.174 -269.065 127.439 -345 127.439C-420.935 127.439 -416.876 169.174 -492.811 169.174C-568.746 169.174 -564.687 127.439 -640.622 127.439C-716.557 127.439 -712.498 169.174 -788.433 169.174C-864.369 169.174 -871.108 111.069 -945 128.474",stroke:"#97C3B9",strokeWidth:1.5})),g.createElement("defs",null,g.createElement("clipPath",{id:"clip0_251_38273"},g.createElement("rect",{width:255,height:189,fill:"white",transform:"matrix(-1 0 0 1 255 0)"})))),{common:j3n,spendManagement:foi}=W.getLocalizedStrings();foi.treasury.promoPage;const _2={mainHeading:new vt("h6Medium","h4Regular"),subHeading:new vt("largeRegular","h6Regular"),fundSymbol:new vt("smallSemiBold","standardSemiBold"),fundName:new vt("h7SemiBold","h5SemiBold"),fundSubName:new vt("largeMedium","h6SemiBold"),highlightValue:new vt("standardRegular","extraLargeMedium"),highlightLabel:new vt("smallRegular","standardRegular"),uspItemTitle:new vt("h7Medium","h6Medium"),uspItemDescription:new vt("smallRegular","largeRegular")},Ic={uspLogoSize:new j(C[4],C[5]),cardsGap:new j(C[4],C[6]),fundHeaderGap:new j(C[0],C[2]),fundHeaderPadding:new j(C[3],C[4]),fundHeaderPaddingTop:new j(C[4],C[7]),fundHighlightsPadding:new j(C[2],C[3]),highlightItemGap:new j(C[0],C[1])};i.div`
87124
+ `;const moi=e=>g.createElement("svg",{width:255,height:189,viewBox:"0 0 255 189",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{clipPath:"url(#clip0_251_38259)"},g.createElement("path",{d:"M0 9.02466C73.8923 -8.35395 80.6314 49.7252 156.567 49.7252C232.502 49.7252 228.443 7.99003 304.378 7.99003C380.313 7.99003 376.254 49.7252 452.189 49.7252C528.124 49.7252 524.065 7.99003 600 7.99003C675.935 7.99003 671.876 49.7252 747.811 49.7252C823.746 49.7252 819.687 7.99003 895.622 7.99003C971.557 7.99003 967.498 49.7252 1043.43 49.7252C1119.37 49.7252 1126.11 -8.38048 1200 9.02466",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 18.9788C73.8923 1.60015 80.6314 59.6793 156.567 59.6793C232.502 59.6793 228.443 17.9441 304.378 17.9441C380.313 17.9441 376.254 59.6793 452.189 59.6793C528.124 59.6793 524.065 17.9441 600 17.9441C675.935 17.9441 671.876 59.6793 747.811 59.6793C823.746 59.6793 819.687 17.9441 895.622 17.9441C971.557 17.9441 967.498 59.6793 1043.43 59.6793C1119.37 59.6793 1126.11 1.57362 1200 18.9788",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 28.9329C73.8923 11.5543 80.6314 69.6334 156.567 69.6334C232.502 69.6334 228.443 27.8982 304.378 27.8982C380.313 27.8982 376.254 69.6334 452.189 69.6334C528.124 69.6334 524.065 27.8982 600 27.8982C675.935 27.8982 671.876 69.6334 747.811 69.6334C823.746 69.6334 819.687 27.8982 895.622 27.8982C971.557 27.8982 967.498 69.6334 1043.43 69.6334C1119.37 69.6334 1126.11 11.5277 1200 28.9329",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 38.887C73.8923 21.5084 80.6314 79.5875 156.567 79.5875C232.502 79.5875 228.443 37.8523 304.378 37.8523C380.313 37.8523 376.254 79.5875 452.189 79.5875C528.124 79.5875 524.065 37.8523 600 37.8523C675.935 37.8523 671.876 79.5875 747.811 79.5875C823.746 79.5875 819.687 37.8523 895.622 37.8523C971.557 37.8523 967.498 79.5875 1043.43 79.5875C1119.37 79.5875 1126.11 21.4818 1200 38.887",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 48.8411C73.8923 31.4625 80.6314 89.5416 156.567 89.5416C232.502 89.5416 228.443 47.8064 304.378 47.8064C380.313 47.8064 376.254 89.5416 452.189 89.5416C528.124 89.5416 524.065 47.8064 600 47.8064C675.935 47.8064 671.876 89.5416 747.811 89.5416C823.746 89.5416 819.687 47.8064 895.622 47.8064C971.557 47.8064 967.498 89.5416 1043.43 89.5416C1119.37 89.5416 1126.11 31.4359 1200 48.8411",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 58.7952C73.8923 41.4166 80.6314 99.4957 156.567 99.4957C232.502 99.4957 228.443 57.7605 304.378 57.7605C380.313 57.7605 376.254 99.4957 452.189 99.4957C528.124 99.4957 524.065 57.7605 600 57.7605C675.935 57.7605 671.876 99.4957 747.811 99.4957C823.746 99.4957 819.687 57.7605 895.622 57.7605C971.557 57.7605 967.498 99.4957 1043.43 99.4957C1119.37 99.4957 1126.11 41.39 1200 58.7952",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 68.7493C73.8923 51.3707 80.6314 109.45 156.567 109.45C232.502 109.45 228.443 67.7146 304.378 67.7146C380.313 67.7146 376.254 109.45 452.189 109.45C528.124 109.45 524.065 67.7146 600 67.7146C675.935 67.7146 671.876 109.45 747.811 109.45C823.746 109.45 819.687 67.7146 895.622 67.7146C971.557 67.7146 967.498 109.45 1043.43 109.45C1119.37 109.45 1126.11 51.3441 1200 68.7493",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 78.7034C73.8923 61.3248 80.6314 119.404 156.567 119.404C232.502 119.404 228.443 77.6687 304.378 77.6687C380.313 77.6687 376.254 119.404 452.189 119.404C528.124 119.404 524.065 77.6687 600 77.6687C675.935 77.6687 671.876 119.404 747.811 119.404C823.746 119.404 819.687 77.6687 895.622 77.6687C971.557 77.6687 967.498 119.404 1043.43 119.404C1119.37 119.404 1126.11 61.2982 1200 78.7034",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 88.6575C73.8923 71.2789 80.6314 129.358 156.567 129.358C232.502 129.358 228.443 87.6228 304.378 87.6228C380.313 87.6228 376.254 129.358 452.189 129.358C528.124 129.358 524.065 87.6228 600 87.6228C675.935 87.6228 671.876 129.358 747.811 129.358C823.746 129.358 819.687 87.6228 895.622 87.6228C971.557 87.6228 967.498 129.358 1043.43 129.358C1119.37 129.358 1126.11 71.2523 1200 88.6575",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 98.6116C73.8923 81.233 80.6314 139.312 156.567 139.312C232.502 139.312 228.443 97.5769 304.378 97.5769C380.313 97.5769 376.254 139.312 452.189 139.312C528.124 139.312 524.065 97.5769 600 97.5769C675.935 97.5769 671.876 139.312 747.811 139.312C823.746 139.312 819.687 97.5769 895.622 97.5769C971.557 97.5769 967.498 139.312 1043.43 139.312C1119.37 139.312 1126.11 81.2064 1200 98.6116",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 108.566C73.8923 91.1871 80.6314 149.266 156.567 149.266C232.502 149.266 228.443 107.531 304.378 107.531C380.313 107.531 376.254 149.266 452.189 149.266C528.124 149.266 524.065 107.531 600 107.531C675.935 107.531 671.876 149.266 747.811 149.266C823.746 149.266 819.687 107.531 895.622 107.531C971.557 107.531 967.498 149.266 1043.43 149.266C1119.37 149.266 1126.11 91.1605 1200 108.566",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 118.52C73.8923 101.141 80.6314 159.22 156.567 159.22C232.502 159.22 228.443 117.485 304.378 117.485C380.313 117.485 376.254 159.22 452.189 159.22C528.124 159.22 524.065 117.485 600 117.485C675.935 117.485 671.876 159.22 747.811 159.22C823.746 159.22 819.687 117.485 895.622 117.485C971.557 117.485 967.498 159.22 1043.43 159.22C1119.37 159.22 1126.11 101.115 1200 118.52",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M0 128.474C73.8923 111.095 80.6314 169.174 156.567 169.174C232.502 169.174 228.443 127.439 304.378 127.439C380.313 127.439 376.254 169.174 452.189 169.174C528.124 169.174 524.065 127.439 600 127.439C675.935 127.439 671.876 169.174 747.811 169.174C823.746 169.174 819.687 127.439 895.622 127.439C971.557 127.439 967.498 169.174 1043.43 169.174C1119.37 169.174 1126.11 111.069 1200 128.474",stroke:"#97C3B9",strokeWidth:1.5})),g.createElement("defs",null,g.createElement("clipPath",{id:"clip0_251_38259"},g.createElement("rect",{width:255,height:189,fill:"white"})))),goi=e=>g.createElement("svg",{width:255,height:189,viewBox:"0 0 255 189",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{clipPath:"url(#clip0_251_38273)"},g.createElement("path",{d:"M255 9.02466C181.108 -8.35395 174.369 49.7252 98.4333 49.7252C22.498 49.7252 26.5575 7.99003 -49.3778 7.99003C-125.313 7.99003 -121.254 49.7252 -197.189 49.7252C-273.124 49.7252 -269.065 7.99003 -345 7.99003C-420.935 7.99003 -416.876 49.7252 -492.811 49.7252C-568.746 49.7252 -564.687 7.99003 -640.622 7.99003C-716.557 7.99003 -712.498 49.7252 -788.433 49.7252C-864.369 49.7252 -871.108 -8.38048 -945 9.02466",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 18.9788C181.108 1.60015 174.369 59.6793 98.4333 59.6793C22.498 59.6793 26.5575 17.9441 -49.3778 17.9441C-125.313 17.9441 -121.254 59.6793 -197.189 59.6793C-273.124 59.6793 -269.065 17.9441 -345 17.9441C-420.935 17.9441 -416.876 59.6793 -492.811 59.6793C-568.746 59.6793 -564.687 17.9441 -640.622 17.9441C-716.557 17.9441 -712.498 59.6793 -788.433 59.6793C-864.369 59.6793 -871.108 1.57362 -945 18.9788",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 28.9329C181.108 11.5543 174.369 69.6334 98.4333 69.6334C22.498 69.6334 26.5575 27.8982 -49.3778 27.8982C-125.313 27.8982 -121.254 69.6334 -197.189 69.6334C-273.124 69.6334 -269.065 27.8982 -345 27.8982C-420.935 27.8982 -416.876 69.6334 -492.811 69.6334C-568.746 69.6334 -564.687 27.8982 -640.622 27.8982C-716.557 27.8982 -712.498 69.6334 -788.433 69.6334C-864.369 69.6334 -871.108 11.5277 -945 28.9329",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 38.887C181.108 21.5084 174.369 79.5875 98.4333 79.5875C22.498 79.5875 26.5575 37.8523 -49.3778 37.8523C-125.313 37.8523 -121.254 79.5875 -197.189 79.5875C-273.124 79.5875 -269.065 37.8523 -345 37.8523C-420.935 37.8523 -416.876 79.5875 -492.811 79.5875C-568.746 79.5875 -564.687 37.8523 -640.622 37.8523C-716.557 37.8523 -712.498 79.5875 -788.433 79.5875C-864.369 79.5875 -871.108 21.4818 -945 38.887",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 48.8411C181.108 31.4625 174.369 89.5416 98.4333 89.5416C22.498 89.5416 26.5575 47.8064 -49.3778 47.8064C-125.313 47.8064 -121.254 89.5416 -197.189 89.5416C-273.124 89.5416 -269.065 47.8064 -345 47.8064C-420.935 47.8064 -416.876 89.5416 -492.811 89.5416C-568.746 89.5416 -564.687 47.8064 -640.622 47.8064C-716.557 47.8064 -712.498 89.5416 -788.433 89.5416C-864.369 89.5416 -871.108 31.4359 -945 48.8411",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 58.7952C181.108 41.4166 174.369 99.4957 98.4333 99.4957C22.498 99.4957 26.5575 57.7605 -49.3778 57.7605C-125.313 57.7605 -121.254 99.4957 -197.189 99.4957C-273.124 99.4957 -269.065 57.7605 -345 57.7605C-420.935 57.7605 -416.876 99.4957 -492.811 99.4957C-568.746 99.4957 -564.687 57.7605 -640.622 57.7605C-716.557 57.7605 -712.498 99.4957 -788.433 99.4957C-864.369 99.4957 -871.108 41.39 -945 58.7952",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 68.7493C181.108 51.3707 174.369 109.45 98.4333 109.45C22.498 109.45 26.5575 67.7146 -49.3778 67.7146C-125.313 67.7146 -121.254 109.45 -197.189 109.45C-273.124 109.45 -269.065 67.7146 -345 67.7146C-420.935 67.7146 -416.876 109.45 -492.811 109.45C-568.746 109.45 -564.687 67.7146 -640.622 67.7146C-716.557 67.7146 -712.498 109.45 -788.433 109.45C-864.369 109.45 -871.108 51.3441 -945 68.7493",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 78.7034C181.108 61.3248 174.369 119.404 98.4333 119.404C22.498 119.404 26.5575 77.6687 -49.3778 77.6687C-125.313 77.6687 -121.254 119.404 -197.189 119.404C-273.124 119.404 -269.065 77.6687 -345 77.6687C-420.935 77.6687 -416.876 119.404 -492.811 119.404C-568.746 119.404 -564.687 77.6687 -640.622 77.6687C-716.557 77.6687 -712.498 119.404 -788.433 119.404C-864.369 119.404 -871.108 61.2982 -945 78.7034",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 88.6575C181.108 71.2789 174.369 129.358 98.4333 129.358C22.498 129.358 26.5575 87.6228 -49.3778 87.6228C-125.313 87.6228 -121.254 129.358 -197.189 129.358C-273.124 129.358 -269.065 87.6228 -345 87.6228C-420.935 87.6228 -416.876 129.358 -492.811 129.358C-568.746 129.358 -564.687 87.6228 -640.622 87.6228C-716.557 87.6228 -712.498 129.358 -788.433 129.358C-864.369 129.358 -871.108 71.2523 -945 88.6575",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 98.6116C181.108 81.233 174.369 139.312 98.4333 139.312C22.498 139.312 26.5575 97.5769 -49.3778 97.5769C-125.313 97.5769 -121.254 139.312 -197.189 139.312C-273.124 139.312 -269.065 97.5769 -345 97.5769C-420.935 97.5769 -416.876 139.312 -492.811 139.312C-568.746 139.312 -564.687 97.5769 -640.622 97.5769C-716.557 97.5769 -712.498 139.312 -788.433 139.312C-864.369 139.312 -871.108 81.2064 -945 98.6116",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 108.566C181.108 91.1871 174.369 149.266 98.4333 149.266C22.498 149.266 26.5575 107.531 -49.3778 107.531C-125.313 107.531 -121.254 149.266 -197.189 149.266C-273.124 149.266 -269.065 107.531 -345 107.531C-420.935 107.531 -416.876 149.266 -492.811 149.266C-568.746 149.266 -564.687 107.531 -640.622 107.531C-716.557 107.531 -712.498 149.266 -788.433 149.266C-864.369 149.266 -871.108 91.1605 -945 108.566",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 118.52C181.108 101.141 174.369 159.22 98.4333 159.22C22.498 159.22 26.5575 117.485 -49.3778 117.485C-125.313 117.485 -121.254 159.22 -197.189 159.22C-273.124 159.22 -269.065 117.485 -345 117.485C-420.935 117.485 -416.876 159.22 -492.811 159.22C-568.746 159.22 -564.687 117.485 -640.622 117.485C-716.557 117.485 -712.498 159.22 -788.433 159.22C-864.369 159.22 -871.108 101.115 -945 118.52",stroke:"#97C3B9",strokeWidth:1.5}),g.createElement("path",{d:"M255 128.474C181.108 111.095 174.369 169.174 98.4333 169.174C22.498 169.174 26.5575 127.439 -49.3778 127.439C-125.313 127.439 -121.254 169.174 -197.189 169.174C-273.124 169.174 -269.065 127.439 -345 127.439C-420.935 127.439 -416.876 169.174 -492.811 169.174C-568.746 169.174 -564.687 127.439 -640.622 127.439C-716.557 127.439 -712.498 169.174 -788.433 169.174C-864.369 169.174 -871.108 111.069 -945 128.474",stroke:"#97C3B9",strokeWidth:1.5})),g.createElement("defs",null,g.createElement("clipPath",{id:"clip0_251_38273"},g.createElement("rect",{width:255,height:189,fill:"white",transform:"matrix(-1 0 0 1 255 0)"})))),{common:I3n,spendManagement:foi}=W.getLocalizedStrings();foi.treasury.promoPage;const _2={mainHeading:new vt("h6Medium","h4Regular"),subHeading:new vt("largeRegular","h6Regular"),fundSymbol:new vt("smallSemiBold","standardSemiBold"),fundName:new vt("h7SemiBold","h5SemiBold"),fundSubName:new vt("largeMedium","h6SemiBold"),highlightValue:new vt("standardRegular","extraLargeMedium"),highlightLabel:new vt("smallRegular","standardRegular"),uspItemTitle:new vt("h7Medium","h6Medium"),uspItemDescription:new vt("smallRegular","largeRegular")},Ic={uspLogoSize:new j(C[4],C[5]),cardsGap:new j(C[4],C[6]),fundHeaderGap:new j(C[0],C[2]),fundHeaderPadding:new j(C[3],C[4]),fundHeaderPaddingTop:new j(C[4],C[7]),fundHighlightsPadding:new j(C[2],C[3]),highlightItemGap:new j(C[0],C[1])};i.div`
87126
87125
  display: flex;
87127
87126
  flex: 1 1 auto;
87128
87127
  min-height: 100%;
@@ -87473,7 +87472,7 @@ to {
87473
87472
  pointer-events: none;
87474
87473
  width: ${e=>e.windowSize==="small"?"25%":"22%"};
87475
87474
  height: auto;
87476
- `;const Hq={navBarContainerPaddingYaxis:new j(10,C[3]),containerPaddingLeft:new j(C[3],C[6],C[8]),containerPaddingRight:new j(C[3],C[6],C[8])},xoi={stepTitle:new vt("h6Regular","h5Regular")},{common:M3n,spendManagement:{treasury:{transferDrawer:{review:{footNoteForVerification:B3n}}}},commonSetUp:{businessVerification:yoi}}=W.getLocalizedStrings();yoi.sourceOfFundOptions;i.div`
87475
+ `;const Hq={navBarContainerPaddingYaxis:new j(10,C[3]),containerPaddingLeft:new j(C[3],C[6],C[8]),containerPaddingRight:new j(C[3],C[6],C[8])},xoi={stepTitle:new vt("h6Regular","h5Regular")},{common:j3n,spendManagement:{treasury:{transferDrawer:{review:{footNoteForVerification:M3n}}}},commonSetUp:{businessVerification:yoi}}=W.getLocalizedStrings();yoi.sourceOfFundOptions;i.div`
87477
87476
  height: auto;
87478
87477
  padding-left: ${e=>`${Hq.containerPaddingLeft.valuePx(e.windowSize)}`};
87479
87478
  padding-right: ${e=>`${Hq.containerPaddingRight.valuePx(e.windowSize)}`};
@@ -87580,7 +87579,7 @@ to {
87580
87579
  transform: translateX(0%);
87581
87580
  }
87582
87581
  }
87583
- `;const{common:D3n,spendManagement:{treasury:P3n},dateFormat:T3n}=W.getLocalizedStrings(),XKe={portfolioYieldMarginTop:new j(-4,C[0]),sliderWidth:new j(143,177)};i.div`
87582
+ `;const{common:B3n,spendManagement:{treasury:D3n},dateFormat:P3n}=W.getLocalizedStrings(),XKe={portfolioYieldMarginTop:new j(-4,C[0]),sliderWidth:new j(143,177)};i.div`
87584
87583
  display: flex;
87585
87584
  flex-direction: row;
87586
87585
  gap: ${o.sp2};
@@ -87797,7 +87796,7 @@ to {
87797
87796
  flex-direction: row;
87798
87797
  align-items: center;
87799
87798
  gap: ${o.sp3};
87800
- `;const{common:z3n,spendManagement:{treasury:{portfolioAllocation:R3n}}}=W.getLocalizedStrings(),$2={titleWidth:new j(343,580,756,826),cardPadding:new j(C[3],C[4]),sliderWidth:new j(143,177),sliderContainerGap:new j(C[5],C[3]),containerPaddingLeft:new j(C[3],C[5],C[5]),containerPaddingRight:new j(C[3],C[5],C[5]),riskLevelInfoPaddingRight:new j(C[0],C[3])},woi={stepTitle:new vt("h6Medium","h7Medium")};i.div`
87799
+ `;const{common:T3n,spendManagement:{treasury:{portfolioAllocation:z3n}}}=W.getLocalizedStrings(),$2={titleWidth:new j(343,580,756,826),cardPadding:new j(C[3],C[4]),sliderWidth:new j(143,177),sliderContainerGap:new j(C[5],C[3]),containerPaddingLeft:new j(C[3],C[5],C[5]),containerPaddingRight:new j(C[3],C[5],C[5]),riskLevelInfoPaddingRight:new j(C[0],C[3])},woi={stepTitle:new vt("h6Medium","h7Medium")};i.div`
87801
87800
  display: flex;
87802
87801
  flex-direction: column;
87803
87802
  height: 100%;
@@ -88116,7 +88115,7 @@ to {
88116
88115
  justify-content: center;
88117
88116
  align-items: center;
88118
88117
  padding: 2px ${o.sp2};
88119
- `;const tj={containerPaddingLeft:new j(C[3],C[5],C[5]),containerPaddingRight:new j(C[3],C[5],C[5]),reviewContentWrapperPaddingBottom:new j(C[5],C[8]),elementsContainerPadding:new j(C[3],C[4])},voi={pageTitle:new vt("h6Medium","h7Medium")},{common:{edit:F3n,back:O3n,texts:{byClickingTransferIAuthorizeZeniToInitiate:N3n,from2:H3n,transfer:_3n,transferredFundsTypicallyTake12BusinessDays:V3n}},dateFormat:{visual:{DMMMYYYYFormat:U3n}},spendManagement:{treasury:{transferDrawer:Q3n},billPay:{insufficientFunds:{lowBalance:W3n,addOrSwitchInitiateTransfer:G3n,lowBalanceIn:Y3n}}}}=W.getLocalizedStrings();i.div`
88118
+ `;const tj={containerPaddingLeft:new j(C[3],C[5],C[5]),containerPaddingRight:new j(C[3],C[5],C[5]),reviewContentWrapperPaddingBottom:new j(C[5],C[8]),elementsContainerPadding:new j(C[3],C[4])},voi={pageTitle:new vt("h6Medium","h7Medium")},{common:{edit:R3n,back:F3n,texts:{byClickingTransferIAuthorizeZeniToInitiate:O3n,from2:N3n,transfer:H3n,transferredFundsTypicallyTake12BusinessDays:_3n}},dateFormat:{visual:{DMMMYYYYFormat:V3n}},spendManagement:{treasury:{transferDrawer:U3n},billPay:{insufficientFunds:{lowBalance:Q3n,addOrSwitchInitiateTransfer:W3n,lowBalanceIn:G3n}}}}=W.getLocalizedStrings();i.div`
88120
88119
  display: flex;
88121
88120
  flex-direction: row;
88122
88121
  align-items: flex-start;
@@ -88375,7 +88374,7 @@ to {
88375
88374
  position: absolute;
88376
88375
  right: 50%;
88377
88376
  bottom: -25px;
88378
- `;const{common:Coi,spendManagement:{treasury:K3n,billPay:{insufficientFunds:q3n}}}=W.getLocalizedStrings(),{texts:{zeroDollarPlaceholder:Z3n}}=Coi,Aoi={portfolioContainerPadding:new j(C[3],C[4])},eqe={yieldEarned:new vt("extraSmallSemiBold","extraSmallSemiBold"),calculatorFooterText:new vt("extraSmallSemiBold","extraSmallSemiBold")};i.div`
88377
+ `;const{common:Coi,spendManagement:{treasury:Y3n,billPay:{insufficientFunds:K3n}}}=W.getLocalizedStrings(),{texts:{zeroDollarPlaceholder:q3n}}=Coi,Aoi={portfolioContainerPadding:new j(C[3],C[4])},eqe={yieldEarned:new vt("extraSmallSemiBold","extraSmallSemiBold"),calculatorFooterText:new vt("extraSmallSemiBold","extraSmallSemiBold")};i.div`
88379
88378
  margin-top: ${o.sp3};
88380
88379
  display: flex;
88381
88380
  background-color: ${e=>e.theme.colors.grey5};
@@ -88566,7 +88565,7 @@ to {
88566
88565
  min-width: ${o.sp3};
88567
88566
  min-height: ${o.sp3};
88568
88567
  color: ${e=>e.theme.colors.hero};
88569
- `;const oj={containerPaddingLeft:new j(C[3],C[5],C[5]),containerPaddingRight:new j(C[3],C[5],C[5]),successContentMargin:new j(C[3],C[12]),buttonTrayGap:new j(C[4],C[5])},koi={formTitle:new vt("h7Medium","h7Medium")},{common:Soi,spendManagement:{treasury:J3n}}=W.getLocalizedStrings(),{texts:{review:X3n}}=Soi;i(nt)`
88568
+ `;const oj={containerPaddingLeft:new j(C[3],C[5],C[5]),containerPaddingRight:new j(C[3],C[5],C[5]),successContentMargin:new j(C[3],C[12]),buttonTrayGap:new j(C[4],C[5])},koi={formTitle:new vt("h7Medium","h7Medium")},{common:Soi,spendManagement:{treasury:Z3n}}=W.getLocalizedStrings(),{texts:{review:J3n}}=Soi;i(nt)`
88570
88569
  color: ${e=>e.theme.colors.champion};
88571
88570
  `;i(nt)`
88572
88571
  color: ${e=>e.theme.colors.champion};
@@ -88686,7 +88685,7 @@ to {
88686
88685
  flex-direction: column;
88687
88686
  width: 100%;
88688
88687
  padding-top: ${o.sp3};
88689
- `;const tqe={setupDetailsRowGap:new j(12,C[5],C[5]),sectionRowGap:new j(C[5],C[5],C[5])},{commonSetUp:Eoi,spendManagement:Loi,common:{settings:{productNameByType:{zeni_treasury:efn}},texts:{businessVerification:tfn,linkedAccount:ofn,portfolioAllocation:rfn}}}=W.getLocalizedStrings(),{treasury:ifn}=Loi,{setUp:nfn}=Eoi;i.div`
88688
+ `;const tqe={setupDetailsRowGap:new j(12,C[5],C[5]),sectionRowGap:new j(C[5],C[5],C[5])},{commonSetUp:Eoi,spendManagement:Loi,common:{settings:{productNameByType:{zeni_treasury:X3n}},texts:{businessVerification:efn,linkedAccount:tfn,portfolioAllocation:ofn}}}=W.getLocalizedStrings(),{treasury:rfn}=Loi,{setUp:ifn}=Eoi;i.div`
88690
88689
  display: flex;
88691
88690
  justify-content: flex-start;
88692
88691
  height: 100%;
@@ -89019,7 +89018,7 @@ to {
89019
89018
  border-radius: inherit;
89020
89019
  `,Bri=i.div`
89021
89020
  border-radius: inherit;
89022
- `,{spendManagement:{treasury:{overviewPage:lCe},autoTransferRules:{pageTitle:afn}},common:{texts:{comments:sfn,statements:Dri,settings:Pri}}}=W.getLocalizedStrings();lCe.editPortfolio,lCe.taxLetter;i.div`
89021
+ `,{spendManagement:{treasury:{overviewPage:lCe},autoTransferRules:{pageTitle:nfn}},common:{texts:{comments:afn,statements:Dri,settings:Pri}}}=W.getLocalizedStrings();lCe.editPortfolio,lCe.taxLetter;i.div`
89023
89022
  display: flex;
89024
89023
  flex-direction: row;
89025
89024
  align-items: ${({isTopAlign:e})=>e?"flex-start":"center"};
@@ -89109,7 +89108,7 @@ to {
89109
89108
  gap: ${o.sp3};
89110
89109
  justify-content: ${e=>e.alignEnd===!0?"flex-end":"flex-start"};
89111
89110
  overflow: hidden;
89112
- `;const{common:Tri,spendManagement:zri,dateFormat:KQ,collaboration:{threads:{placeholder:{addANewComment:lfn,replyAComment:cfn},tooltip:{resolveComment:dfn,unResolveComment:pfn}}}}=W.getLocalizedStrings(),{settings:{productNameByType:{zeni_treasury:ufn}},strings:{empty:hfn},texts:{asOf:mfn,comments:gfn,hide:ffn,insuredFunds:xfn,readyToUseBalance:yfn,viewDetails:bfn}}=Tri,{zeniAccounts:wfn,treasury:{overviewPage:Rri}}=zri,Roe={tickLabelText:new vt("extraSmallSemiBold","extraSmallSemiBold"),fundSummaryStyles:new vt("smallSemiBold","smallSemiBold"),yieldValueStyles:new vt("h5Medium","h7Medium")},pd={accountDetailHeaderPaddingRight:new j(C[3],C[5]),accountDetailHeaderPaddingBottom:new j(C[2],C[3]),accountDetailHeaderPaddingLeft:new j(C[3],C[5]),accountDetailHeaderPaddingTop:new j(C[3],C[3]),areaChartHeight:new j(114,182),accountDetailHeaderGap:new j(8,16,16),accountBriefWidth:new j(100,31,31),accountGraphWidth:new j(100,69,69)},Fri=g.memo(({accountHistory:e})=>{const t=Me(),r=lt(),[n,a]=g.useState(),l=g.useMemo(()=>{const x=xr(new Date().toISOString()),y=x.clone().subtract(84,"day"),b=84/6;return Array.from({length:7}).map((w,v)=>{const A=v/6;let S;return A<.5?S=0:A<.6?S=.9*((A-.5)/.09999999999999998):S=.9,{date:(v===6?x:y.clone().add(Math.round(v*b),"day")).toISOString(),value:S}})},[]),c=g.useMemo(()=>(l.length<=0,0),[l.length]),d=e.fetchState==="Completed"&&(e.accountHistoryWithBalance.length===0||e.accountHistoryWithBalance.every(x=>x.balance?.available.amount===0)),p=g.useMemo(()=>e.accountHistoryWithBalance.map(x=>({...x,date:x.date.toISOString()})),[e.accountHistoryWithBalance]),u=g.useCallback(x=>{const y=Array.isArray(x)?x:[];let b="",w="";if(Array.isArray(y)&&y.length>0){const v=y[0].payload?.balance?.available;w=Bt("0,0[.]00",v),b=xr(y[0].payload?.date??"").format(KQ.visual.DMMMYYYYFormat)}return s.jsxs(Qri,{children:[s.jsx(uCe,{children:b}),s.jsx(uCe,{isSublabel:!0,children:w})]})},[]),h=g.useCallback(x=>{const y=x,{x:b,y:w}=y,{value:v}=y.payload;let A=!1;e.accountHistoryWithBalance.length>360&&(A=!0);const S=A?xr(v).format(KQ.visual.MMMformat):xr(v).format(KQ.visual.MMMDFormat);return s.jsx(_ri,{translateX:b,translateY:w,children:s.jsx(Vri,{windowSize:t,dy:20,dx:-25,children:S})})},[e.accountHistoryWithBalance.length,t]),m=g.useCallback(({cx:x,cy:y,dataKey:b})=>(b==="balance.available.amount"&&(n?.x!==x||n?.y!==y)&&a({x,y}),s.jsx(Wri,{cx:x,cy:y,strokeWidth:1,r:C[1]})),[n]),f=g.useMemo(()=>{const x=e.accountHistoryWithBalance.length;return x<=0?0:x>360?Math.floor(x/12):Math.floor(x/7)},[e.accountHistoryWithBalance.length]);return s.jsx(Uri,{children:d?s.jsxs(Yri,{children:[s.jsx(WW,{height:pd.areaChartHeight.value(t),width:"99%",children:s.jsxs($E,{data:l,margin:{top:0,right:0,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs(cCe,{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx(dCe,{offset:"0%",stopColor:r.colors.grey2,stopOpacity:1}),s.jsx(pCe,{offset:"100%",stopColor:r.colors.grey2,stopOpacity:.02})]})}),s.jsx(gd,{dataKey:"date",stroke:r.colors.grey2,tickSize:0,tick:x=>h(x),interval:c,padding:{right:C[4]}}),s.jsx(fd,{tick:!1,axisLine:!1,domain:[0,1]}),s.jsx(kE,{activeDot:void 0,fillOpacity:1,dot:!1,type:"monotone",dataKey:"value",stroke:r.colors.grey2,strokeDasharray:"4 4",fill:"url(#colorUv)"})]})}),s.jsx(Kri,{children:s.jsx(Gri,{children:Rri.noData})})]}):s.jsx(WW,{height:pd.areaChartHeight.value(t),width:"99%",children:s.jsxs($E,{data:p,margin:{top:0,right:0,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs(cCe,{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx(dCe,{offset:"0%",stopColor:k.brandColorJade,stopOpacity:1}),s.jsx(pCe,{offset:"100%",stopColor:k.brandColorJade,stopOpacity:.03})]})}),s.jsx(gd,{dataKey:"date",stroke:r.colors.grey3,tickSize:0,reversed:!0,tick:x=>h(x),padding:{right:C[4]},interval:f}),s.jsx(fd,{tick:!1,axisLine:!1}),s.jsx(k2,{position:n,content:({payload:x})=>u(x),cursor:{strokeDasharray:"3",stroke:k.brandColorJade}}),s.jsx(kE,{activeDot:m,fillOpacity:1,dot:!1,type:"monotone",dataKey:"balance.available.amount",stroke:k.brandColorJade,fill:"url(#colorUv)"})]})})})});Fri.displayName="AccountBalanceGraph";const Ori=g.memo(({treasuryDetail:e,onColumnSortConfigChanged:t})=>{const r=Me();return s.jsx(s.Fragment,{children:e.transactions.length>0?s.jsx(Hri,{windowSize:r,children:s.jsx(wri,{transactionList:e.transactions,fetchState:e.fetchState,uiState:e.uiState,onReloadCards:()=>{},onColumnSortConfigChanged:t})}):s.jsx(Nri,{})})});Ori.displayName="TransactionListScreen";const Nri=i.div`
89111
+ `;const{common:Tri,spendManagement:zri,dateFormat:KQ,collaboration:{threads:{placeholder:{addANewComment:sfn,replyAComment:lfn},tooltip:{resolveComment:cfn,unResolveComment:dfn}}}}=W.getLocalizedStrings(),{settings:{productNameByType:{zeni_treasury:pfn}},strings:{empty:ufn},texts:{asOf:hfn,comments:mfn,hide:gfn,insuredFunds:ffn,readyToUseBalance:xfn,viewDetails:yfn}}=Tri,{zeniAccounts:bfn,treasury:{overviewPage:Rri}}=zri,Roe={tickLabelText:new vt("extraSmallSemiBold","extraSmallSemiBold"),fundSummaryStyles:new vt("smallSemiBold","smallSemiBold"),yieldValueStyles:new vt("h5Medium","h7Medium")},pd={accountDetailHeaderPaddingRight:new j(C[3],C[5]),accountDetailHeaderPaddingBottom:new j(C[2],C[3]),accountDetailHeaderPaddingLeft:new j(C[3],C[5]),accountDetailHeaderPaddingTop:new j(C[3],C[3]),areaChartHeight:new j(114,182),accountDetailHeaderGap:new j(8,16,16),accountBriefWidth:new j(100,31,31),accountGraphWidth:new j(100,69,69)},Fri=g.memo(({accountHistory:e})=>{const t=Me(),r=lt(),[n,a]=g.useState(),l=g.useMemo(()=>{const x=xr(new Date().toISOString()),y=x.clone().subtract(84,"day"),b=84/6;return Array.from({length:7}).map((w,v)=>{const A=v/6;let S;return A<.5?S=0:A<.6?S=.9*((A-.5)/.09999999999999998):S=.9,{date:(v===6?x:y.clone().add(Math.round(v*b),"day")).toISOString(),value:S}})},[]),c=g.useMemo(()=>(l.length<=0,0),[l.length]),d=e.fetchState==="Completed"&&(e.accountHistoryWithBalance.length===0||e.accountHistoryWithBalance.every(x=>x.balance?.available.amount===0)),p=g.useMemo(()=>e.accountHistoryWithBalance.map(x=>({...x,date:x.date.toISOString()})),[e.accountHistoryWithBalance]),u=g.useCallback(x=>{const y=Array.isArray(x)?x:[];let b="",w="";if(Array.isArray(y)&&y.length>0){const v=y[0].payload?.balance?.available;w=Bt("0,0[.]00",v),b=xr(y[0].payload?.date??"").format(KQ.visual.DMMMYYYYFormat)}return s.jsxs(Qri,{children:[s.jsx(uCe,{children:b}),s.jsx(uCe,{isSublabel:!0,children:w})]})},[]),h=g.useCallback(x=>{const y=x,{x:b,y:w}=y,{value:v}=y.payload;let A=!1;e.accountHistoryWithBalance.length>360&&(A=!0);const S=A?xr(v).format(KQ.visual.MMMformat):xr(v).format(KQ.visual.MMMDFormat);return s.jsx(_ri,{translateX:b,translateY:w,children:s.jsx(Vri,{windowSize:t,dy:20,dx:-25,children:S})})},[e.accountHistoryWithBalance.length,t]),m=g.useCallback(({cx:x,cy:y,dataKey:b})=>(b==="balance.available.amount"&&(n?.x!==x||n?.y!==y)&&a({x,y}),s.jsx(Wri,{cx:x,cy:y,strokeWidth:1,r:C[1]})),[n]),f=g.useMemo(()=>{const x=e.accountHistoryWithBalance.length;return x<=0?0:x>360?Math.floor(x/12):Math.floor(x/7)},[e.accountHistoryWithBalance.length]);return s.jsx(Uri,{children:d?s.jsxs(Yri,{children:[s.jsx(WW,{height:pd.areaChartHeight.value(t),width:"99%",children:s.jsxs($E,{data:l,margin:{top:0,right:0,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs(cCe,{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx(dCe,{offset:"0%",stopColor:r.colors.grey2,stopOpacity:1}),s.jsx(pCe,{offset:"100%",stopColor:r.colors.grey2,stopOpacity:.02})]})}),s.jsx(gd,{dataKey:"date",stroke:r.colors.grey2,tickSize:0,tick:x=>h(x),interval:c,padding:{right:C[4]}}),s.jsx(fd,{tick:!1,axisLine:!1,domain:[0,1]}),s.jsx(kE,{activeDot:void 0,fillOpacity:1,dot:!1,type:"monotone",dataKey:"value",stroke:r.colors.grey2,strokeDasharray:"4 4",fill:"url(#colorUv)"})]})}),s.jsx(Kri,{children:s.jsx(Gri,{children:Rri.noData})})]}):s.jsx(WW,{height:pd.areaChartHeight.value(t),width:"99%",children:s.jsxs($E,{data:p,margin:{top:0,right:0,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs(cCe,{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx(dCe,{offset:"0%",stopColor:k.brandColorJade,stopOpacity:1}),s.jsx(pCe,{offset:"100%",stopColor:k.brandColorJade,stopOpacity:.03})]})}),s.jsx(gd,{dataKey:"date",stroke:r.colors.grey3,tickSize:0,reversed:!0,tick:x=>h(x),padding:{right:C[4]},interval:f}),s.jsx(fd,{tick:!1,axisLine:!1}),s.jsx(k2,{position:n,content:({payload:x})=>u(x),cursor:{strokeDasharray:"3",stroke:k.brandColorJade}}),s.jsx(kE,{activeDot:m,fillOpacity:1,dot:!1,type:"monotone",dataKey:"balance.available.amount",stroke:k.brandColorJade,fill:"url(#colorUv)"})]})})})});Fri.displayName="AccountBalanceGraph";const Ori=g.memo(({treasuryDetail:e,onColumnSortConfigChanged:t})=>{const r=Me();return s.jsx(s.Fragment,{children:e.transactions.length>0?s.jsx(Hri,{windowSize:r,children:s.jsx(wri,{transactionList:e.transactions,fetchState:e.fetchState,uiState:e.uiState,onReloadCards:()=>{},onColumnSortConfigChanged:t})}):s.jsx(Nri,{})})});Ori.displayName="TransactionListScreen";const Nri=i.div`
89113
89112
  display: flex;
89114
89113
  flex-direction: column;
89115
89114
  align-items: center;
@@ -89636,7 +89635,7 @@ to {
89636
89635
  min-height: 1px;
89637
89636
  max-height: 1px;
89638
89637
  margin-top: ${o.sp4};
89639
- `;const{spendManagement:{treasury:{statements:{title:vfn}}},common:{texts:{noStatementsFound:Cfn}}}=W.getLocalizedStrings(),qri={listItemMargin:new j(C[3],C[8])};i.div``;i.div`
89638
+ `;const{spendManagement:{treasury:{statements:{title:wfn}}},common:{texts:{noStatementsFound:vfn}}}=W.getLocalizedStrings(),qri={listItemMargin:new j(C[3],C[8])};i.div``;i.div`
89640
89639
  margin: ${e=>`${o.sp0} ${qri.listItemMargin.valuePx(e.windowSize)}`};
89641
89640
  &:hover {
89642
89641
  position: relative;
@@ -89746,7 +89745,7 @@ to {
89746
89745
  border-radius: 2px;
89747
89746
  }
89748
89747
  }
89749
- `;const{spendManagement:{autoTransferRules:Afn},common:{texts:{addRule:$fn}}}=W.getLocalizedStrings(),Jri=4,L4={sectionWidth:new j(343,580,756),width:new j(343,580,756),sectionRowGap:new j(C[3],C[3],C[3]),sectionTitlePaddingTop:new j(C[5],C[5],C[5]),sectionTitlePaddingBottom:new j(C[3],C[3],C[3]),navIconLeftMargin:new j(12,C[4])},Xri={title:new vt("standardSemiBold","largeSemiBold")};i(ht)`
89748
+ `;const{spendManagement:{autoTransferRules:Cfn},common:{texts:{addRule:Afn}}}=W.getLocalizedStrings(),Jri=4,L4={sectionWidth:new j(343,580,756),width:new j(343,580,756),sectionRowGap:new j(C[3],C[3],C[3]),sectionTitlePaddingTop:new j(C[5],C[5],C[5]),sectionTitlePaddingBottom:new j(C[3],C[3],C[3]),navIconLeftMargin:new j(12,C[4])},Xri={title:new vt("standardSemiBold","largeSemiBold")};i(ht)`
89750
89749
  color: ${e=>e.theme.colors.champion};
89751
89750
  padding-top: ${e=>L4.sectionTitlePaddingTop.valuePx(e.windowSize)};
89752
89751
  padding-bottom: ${e=>L4.sectionTitlePaddingBottom.valuePx(e.windowSize)};
@@ -89838,7 +89837,7 @@ to {
89838
89837
  color: ${e=>e.theme.colors.primary};
89839
89838
  fill: ${e=>e.theme.colors.primary};
89840
89839
  }
89841
- `;const{spendManagement:{autoTransferRules:kfn}}=W.getLocalizedStrings(),eii=W.getLocalizedStrings(),{common:Sfn,spendManagement:{autoTransferRules:{createRuleDrawer:Efn,ruleTypes:Lfn},billPay:{insufficientFunds:{addMoney:Ifn}}}}=eii;i.div`
89840
+ `;const{spendManagement:{autoTransferRules:$fn}}=W.getLocalizedStrings(),eii=W.getLocalizedStrings(),{common:kfn,spendManagement:{autoTransferRules:{createRuleDrawer:Sfn,ruleTypes:Efn},billPay:{insufficientFunds:{addMoney:Lfn}}}}=eii;i.div`
89842
89841
  display: flex;
89843
89842
  align-items: flex-start;
89844
89843
  box-sizing: border-box;
@@ -90044,7 +90043,7 @@ to {
90044
90043
  min-width: 0;
90045
90044
  text-align: right;
90046
90045
  box-sizing: border-box;
90047
- `;const tii=W.getLocalizedStrings(),{common:jfn}=tii,Cs={sectionWidth:new j(343,580,756),sectionRowGap:new j(C[3],C[3],C[3]),iconWidthHeightPx:o.sp5,iconContainerSize:new j(C[6],C[6],C[6]),containerPadding:new j(C[3],C[4]),contentLeftInset:new j(30,34,40),cardGap:new j(C[2],C[3]),cardBorderRadiusPx:8,footerPaddingVertical:o.sp2,footerPaddingHorizontal:o.sp4},oii={title:new vt("standardSemiBold","largeSemiBold")};i.div`
90046
+ `;const tii=W.getLocalizedStrings(),{common:Ifn}=tii,Cs={sectionWidth:new j(343,580,756),sectionRowGap:new j(C[3],C[3],C[3]),iconWidthHeightPx:o.sp5,iconContainerSize:new j(C[6],C[6],C[6]),containerPadding:new j(C[3],C[4]),contentLeftInset:new j(30,34,40),cardGap:new j(C[2],C[3]),cardBorderRadiusPx:8,footerPaddingVertical:o.sp2,footerPaddingHorizontal:o.sp4},oii={title:new vt("standardSemiBold","largeSemiBold")};i.div`
90048
90047
  display: flex;
90049
90048
  flex-direction: column;
90050
90049
  row-gap: ${e=>Cs.sectionRowGap.valuePx(e.windowSize)};
@@ -90239,7 +90238,7 @@ to {
90239
90238
  color: ${e=>e.theme.colors.brandColorGoldDark};
90240
90239
  `;i(St)`
90241
90240
  color: ${e=>e.theme.colors.brandColorGoldDark};
90242
- `;const rii=W.getLocalizedStrings(),{common:Mfn}=rii;i.div`
90241
+ `;const rii=W.getLocalizedStrings(),{common:jfn}=rii;i.div`
90243
90242
  display: flex;
90244
90243
  flex-direction: column;
90245
90244
  height: 100%;
@@ -90481,7 +90480,7 @@ to {
90481
90480
  color: ${e=>e.theme.colors.brandColorGoldDark};
90482
90481
  `;i(nt)`
90483
90482
  color: ${e=>e.theme.colors.brandColorGoldDark};
90484
- `;const{spendManagement:{autoTransferRules:{pageTitle:Bfn}},common:{texts:{activity:Dfn}}}=W.getLocalizedStrings();i.div`
90483
+ `;const{spendManagement:{autoTransferRules:{pageTitle:Mfn}},common:{texts:{activity:Bfn}}}=W.getLocalizedStrings();i.div`
90485
90484
  display: flex;
90486
90485
  min-height: 100%;
90487
90486
  flex-direction: column;
@@ -90592,7 +90591,7 @@ to {
90592
90591
  padding: ${o.sp2} ${o.sp3} ${o.sp3};
90593
90592
  `;i.div`
90594
90593
  width: ${e=>e.width};
90595
- `;const{activity:Pfn}=W.getLocalizedStrings().common.texts,rqe=W.getLocalizedStrings(),{transactionActivityLog:nii}=rqe.expenseAutomation.transactions,{dateFormat:Tfn,common:{strings:{hash:zfn},texts:{category:Rfn,class:Ffn,customer:Ofn,description2:Nfn,details:Hfn,memo:_fn,vendor:Vfn}}}=rqe;nii.linePrefix;i.div`
90594
+ `;const{activity:Dfn}=W.getLocalizedStrings().common.texts,rqe=W.getLocalizedStrings(),{transactionActivityLog:nii}=rqe.expenseAutomation.transactions,{dateFormat:Pfn,common:{strings:{hash:Tfn},texts:{category:zfn,class:Rfn,customer:Ffn,description2:Ofn,details:Nfn,memo:Hfn,vendor:_fn}}}=rqe;nii.linePrefix;i.div`
90596
90595
  width: 100%;
90597
90596
  height: 100%;
90598
90597
  display: flex;
@@ -90982,7 +90981,7 @@ to {
90982
90981
  justify-content: center;
90983
90982
  align-items: center;
90984
90983
  background-color: inherit;
90985
- `;function Rii(e){if(e.tabsFileType!=null)return{locale_id:W.getAppLocaleID(),tabs_file_type:e.tabsFileType,tabs:e.tabs,filter_by_tabs:e.filterByTabs,time_zone:e.timezone}}const{cockpit:Fii,download:xCe,common:{texts:{unsupportedFiletype:Oii,cockpit:yCe}}}=W.getLocalizedStrings();function Nii(e){const{tabs:t,filterByTabs:r,tabsFileType:n,timezone:a}=e.defaultOptions;return{tabsFileType:n,tabs:t,filterByTabs:r,timezone:a}}function Hii(e){const t=Nii(e);return _ii(e.downloadParams.cockpitEndPoint,e.downloadParams.authParams,t)}async function _ii(e,t,r){const n=`${e}?query=${encodeURIComponent(JSON.stringify(Rii(r)))}`;try{if(r.tabsFileType==null)throw new Error(Oii);const a=await Ujo({urlEndPoint:n,authParams:t,fileType:r.tabsFileType});if(a.ok){const l=aHe(a.headers,Fii.defaultFileName),c=await a.arrayBuffer();tM(c,l)}else console.error(`${xCe.errorMessages.fileDownloadError.replace("__feature__",yCe)} ${a.statusText}`)}catch(a){console.error(`${xCe.errorMessages.fileDownloadError.replace("__feature__",yCe)} ${JSON.stringify(a)}`)}}const xn=88,O5=58,N5=1,H5=55,Vii=10,Uii=5,n0=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant"],Ufn=[...n0,"creditAgent"],iqe=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"customerSuccessManagerUserIds",multiple:!0,type:"user"},{value:"preparerUserIds",multiple:!0,type:"user"},{value:"reviewerUserIds",multiple:!0,type:"user"},{value:"apAnalystUserIds",multiple:!0,type:"user"},{value:"taxLeadUserIds",multiple:!0,type:"user"},{value:"plans",multiple:!0},{value:"productVerticals",multiple:!0},{value:"companyGroupId"},{value:"taxStatusCode"},{value:"statusCode"},{value:"annualRecurringRevenue"},{value:"monthlyRecurringRevenue"},{value:"customerSatisfaction",type:"rating"},{value:"zeniSatisfaction",type:"rating"}],nqe=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"statusCode"},{value:"recommendedActionCode"},{value:"monthlyRecurringRevenue"},{value:"subscriptionPlans",multiple:!0},{value:"subscriptionAddOns",multiple:!0},{value:"avg2MonthExpenses"},{value:"slabLowerLimit"},{value:"slabUpperLimit"}],aqe=[{value:"netBurnOrIncome"},{value:"cashPosition"},{value:"expenses"},{value:"income"},{value:"runway",type:"runway"}],sqe=[{value:"controller",multiple:!0,type:"user"},{value:"customerSuccessManager",multiple:!0,type:"user"},{value:"churnProbabilityPercentage",type:"dropdownRange"},{value:"runway",type:"runway"},{value:"netPromoterScore",type:"dropdownRange"},{value:"customerSatisfactionScore",type:"dropdownRange"},{value:"lastReportSent",type:"dateRange"},{value:"subscriptionRenewalDate",type:"dateRange"},{value:"subscriptionStartDate",type:"dateRange"},{value:"verticalProductServices"},{value:"monthlyRecurringRevenue"},{value:"companyGroupId"},{value:"externalProductServiceExposure"},{value:"companyEngagementMetricsUpdatedAt",type:"dateRange"}],Qii=[{label:"< 200K",value:"0<->200000"},{label:"75K to 100K",value:"75000<->100000"},{label:"25K to 75K",value:"25000<->75000"},{label:"< 25K",value:"0<->25000"}],Foe=[{label:"< 10K",value:"0<->10000"},{label:"5K to 8K",value:"5000<->8000"},{label:"2K to 5K",value:"2000<->5000"},{label:"< 2K",value:"0<->2000"}],Wii=[{label:"< 60K",value:"0<->60000"},{label:"60K to 200K",value:"60000<->200000"},{label:"200K to 500K",value:"200000<->500000"},{label:"500K to 800K",value:"500000<->800000"},{label:"800K to 1M",value:"800000<->1000000"},{label:"> 1M",value:"1000000-10000000000"}],Gii=[{label:"< 100K",value:"0<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Yii=[{label:"< -500K",value:"-10000000000<->-500000"},{label:"-500K to -100K",value:"-500000<->-100000"},{label:"-100K to 0",value:"-100000<->0"},{label:"0 to 100K",value:"0<->100000"},{label:"> 100K",value:"100000<->10000000000"}],Kii=[{label:"< 10K",value:"-10000000000<->10000"},{label:"10K to 100K",value:"10000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 2M",value:"500000<->2000000"},{label:"2M to 5M",value:"2000000<->5000000"},{label:"5M to 25M",value:"5000000<->25000000"},{label:"> 25M",value:"25000000<->10000000000"}],qii=[{label:"< 10K",value:"0<->10000"},{label:"10K to 50K",value:"10000<->50000"},{label:"50K to 100K",value:"50000<->100000"},{label:"100K to 300K",value:"100000<->300000"},{label:"300K to 500K",value:"300000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Zii=[{label:"< 5K",value:"-10000000000<->5000"},{label:"5K to 25K",value:"5000<->25000"},{label:"25K to 100K",value:"25000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"> 500K",value:"500000<->10000000000"}],Jii=[{label:"<= 3 months",value:"0<->3",iconColor:k.runwayRed},{label:"<= 1 year",value:"4<->12",iconColor:k.runwayYellow},{label:"> 1 year",value:"13<->1000000",iconColor:k.runwayGreen}],Xii=[{label:"ZBP",value:"billpay"},{label:"ZA",value:"accounts"},{label:"ZR",value:"reimbursement"},{label:"ZC",value:"cards"},{label:"Tax",value:"zeni_tax_plan"},{label:"Payroll",value:"payroll_manager_service_plan"},{label:"CFO",value:"cfo_plan"}],eni=[{label:"0",value:"0"},{label:"10",value:"10"},{label:"20",value:"20"},{label:"30",value:"30"},{label:"40",value:"40"},{label:"50",value:"50"},{label:"60",value:"60"},{label:"70",value:"70"},{label:"80",value:"80"},{label:"90",value:"90"},{label:"100",value:"100"}],tni=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"}],oni=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"}],rni=[{label:"<= 1 month",value:"0<->1"},{label:"1 to 3 months",value:"1<->3"},{label:"3 to 6 months",value:"3<->6"},{label:"6 to 12 months",value:"6<->12"},{label:"1 to 5 years",value:"12<->60"},{label:"5 to 10 years",value:"60<->120"},{label:"> 10 year",value:"121<->1000000"}],lqe=[1,2,3,4,5,6,7,8,9,10],cqe=[1,2,3,4,5],{cockpit:{titles:ini},common:{settings:{integrations:{connectorTooltips:{accountantSectionLabel:nni}},productNameByType:{charge_cards:ani}}}}=W.getLocalizedStrings(),sni=e=>{switch(e){case"management":case"subscription":case"portfolio":case"onboarding":case"audit":return e;case"aiAccountant":return nni;case"creditAgent":return ani;default:return ini.healthMonitor}},lni=e=>{switch(e){case"management":return"Cockpit - Management";case"subscription":return"Cockpit - Subscription";case"portfolio":return"Cockpit - Portfolio";case"onboarding":return"Cockpit - Onboarding";case"audit":return"Cockpit - Audit";case"aiAccountant":return"Cockpit - AI Accountant";case"creditAgent":return"Cockpit - Credit Agent";default:return"Cockpit - Health Monitor"}},cni=[{value:"enrollmentStatus",multiple:!0}],dqe=[{value:"company_id",multiple:!0},{value:"status",multiple:!0},{value:"priority",multiple:!0},{value:"assignees",multiple:!0,type:"user"},{value:"tag",multiple:!0},{value:"dueDate",type:"dateRange"},{value:"creationDate",type:"dateRange"}],dni=({downloadCockpitOptions:e})=>s.jsx(Vjo,{downloadMenuItems:e.downloadMenu.simpleMenuItems,onDownloadClick:e.downloadMenu.onDownloadClick});function pni(e){const[t,r]=g.useState(!1),{analytics:n,updateDownloadStateHandler:a,downloadState:l,currentCockpitTab:c}=e;return g.useEffect(()=>{async function d(){await Hii({...e}),a("Completed"),n.trackDownload(lni(c),"months","excel",!1)}t&&e.downloadState!=="In-Progress"&&(r(!1),a("In-Progress"),d())},[l,t,a,n,e,c]),s.jsx(uni,{"data-testid":te("cockpit-download-button"),children:s.jsx(dni,{downloadCockpitOptions:{type:"simple_menu",downloadMenu:{simpleMenuItems:[{type:"excel",isDownloading:e.downloadState==="In-Progress"}],onDownloadClick:async d=>{if(d==="excel"){if(e.downloadState==="In-Progress")return;r(!0)}}}}})})}const uni=i.div``,{common:{texts:{cockpit:hni,newCustomer:bCe,comments:mni}}}=W.getLocalizedStrings(),wCe=i.div`
90984
+ `;function Rii(e){if(e.tabsFileType!=null)return{locale_id:W.getAppLocaleID(),tabs_file_type:e.tabsFileType,tabs:e.tabs,filter_by_tabs:e.filterByTabs,time_zone:e.timezone}}const{cockpit:Fii,download:xCe,common:{texts:{unsupportedFiletype:Oii,cockpit:yCe}}}=W.getLocalizedStrings();function Nii(e){const{tabs:t,filterByTabs:r,tabsFileType:n,timezone:a}=e.defaultOptions;return{tabsFileType:n,tabs:t,filterByTabs:r,timezone:a}}function Hii(e){const t=Nii(e);return _ii(e.downloadParams.cockpitEndPoint,e.downloadParams.authParams,t)}async function _ii(e,t,r){const n=`${e}?query=${encodeURIComponent(JSON.stringify(Rii(r)))}`;try{if(r.tabsFileType==null)throw new Error(Oii);const a=await Ujo({urlEndPoint:n,authParams:t,fileType:r.tabsFileType});if(a.ok){const l=aHe(a.headers,Fii.defaultFileName),c=await a.arrayBuffer();tM(c,l)}else console.error(`${xCe.errorMessages.fileDownloadError.replace("__feature__",yCe)} ${a.statusText}`)}catch(a){console.error(`${xCe.errorMessages.fileDownloadError.replace("__feature__",yCe)} ${JSON.stringify(a)}`)}}const xn=88,O5=58,N5=1,H5=55,Vii=10,Uii=5,n0=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant"],Vfn=[...n0,"creditAgent"],iqe=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"customerSuccessManagerUserIds",multiple:!0,type:"user"},{value:"preparerUserIds",multiple:!0,type:"user"},{value:"reviewerUserIds",multiple:!0,type:"user"},{value:"apAnalystUserIds",multiple:!0,type:"user"},{value:"taxLeadUserIds",multiple:!0,type:"user"},{value:"plans",multiple:!0},{value:"productVerticals",multiple:!0},{value:"companyGroupId"},{value:"taxStatusCode"},{value:"statusCode"},{value:"annualRecurringRevenue"},{value:"monthlyRecurringRevenue"},{value:"customerSatisfaction",type:"rating"},{value:"zeniSatisfaction",type:"rating"}],nqe=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"statusCode"},{value:"recommendedActionCode"},{value:"monthlyRecurringRevenue"},{value:"subscriptionPlans",multiple:!0},{value:"subscriptionAddOns",multiple:!0},{value:"avg2MonthExpenses"},{value:"slabLowerLimit"},{value:"slabUpperLimit"}],aqe=[{value:"netBurnOrIncome"},{value:"cashPosition"},{value:"expenses"},{value:"income"},{value:"runway",type:"runway"}],sqe=[{value:"controller",multiple:!0,type:"user"},{value:"customerSuccessManager",multiple:!0,type:"user"},{value:"churnProbabilityPercentage",type:"dropdownRange"},{value:"runway",type:"runway"},{value:"netPromoterScore",type:"dropdownRange"},{value:"customerSatisfactionScore",type:"dropdownRange"},{value:"lastReportSent",type:"dateRange"},{value:"subscriptionRenewalDate",type:"dateRange"},{value:"subscriptionStartDate",type:"dateRange"},{value:"verticalProductServices"},{value:"monthlyRecurringRevenue"},{value:"companyGroupId"},{value:"externalProductServiceExposure"},{value:"companyEngagementMetricsUpdatedAt",type:"dateRange"}],Qii=[{label:"< 200K",value:"0<->200000"},{label:"75K to 100K",value:"75000<->100000"},{label:"25K to 75K",value:"25000<->75000"},{label:"< 25K",value:"0<->25000"}],Foe=[{label:"< 10K",value:"0<->10000"},{label:"5K to 8K",value:"5000<->8000"},{label:"2K to 5K",value:"2000<->5000"},{label:"< 2K",value:"0<->2000"}],Wii=[{label:"< 60K",value:"0<->60000"},{label:"60K to 200K",value:"60000<->200000"},{label:"200K to 500K",value:"200000<->500000"},{label:"500K to 800K",value:"500000<->800000"},{label:"800K to 1M",value:"800000<->1000000"},{label:"> 1M",value:"1000000-10000000000"}],Gii=[{label:"< 100K",value:"0<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Yii=[{label:"< -500K",value:"-10000000000<->-500000"},{label:"-500K to -100K",value:"-500000<->-100000"},{label:"-100K to 0",value:"-100000<->0"},{label:"0 to 100K",value:"0<->100000"},{label:"> 100K",value:"100000<->10000000000"}],Kii=[{label:"< 10K",value:"-10000000000<->10000"},{label:"10K to 100K",value:"10000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 2M",value:"500000<->2000000"},{label:"2M to 5M",value:"2000000<->5000000"},{label:"5M to 25M",value:"5000000<->25000000"},{label:"> 25M",value:"25000000<->10000000000"}],qii=[{label:"< 10K",value:"0<->10000"},{label:"10K to 50K",value:"10000<->50000"},{label:"50K to 100K",value:"50000<->100000"},{label:"100K to 300K",value:"100000<->300000"},{label:"300K to 500K",value:"300000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Zii=[{label:"< 5K",value:"-10000000000<->5000"},{label:"5K to 25K",value:"5000<->25000"},{label:"25K to 100K",value:"25000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"> 500K",value:"500000<->10000000000"}],Jii=[{label:"<= 3 months",value:"0<->3",iconColor:k.runwayRed},{label:"<= 1 year",value:"4<->12",iconColor:k.runwayYellow},{label:"> 1 year",value:"13<->1000000",iconColor:k.runwayGreen}],Xii=[{label:"ZBP",value:"billpay"},{label:"ZA",value:"accounts"},{label:"ZR",value:"reimbursement"},{label:"ZC",value:"cards"},{label:"Tax",value:"zeni_tax_plan"},{label:"Payroll",value:"payroll_manager_service_plan"},{label:"CFO",value:"cfo_plan"}],eni=[{label:"0",value:"0"},{label:"10",value:"10"},{label:"20",value:"20"},{label:"30",value:"30"},{label:"40",value:"40"},{label:"50",value:"50"},{label:"60",value:"60"},{label:"70",value:"70"},{label:"80",value:"80"},{label:"90",value:"90"},{label:"100",value:"100"}],tni=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"}],oni=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"}],rni=[{label:"<= 1 month",value:"0<->1"},{label:"1 to 3 months",value:"1<->3"},{label:"3 to 6 months",value:"3<->6"},{label:"6 to 12 months",value:"6<->12"},{label:"1 to 5 years",value:"12<->60"},{label:"5 to 10 years",value:"60<->120"},{label:"> 10 year",value:"121<->1000000"}],lqe=[1,2,3,4,5,6,7,8,9,10],cqe=[1,2,3,4,5],{cockpit:{titles:ini},common:{settings:{integrations:{connectorTooltips:{accountantSectionLabel:nni}},productNameByType:{charge_cards:ani}}}}=W.getLocalizedStrings(),sni=e=>{switch(e){case"management":case"subscription":case"portfolio":case"onboarding":case"audit":return e;case"aiAccountant":return nni;case"creditAgent":return ani;default:return ini.healthMonitor}},lni=e=>{switch(e){case"management":return"Cockpit - Management";case"subscription":return"Cockpit - Subscription";case"portfolio":return"Cockpit - Portfolio";case"onboarding":return"Cockpit - Onboarding";case"audit":return"Cockpit - Audit";case"aiAccountant":return"Cockpit - AI Accountant";case"creditAgent":return"Cockpit - Credit Agent";default:return"Cockpit - Health Monitor"}},cni=[{value:"enrollmentStatus",multiple:!0}],dqe=[{value:"company_id",multiple:!0},{value:"status",multiple:!0},{value:"priority",multiple:!0},{value:"assignees",multiple:!0,type:"user"},{value:"tag",multiple:!0},{value:"dueDate",type:"dateRange"},{value:"creationDate",type:"dateRange"}],dni=({downloadCockpitOptions:e})=>s.jsx(Vjo,{downloadMenuItems:e.downloadMenu.simpleMenuItems,onDownloadClick:e.downloadMenu.onDownloadClick});function pni(e){const[t,r]=g.useState(!1),{analytics:n,updateDownloadStateHandler:a,downloadState:l,currentCockpitTab:c}=e;return g.useEffect(()=>{async function d(){await Hii({...e}),a("Completed"),n.trackDownload(lni(c),"months","excel",!1)}t&&e.downloadState!=="In-Progress"&&(r(!1),a("In-Progress"),d())},[l,t,a,n,e,c]),s.jsx(uni,{"data-testid":te("cockpit-download-button"),children:s.jsx(dni,{downloadCockpitOptions:{type:"simple_menu",downloadMenu:{simpleMenuItems:[{type:"excel",isDownloading:e.downloadState==="In-Progress"}],onDownloadClick:async d=>{if(d==="excel"){if(e.downloadState==="In-Progress")return;r(!0)}}}}})})}const uni=i.div``,{common:{texts:{cockpit:hni,newCustomer:bCe,comments:mni}}}=W.getLocalizedStrings(),wCe=i.div`
90986
90985
  width: 100%;
90987
90986
  flex-direction: column;
90988
90987
  display: flex;
@@ -92139,7 +92138,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
92139
92138
  height: calc(100vh - 45px);
92140
92139
  overflow-y: hidden;
92141
92140
  background-color: ${e=>e.theme.colors.grey4};
92142
- `,Qfn=({companiesExcludedFromMonthEndReport:e,headerData:t,headerActions:r,managementPageActions:n,managementPageData:a,expenseAutomationEnabledCompanies:l,initialOpenThreadRequest:c})=>{const{managementView:d,loggedInUser:p,loggedInUserRole:u,realmIdUpdateStatusByCompanyId:h,showDetailsPageLink:m}=a,f=bqe(),x=nai(),{onColumnSortConfigChanged:y,changeHandlers:b,onScroll:w,onViewDetailsLinkClicked:v,onCockpitReloadData:A,onCompanyNameClicked:S,onPassportIconClicked:E,onTaskIconClicked:I,onFiltersChange:L,onMonthEndReportPageClick:B,showMonthEndReportHistoricData:D,onProductVerticalsChanged:P,onRealmIdReset:T,onRealmIdUpdate:R}=n,N=d.uiState.filterText,K=d.uiState.filters,q=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return r.filterActions&&(r.filterActions.getCategoryWiseOptions=()=>V1i(d)),s.jsxs(H1i,{children:[s.jsx(V2,{headerActions:{...r},headerData:{...t,filterData:{filterText:N,filters:K},companiesLoaded:q,selectedTabOption:"management",allTabOptions:m===void 0?t.allTabOptions??n0:void 0}}),s.jsx(_1i,{changeHandlers:b,companiesExcludedFromMonthEndReport:e,expenseAutomationEnabledCompanies:l,initialOpenThreadRequest:c,isFilterApplied:K?.categories!=null,loggedInUser:p,loggedInUserRole:u,managementView:d,onClearFilter:()=>L?.("management",{}),onCockpitReloadData:A,onColumnSortConfigChanged:y,onCompanyNameClicked:S,onMonthEndReportPageClick:B,onPassportIconClicked:E,onScroll:w,onTaskIconClicked:I,onViewDetailsLinkClicked:v,showMonthEndReportHistoricData:D,isProductVerticalsColumnVisible:f,onProductVerticalsChanged:P,isRealmIdColumnVisible:x,realmIdUpdateStatusByCompanyId:h,onRealmIdReset:T,onRealmIdUpdate:R})]})},_1i=({managementView:e,showDetailsPageLink:t=!0,loggedInUser:r,companiesExcludedFromMonthEndReport:n,expenseAutomationEnabledCompanies:a,initialOpenThreadRequest:l,isFilterApplied:c,loggedInUserRole:d,onColumnSortConfigChanged:p,changeHandlers:u,onScroll:h,onViewDetailsLinkClicked:m,onCockpitReloadData:f,onCompanyNameClicked:x,onTaskIconClicked:y,onPassportIconClicked:b,onClearFilter:w,onMonthEndReportPageClick:v,showMonthEndReportHistoricData:A,isProductVerticalsColumnVisible:S,onProductVerticalsChanged:E,isRealmIdColumnVisible:I,realmIdUpdateStatusByCompanyId:L,onRealmIdReset:B,onRealmIdUpdate:D})=>{const P=Me();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:f,selectedCockpitOption:"management"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?s.jsx(O1i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?c?s.jsx($p,{emptySearchTextFirstLine:M1i,emptySearchTextSecondLine:WCe,filtersApplied:!0,onClearFilter:w}):s.jsx($p,{emptySearchTextFirstLine:R1i,emptySearchTextSecondLine:WCe}):s.jsx(N1i,{windowSize:P,children:s.jsx(j1i,{showDetailsPageLink:t,onColumnSortConfigChanged:p,changeHandlers:u,onScroll:h,onViewDetailsLinkClicked:m,managementView:e,loggedInUser:r,loggedInUserRole:d,expenseAutomationEnabledCompanies:a,onCompanyNameClicked:x,onTaskIconClicked:y,onPassportIconClicked:b,onMonthEndReportPageClick:v,companiesExcludedFromMonthEndReport:n,showMonthEndReportHistoricData:A,initialOpenThreadRequest:l,isProductVerticalsColumnVisible:S,onProductVerticalsChanged:E,isRealmIdColumnVisible:I,realmIdUpdateStatusByCompanyId:L,onRealmIdReset:B,onRealmIdUpdate:D})})},V1i=e=>{const t=e.zeniUsers.values,r=iqe,{companies:n}=e;return r.reduce((a,l)=>{switch(l.value){case"companyGroupId":{if(n.length===0)return{...a,[l.value]:[]};const c=n[0].company.schema.companyGroup.map(d=>{const p=d;return{label:p.name,value:p.id}});return{...a,[l.value]:c}}case"statusCode":{if(n.length===0)return{...a,[l.value]:[]};const c=n[0].company.schema.status.map(d=>{const p=d;return{label:p.name,value:p.code}});return{...a,[l.value]:c}}case"taxStatusCode":{if(n.length===0)return{...a,[l.value]:[]};const c=n[0].company.schema.taxStatus.map(d=>{const p=d;return{label:p.name,value:p.code,avatar:""}});return{...a,[l.value]:c}}case"controllerUserIds":case"apAnalystUserIds":case"preparerUserIds":case"reviewerUserIds":case"taxLeadUserIds":case"customerSuccessManagerUserIds":{const c=t.map(d=>({label:d.firstName||d.lastName?`${d.firstName} ${d.lastName}`:d.email,value:d.userId,photo:d.photo,email:d.email}));return{...a,[l.value]:c}}case"plans":{const c=e.subscriptionPlansZeniSkus.map(d=>({label:d,value:d})).sort((d,p)=>d.label.localeCompare(p.label));return{...a,[l.value]:c}}case"annualRecurringRevenue":return{...a,[l.value]:Qii};case"monthlyRecurringRevenue":return{...a,[l.value]:Foe};case"customerSatisfaction":{const c=Object.values(Bv).map(d=>({label:d.name,value:d.id}));return{...a,[l.value]:c}}case"zeniSatisfaction":{const c=Object.values(y9).map(d=>({label:d.name,value:d.id}));return{...a,[l.value]:c}}case"productVerticals":{const c=Aqe.map(d=>({label:{...B1i,bookkeeping:P1i,billPay:D1i,reimbursement:z1i,tax:F1i,payroll:T1i}[d],value:d}));return{...a,[l.value]:c}}default:return{...a,[l.value]:[]}}},{})},{cockpit:{taskManager:{header:U1i}},common:Af}=W.getLocalizedStrings(),I4=[{key:"name",value:Af.texts.name,sortOrder:"ascending",width:new j(176,176),isThreadAllowed:!0},{key:"taskName",value:U1i.taskName,sortOrder:"ascending",width:new j(320,320),isThreadAllowed:!0},{key:"status",value:Af.texts.status,sortOrder:"ascending",width:new j(100,100),isThreadAllowed:!0},{key:"priority",value:Af.texts.priority,sortOrder:"ascending",width:new j(90,90),isThreadAllowed:!0},{key:"dueDate",value:Af.texts.dueDate,sortOrder:"ascending",width:new j(100,100),isThreadAllowed:!0},{key:"assignee",value:Af.texts.assignee,sortOrder:"ascending",width:new j(220,220),isThreadAllowed:!0},{key:"tags",value:Af.texts.tags,sortOrder:"ascending",width:new j(115,115),isThreadAllowed:!0},{key:"createdBy",value:Af.texts.createdBy,sortOrder:"ascending",width:new j(140,140),isThreadAllowed:!0}];I4.map(e=>e.key);function Q1i({sortConfig:e,onColumnSortConfigChanged:t}){const r=Me(),[n,a]=g.useState(sa(I4));g.useEffect(()=>{const c=[...n];for(const d of c)d.key===e.sortKey?d.sortOrder=e.sortOrder:d.sortOrder="ascending";a(c)},[e.sortKey,e.sortOrder]);const l=(c,d)=>{let p=d;e.sortKey===c&&(p=d==="ascending"?"descending":"ascending"),t(c,p)};return s.jsx(G1i,{height:O5,children:n.map(c=>s.jsxs(Y1i,{sortDataValue:e.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:r,children:[s.jsxs(Z1i,{onClick:()=>l(ske(c.key),c.sortOrder),children:[s.jsx(qo,{children:c.value}),s.jsx(W1i,{sortDataValue:e.sortKey,headerdata:c,children:s.jsx(jn,{width:12,height:12})})]}),s.jsx(q1i,{isVisible:e.sortKey===c.key&&c.key!=="dueDate",children:s.jsx(K1i,{onClick:()=>l("dueDate","ascending")})})]},c.key))})}const W1i=i.div`
92141
+ `,Ufn=({companiesExcludedFromMonthEndReport:e,headerData:t,headerActions:r,managementPageActions:n,managementPageData:a,expenseAutomationEnabledCompanies:l,initialOpenThreadRequest:c})=>{const{managementView:d,loggedInUser:p,loggedInUserRole:u,realmIdUpdateStatusByCompanyId:h,showDetailsPageLink:m}=a,f=bqe(),x=nai(),{onColumnSortConfigChanged:y,changeHandlers:b,onScroll:w,onViewDetailsLinkClicked:v,onCockpitReloadData:A,onCompanyNameClicked:S,onPassportIconClicked:E,onTaskIconClicked:I,onFiltersChange:L,onMonthEndReportPageClick:B,showMonthEndReportHistoricData:D,onProductVerticalsChanged:P,onRealmIdReset:T,onRealmIdUpdate:R}=n,N=d.uiState.filterText,K=d.uiState.filters,q=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return r.filterActions&&(r.filterActions.getCategoryWiseOptions=()=>V1i(d)),s.jsxs(H1i,{children:[s.jsx(V2,{headerActions:{...r},headerData:{...t,filterData:{filterText:N,filters:K},companiesLoaded:q,selectedTabOption:"management",allTabOptions:m===void 0?t.allTabOptions??n0:void 0}}),s.jsx(_1i,{changeHandlers:b,companiesExcludedFromMonthEndReport:e,expenseAutomationEnabledCompanies:l,initialOpenThreadRequest:c,isFilterApplied:K?.categories!=null,loggedInUser:p,loggedInUserRole:u,managementView:d,onClearFilter:()=>L?.("management",{}),onCockpitReloadData:A,onColumnSortConfigChanged:y,onCompanyNameClicked:S,onMonthEndReportPageClick:B,onPassportIconClicked:E,onScroll:w,onTaskIconClicked:I,onViewDetailsLinkClicked:v,showMonthEndReportHistoricData:D,isProductVerticalsColumnVisible:f,onProductVerticalsChanged:P,isRealmIdColumnVisible:x,realmIdUpdateStatusByCompanyId:h,onRealmIdReset:T,onRealmIdUpdate:R})]})},_1i=({managementView:e,showDetailsPageLink:t=!0,loggedInUser:r,companiesExcludedFromMonthEndReport:n,expenseAutomationEnabledCompanies:a,initialOpenThreadRequest:l,isFilterApplied:c,loggedInUserRole:d,onColumnSortConfigChanged:p,changeHandlers:u,onScroll:h,onViewDetailsLinkClicked:m,onCockpitReloadData:f,onCompanyNameClicked:x,onTaskIconClicked:y,onPassportIconClicked:b,onClearFilter:w,onMonthEndReportPageClick:v,showMonthEndReportHistoricData:A,isProductVerticalsColumnVisible:S,onProductVerticalsChanged:E,isRealmIdColumnVisible:I,realmIdUpdateStatusByCompanyId:L,onRealmIdReset:B,onRealmIdUpdate:D})=>{const P=Me();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:f,selectedCockpitOption:"management"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?s.jsx(O1i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?c?s.jsx($p,{emptySearchTextFirstLine:M1i,emptySearchTextSecondLine:WCe,filtersApplied:!0,onClearFilter:w}):s.jsx($p,{emptySearchTextFirstLine:R1i,emptySearchTextSecondLine:WCe}):s.jsx(N1i,{windowSize:P,children:s.jsx(j1i,{showDetailsPageLink:t,onColumnSortConfigChanged:p,changeHandlers:u,onScroll:h,onViewDetailsLinkClicked:m,managementView:e,loggedInUser:r,loggedInUserRole:d,expenseAutomationEnabledCompanies:a,onCompanyNameClicked:x,onTaskIconClicked:y,onPassportIconClicked:b,onMonthEndReportPageClick:v,companiesExcludedFromMonthEndReport:n,showMonthEndReportHistoricData:A,initialOpenThreadRequest:l,isProductVerticalsColumnVisible:S,onProductVerticalsChanged:E,isRealmIdColumnVisible:I,realmIdUpdateStatusByCompanyId:L,onRealmIdReset:B,onRealmIdUpdate:D})})},V1i=e=>{const t=e.zeniUsers.values,r=iqe,{companies:n}=e;return r.reduce((a,l)=>{switch(l.value){case"companyGroupId":{if(n.length===0)return{...a,[l.value]:[]};const c=n[0].company.schema.companyGroup.map(d=>{const p=d;return{label:p.name,value:p.id}});return{...a,[l.value]:c}}case"statusCode":{if(n.length===0)return{...a,[l.value]:[]};const c=n[0].company.schema.status.map(d=>{const p=d;return{label:p.name,value:p.code}});return{...a,[l.value]:c}}case"taxStatusCode":{if(n.length===0)return{...a,[l.value]:[]};const c=n[0].company.schema.taxStatus.map(d=>{const p=d;return{label:p.name,value:p.code,avatar:""}});return{...a,[l.value]:c}}case"controllerUserIds":case"apAnalystUserIds":case"preparerUserIds":case"reviewerUserIds":case"taxLeadUserIds":case"customerSuccessManagerUserIds":{const c=t.map(d=>({label:d.firstName||d.lastName?`${d.firstName} ${d.lastName}`:d.email,value:d.userId,photo:d.photo,email:d.email}));return{...a,[l.value]:c}}case"plans":{const c=e.subscriptionPlansZeniSkus.map(d=>({label:d,value:d})).sort((d,p)=>d.label.localeCompare(p.label));return{...a,[l.value]:c}}case"annualRecurringRevenue":return{...a,[l.value]:Qii};case"monthlyRecurringRevenue":return{...a,[l.value]:Foe};case"customerSatisfaction":{const c=Object.values(Bv).map(d=>({label:d.name,value:d.id}));return{...a,[l.value]:c}}case"zeniSatisfaction":{const c=Object.values(y9).map(d=>({label:d.name,value:d.id}));return{...a,[l.value]:c}}case"productVerticals":{const c=Aqe.map(d=>({label:{...B1i,bookkeeping:P1i,billPay:D1i,reimbursement:z1i,tax:F1i,payroll:T1i}[d],value:d}));return{...a,[l.value]:c}}default:return{...a,[l.value]:[]}}},{})},{cockpit:{taskManager:{header:U1i}},common:Af}=W.getLocalizedStrings(),I4=[{key:"name",value:Af.texts.name,sortOrder:"ascending",width:new j(176,176),isThreadAllowed:!0},{key:"taskName",value:U1i.taskName,sortOrder:"ascending",width:new j(320,320),isThreadAllowed:!0},{key:"status",value:Af.texts.status,sortOrder:"ascending",width:new j(100,100),isThreadAllowed:!0},{key:"priority",value:Af.texts.priority,sortOrder:"ascending",width:new j(90,90),isThreadAllowed:!0},{key:"dueDate",value:Af.texts.dueDate,sortOrder:"ascending",width:new j(100,100),isThreadAllowed:!0},{key:"assignee",value:Af.texts.assignee,sortOrder:"ascending",width:new j(220,220),isThreadAllowed:!0},{key:"tags",value:Af.texts.tags,sortOrder:"ascending",width:new j(115,115),isThreadAllowed:!0},{key:"createdBy",value:Af.texts.createdBy,sortOrder:"ascending",width:new j(140,140),isThreadAllowed:!0}];I4.map(e=>e.key);function Q1i({sortConfig:e,onColumnSortConfigChanged:t}){const r=Me(),[n,a]=g.useState(sa(I4));g.useEffect(()=>{const c=[...n];for(const d of c)d.key===e.sortKey?d.sortOrder=e.sortOrder:d.sortOrder="ascending";a(c)},[e.sortKey,e.sortOrder]);const l=(c,d)=>{let p=d;e.sortKey===c&&(p=d==="ascending"?"descending":"ascending"),t(c,p)};return s.jsx(G1i,{height:O5,children:n.map(c=>s.jsxs(Y1i,{sortDataValue:e.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:r,children:[s.jsxs(Z1i,{onClick:()=>l(ske(c.key),c.sortOrder),children:[s.jsx(qo,{children:c.value}),s.jsx(W1i,{sortDataValue:e.sortKey,headerdata:c,children:s.jsx(jn,{width:12,height:12})})]}),s.jsx(q1i,{isVisible:e.sortKey===c.key&&c.key!=="dueDate",children:s.jsx(K1i,{onClick:()=>l("dueDate","ascending")})})]},c.key))})}const W1i=i.div`
92143
92142
  display: flex;
92144
92143
  align-items: center;
92145
92144
  transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
@@ -92297,7 +92296,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
92297
92296
  min-height: 100%;
92298
92297
  flex-direction: column;
92299
92298
  width: 100%;
92300
- `,{cockpit:{emptySearchTextSecondLine:ppi,taskManager:{metrics:{totalTasks:upi,openTasks:hpi,overdueTasks:mpi,closedTasks:gpi}}},common:{texts:{sorryWeCouldnTFindAnyResults:fpi}}}=W.getLocalizedStrings(),Wfn=({headerActions:e,headerData:t,isBirdsEyeViewEnabled:r,initialOpenThreadRequest:n,taskManagerPageData:a,taskManagerPageActions:l})=>{const{companyTaskManagerView:c}=a,{uiState:d}=c,{onCockpitReloadData:p,onFetchTaskManagerView:u,onRowClick:h}=l,m=c.fetchState==="Completed",{filters:f}=c.uiState,[x,y]=g.useState(c.uiState.filterText??""),b=()=>{u(d.from,d.sortKey,d.sortOrder,!0,d.filterText)},w=(S,E)=>{u(d.from,S,E,!1,d.filterText,f)},v=g.useRef(r5(S=>u(d.from,d.sortKey,d.sortOrder,!1,S,f),500,{trailing:!0})).current,A=(S,E)=>{y(E);const I=E.trim();I.length>=2?v(I):v("")};return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>ypi(c)),s.jsxs(bpi,{children:[s.jsx(V2,{headerActions:{...e,filterActions:{...e.filterActions,onFilterTextChanged:A}},headerData:{...t,allTabOptions:t.allTabOptions??n0,selectedTabOption:"taskManager",companiesLoaded:m,filterData:{filterText:x,filters:f}}}),r?s.jsx(Cpi,{metrics:c.metrics}):null,s.jsx(xpi,{companyTaskManagerView:c,fetchNextItemsOnScroll:b,initialOpenThreadRequest:n,onCockpitReloadData:p,onColumnSortConfigChanged:w,onRowClick:h})]})},xpi=({companyTaskManagerView:e,fetchNextItemsOnScroll:t,initialOpenThreadRequest:r,onCockpitReloadData:n,onColumnSortConfigChanged:a,onRowClick:l})=>{const c=Me();return e.fetchState==="Error"&&e.tasksList.length===0?s.jsx(P3,{selectedCockpitOption:"taskManager",onCockpitReloadData:n}):e.fetchState==="Not-Started"||e.fetchState==="In-Progress"&&e.tasksList.length===0?s.jsx(wpi,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.fetchState==="Completed"&&e.tasksList.length===0?s.jsx($p,{emptySearchTextFirstLine:fpi,emptySearchTextSecondLine:ppi,filtersApplied:!1}):s.jsx(vpi,{windowSize:c,children:s.jsx(api,{companyTaskManagerView:e,fetchNextItemsOnScroll:t,initialOpenThreadRequest:r,onColumnSortConfigChanged:a,onRowClick:l})})},ypi=e=>{const t=dqe,r=new Map;for(const n of e.tasksList)for(const a of n.tags)r.has(a.tagId)||r.set(a.tagId,a);return t.reduce((n,a)=>{switch(a.value){case"company_id":{const l=(e.companies??[]).map(c=>({label:c.companyInfo.name,value:c.companyInfo.companyId}));return{...n,[a.value]:l}}case"assignees":{const l=(e.users??[]).map(c=>({label:c?.firstName||c?.lastName?`${c?.firstName} ${c?.lastName}`:c?.email??"",value:c.userId,photo:c?.photo,email:c?.email}));return{...n,[a.value]:l}}case"status":return{...n,[a.value]:H$e.map(l=>({label:l.name,value:l.code}))};case"priority":return{...n,[a.value]:oZ.map(l=>({label:l.name,value:l.code}))};case"tag":{const l=Array.from(r.values()).map(c=>({label:c.name,value:c.tagId}));return{...n,[a.value]:l}}default:return{...n,[a.value]:[]}}},{})},bpi=i.div`
92299
+ `,{cockpit:{emptySearchTextSecondLine:ppi,taskManager:{metrics:{totalTasks:upi,openTasks:hpi,overdueTasks:mpi,closedTasks:gpi}}},common:{texts:{sorryWeCouldnTFindAnyResults:fpi}}}=W.getLocalizedStrings(),Qfn=({headerActions:e,headerData:t,isBirdsEyeViewEnabled:r,initialOpenThreadRequest:n,taskManagerPageData:a,taskManagerPageActions:l})=>{const{companyTaskManagerView:c}=a,{uiState:d}=c,{onCockpitReloadData:p,onFetchTaskManagerView:u,onRowClick:h}=l,m=c.fetchState==="Completed",{filters:f}=c.uiState,[x,y]=g.useState(c.uiState.filterText??""),b=()=>{u(d.from,d.sortKey,d.sortOrder,!0,d.filterText)},w=(S,E)=>{u(d.from,S,E,!1,d.filterText,f)},v=g.useRef(r5(S=>u(d.from,d.sortKey,d.sortOrder,!1,S,f),500,{trailing:!0})).current,A=(S,E)=>{y(E);const I=E.trim();I.length>=2?v(I):v("")};return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>ypi(c)),s.jsxs(bpi,{children:[s.jsx(V2,{headerActions:{...e,filterActions:{...e.filterActions,onFilterTextChanged:A}},headerData:{...t,allTabOptions:t.allTabOptions??n0,selectedTabOption:"taskManager",companiesLoaded:m,filterData:{filterText:x,filters:f}}}),r?s.jsx(Cpi,{metrics:c.metrics}):null,s.jsx(xpi,{companyTaskManagerView:c,fetchNextItemsOnScroll:b,initialOpenThreadRequest:n,onCockpitReloadData:p,onColumnSortConfigChanged:w,onRowClick:h})]})},xpi=({companyTaskManagerView:e,fetchNextItemsOnScroll:t,initialOpenThreadRequest:r,onCockpitReloadData:n,onColumnSortConfigChanged:a,onRowClick:l})=>{const c=Me();return e.fetchState==="Error"&&e.tasksList.length===0?s.jsx(P3,{selectedCockpitOption:"taskManager",onCockpitReloadData:n}):e.fetchState==="Not-Started"||e.fetchState==="In-Progress"&&e.tasksList.length===0?s.jsx(wpi,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.fetchState==="Completed"&&e.tasksList.length===0?s.jsx($p,{emptySearchTextFirstLine:fpi,emptySearchTextSecondLine:ppi,filtersApplied:!1}):s.jsx(vpi,{windowSize:c,children:s.jsx(api,{companyTaskManagerView:e,fetchNextItemsOnScroll:t,initialOpenThreadRequest:r,onColumnSortConfigChanged:a,onRowClick:l})})},ypi=e=>{const t=dqe,r=new Map;for(const n of e.tasksList)for(const a of n.tags)r.has(a.tagId)||r.set(a.tagId,a);return t.reduce((n,a)=>{switch(a.value){case"company_id":{const l=(e.companies??[]).map(c=>({label:c.companyInfo.name,value:c.companyInfo.companyId}));return{...n,[a.value]:l}}case"assignees":{const l=(e.users??[]).map(c=>({label:c?.firstName||c?.lastName?`${c?.firstName} ${c?.lastName}`:c?.email??"",value:c.userId,photo:c?.photo,email:c?.email}));return{...n,[a.value]:l}}case"status":return{...n,[a.value]:H$e.map(l=>({label:l.name,value:l.code}))};case"priority":return{...n,[a.value]:oZ.map(l=>({label:l.name,value:l.code}))};case"tag":{const l=Array.from(r.values()).map(c=>({label:c.name,value:c.tagId}));return{...n,[a.value]:l}}default:return{...n,[a.value]:[]}}},{})},bpi=i.div`
92301
92300
  height: calc(100vh - 60px);
92302
92301
  overflow-y: hidden;
92303
92302
  display: flex;
@@ -92604,7 +92603,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
92604
92603
  color: ${k.heroDark};
92605
92604
  `,Mui=i(Vqe)`
92606
92605
  color: ${k.heroDark};
92607
- `,Bui=i(ke)``,{common:Ll,cockpit:{health:{detailPage:$a,common:{engagementTypes:Dui,labels:{lastEngagements:Pui,factorsThatDecreaseChurnProbability:Tui,factorsThatIncreaseChurnProbability:zui,contributingFactors:Rui,increaseChurnProbability:Fui,decreasingChurnProbability:Oui}}}},dateFormat:Nui}=W.getLocalizedStrings(),{to:Hui,from:_ui,cc:Vui,host:Uui,attendees:Qui,strings:{colon:$l,hyphen:eAe,comma:Wui,space:Gui},texts:{subject:tAe,addMore:Yui,select:Kui}}=Ll,{strings:{percentage:oAe}}=Ll,wS=(e,t)=>`${e}.${t}`,rAe=e=>`${e}_form`,D0="healthMonitorDetails",iAe="healthMonitorPage",nAe="netPromoterScore",aAe="customerSatisfactionScore",sAe="externalProductServiceExposure",lAe="additionalChurnFactors",Uqe=e=>[{label:zui,options:e.increasingChurnProbability.map(t=>({label:t.value,value:t.code}))},{label:Tui,options:e.decreasingChurnProbability.map(t=>({label:t.value,value:t.code}))}],Qqe=e=>e==null?[]:e.increasingChurnProbability.map(t=>t.code).concat(e.decreasingChurnProbability.map(t=>t.code));function Gfn({localData:e,companyHealthMetricViewSelector:t,additionalChurnFactorsOptions:r,analytics:n,urlSource:a,onCloseDrawer:l,onSaveChangesToLocalStore:c,onSaveClick:d}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:u}=t,[h,m]=g.useState(!1),f=Fqe(p),[x,y]=g.useState(!1),[b,w]=g.useState(!1),v=Oi({mode:"all",defaultValues:qui(e,r),reValidateMode:"onBlur"}),A=g.useRef(null);function S(F){p!=null&&n.trackCockpitHealthMonitorChurnFormClicked(F,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:oW(p.companyHealthMetric.subscriptionRenewalDate)??null,netPromoterScore:u?.companyHealthMetricLocalData.netPromoterScore??null,customerSatisfactionScore:u?.companyHealthMetricLocalData.customerSatisfactionScore??null,externalServicesExposure:u?.companyHealthMetricLocalData.externalProductServiceExposure??null,runwayMonths:_W(p.companyHealthMetric.runway)===!0?1e6:p.companyHealthMetric.runway===void 0?null:p.companyHealthMetric.runway.runwayMonths??null,dashBoardLastSeen:oW(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:oW(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const E=v.handleSubmit(()=>{S("Save"),A?.current&&A.current.scrollTo({top:0,behavior:"instant"}),y(!0),m(!0),d()}),I=async(F,_)=>{if(F!=null){const V={..._},O=V[D0][lAe].selectedOptions,z={netPromoterScore:V[D0][nAe]?.selectedOption,customerSatisfactionScore:V[D0][aAe]?.selectedOption,externalProductServiceExposure:V[D0][sAe]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(H=>O.indexOf(H.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(H=>O.indexOf(H.code)!=-1)}};c(z)}},L=g.useRef(null),B=g.useRef(null),[D,P]=g.useState(null),T=g.useRef(null),R=Qqe(e.additionalChurnFactors);g.useEffect(()=>(B.current=setTimeout(()=>{L.current&&(P(L.current),B.current&&clearTimeout(B.current))},10),()=>{B.current!=null&&clearTimeout(B.current)}),[R]),g.useEffect(()=>{const F=v.watch((_,{name:V})=>{V!=null&&_!=null&&Qa(()=>I(V,_))});return()=>{F.unsubscribe()}}),g.useEffect(()=>{if(p!=null){const F=p.controllers.map(_=>`${_.firstName} ${_.lastName}`);a||n.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,F,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function N(F){return F!=null?`${Ll.texts.churnProbability} ${Ll.texts.is} ${f.churnProbabilityPercentage}${oAe}`:`${Ll.texts.churnProbability} ${oAe}`}function K(){S("Cancel"),l()}const q={valueContainer:F=>({...F,padding:`2px ${o.sp3}`,overflow:"unset"}),multiValue:F=>({...F,margin:0})};return s.jsxs($hi,{ref:A,"data-testid":te("health-monitor-drawer"),children:[s.jsxs(bhi,{"data-testid":te("health-monitor-drawer-header"),children:[s.jsx(whi,{"data-testid":te("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${$a.heading}`}),s.jsx(nhi,{"data-testid":te("health-monitor-drawer-close-button"),onClick:K,children:s.jsx(ahi,{})})]}),s.jsxs(Ahi,{children:[t.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?s.jsx(Phi,{"data-testid":te("health-monitor-drawer-error"),children:s.jsxs(Thi,{children:[s.jsx(Rhi,{}),t.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?s.jsx(zhi,{"data-testid":te("health-monitor-drawer-error-text"),children:t.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,s.jsx(lhi,{"data-testid":te("health-monitor-drawer-churn-section"),children:u?.saveStatus?.fetchState==="In-Progress"?s.jsxs(shi,{"data-testid":te("health-monitor-drawer-churn-loader"),children:[s.jsx(Ao,{size:"ExtraLarge",start:!0}),s.jsx($i,{children:$a.calculatingProbability})]}):s.jsxs(vhi,{"data-testid":te("health-monitor-drawer-churn-box"),children:[s.jsx(Chi,{"data-testid":te("health-monitor-drawer-churn-heading"),children:N(f.churnProbabilityPercentage)}),s.jsx(Jui,{"data-testid":te("health-monitor-drawer-churn-meter"),children:s.jsx(zqe,{barHeight:32,percentage:f.churnProbabilityPercentage})}),s.jsx(chi,{"data-testid":te("health-monitor-drawer-churn-reasons"),children:p?.companyHealthMetric.churnProbabilityPercentage!=null&&p?.companyHealthMetric.churnProbabilityReason.length!==0?s.jsxs(s.Fragment,{children:[s.jsx(dhi,{"data-testid":te("health-monitor-drawer-churn-contributing-heading"),children:Rui}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?s.jsxs(dAe,{"data-testid":te("health-monitor-drawer-churn-increasing-factors"),children:[s.jsx(cAe,{children:`${Fui}${$l}`}),s.jsxs(uAe,{children:[p.companyHealthMetric.churnProbabilityReason.map((F,_)=>s.jsx(aW,{children:s.jsx(sW,{children:F.text})},`${Wi()}_${_}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((F,_)=>s.jsxs(aW,{children:[s.jsx(sW,{children:F.value}),s.jsx(pAe,{children:"Newly added"})]},`${Wi()}_${_}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?s.jsxs(dAe,{"data-testid":te("health-monitor-drawer-churn-decreasing-factors"),children:[s.jsx(cAe,{children:`${Oui}${$l}`}),s.jsx(uAe,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((F,_)=>s.jsxs(aW,{children:[s.jsx(sW,{children:F.value}),s.jsx(pAe,{children:"Newly added"})]},`${Wi()}_${_}}`))})]}):null,s.jsxs(hhi,{"data-testid":te("health-monitor-drawer-add-more-button"),onClick:()=>{Epo(T?.current,A?.current),setTimeout(()=>{w(!0)},500)},ref:T,children:[s.jsx(uhi,{}),s.jsx(phi,{children:Yui})]})]}):null})]})}),s.jsxs(Shi,{"data-testid":te("health-monitor-drawer-form-container"),children:[s.jsxs(mhi,{children:[s.jsxs(fhi,{children:[s.jsx(xhi,{"data-testid":te("health-monitor-drawer-manual-input-heading"),children:$a.manualInput.header}),s.jsx(Lt,{maxWidth:"250px",variant:"small-description",data:$a.tooltipTexts.manualInputText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-manual-input-info"),style:{marginTop:o.sp1,marginRight:o.sp0}})})]}),f.companyEngagementMetricsUpdatedAt!=null&&t.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?s.jsx(ghi,{"data-testid":te("health-monitor-drawer-last-updated"),children:f.updatedByUserName!=null?s.jsxs(hAe,{children:[`${Ll.texts.lastUpdatedBy}${$l} ${f.updatedByUserName}`,s.jsx(Yq,{}),`${f.companyEngagementMetricsUpdatedAt.date}${Wui}${Gui}${f.companyEngagementMetricsUpdatedAt.time}`]}):s.jsxs(hAe,{children:[`${Ll.texts.lastUpdated}${$l} ${f.companyEngagementMetricsUpdatedAt.date}`,s.jsx(Yq,{}),`${f.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),s.jsx(Fi,{...v,children:s.jsx("form",{id:rAe(iAe),onSubmit:E,children:s.jsxs(Ehi,{"data-testid":te("health-monitor-drawer-form-fields"),children:[s.jsx(Xui,{"data-testid":te("health-monitor-drawer-nps-field"),children:s.jsx(kye,{label:{label:`${Ll.texts.nps}${$l}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(F,_)=>({input:{textAlign:_.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:Ll.add,name:wS(D0,nAe),defaultValue:{allOptions:lqe,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(F,_)=>_.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:F!=null&&!!F.selectedOption}},style:{width:"auto"}})}),s.jsx(lW,{}),s.jsx(ehi,{"data-testid":te("health-monitor-drawer-csat-field"),children:s.jsx(kye,{label:{label:`${Ll.texts.csat}${$l}`,width:0,labelIcon:s.jsx(Lt,{maxWidth:"300px",variant:"small-description",data:$a.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-csat-info")})}),style:{marginRight:o.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(F,_)=>({input:{textAlign:_.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:Ll.add,name:wS(D0,aAe),defaultValue:{allOptions:cqe,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(F,_)=>_.healthMonitorDetails.netPromoterScore.selectedOption?!0:F!=null&&!!F.selectedOption}},style:{width:"auto"}})}),s.jsx(lW,{}),s.jsx(thi,{"data-testid":te("health-monitor-drawer-external-exposure-field"),children:s.jsx(RD,{label:{label:$a.manualInput.labels.externalProductServices,labelIcon:s.jsx(Lt,{maxWidth:"265px",variant:"small-description",data:$a.tooltipTexts.externalProductServicesText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:o.sp2}},singleSelectPickerField:{placeholder:Ll.add,name:wS(D0,sAe),defaultValue:{allOptions:pke,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:F=>F!=null&&!!F.selectedOption}},style:{width:"auto"}})}),s.jsx(lW,{}),s.jsxs(Lhi,{"data-testid":te("health-monitor-drawer-additional-factors"),additionalNotesHidden:R.length===0,isFocused:b,children:[s.jsx(FSr,{fullWidthSelect:!0,label:{label:`${$a.manualInput.labels.additionalContributingFactorsLabel}${$l}`,labelIcon:s.jsx(Lt,{maxWidth:"280px",variant:"small-description",data:$a.tooltipTexts.additionalContributingFactorsText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:wS(D0,lAe),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Uqe(r),selectedOptions:R},placeholder:Kui,customStyleConfig:q,showSelectedInNewLines:!0},isMenuOpen:b,setIsMenuOpen:w,menuPortalEnabled:!0}),R.length!==0&&s.jsxs(jhi,{"data-testid":te("health-monitor-drawer-notes-composer"),children:[s.jsx(_hi,{}),s.jsx(Ihi,{ref:L,children:D&&Fn.createPortal(s.jsx(Epi,{roomId:`cockpit_${p?.companyInfo.companyId}`,threadMetadata:{application:"cockpit",companyId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",entityId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",companyName:p?.companyInfo.name!=null?p.companyInfo.name:"",tab:"healthMonitor",isGlobalComment:!1,entityType:"healthMonitor.notes",url:window.location.href},composerPlaceholder:$a.manualInput.placeholders.addANote,createThreadCallback:()=>{y(!1)},isSubmitComment:x}),D)})]})]})]})})})]}),s.jsxs(khi,{"data-testid":te("health-monitor-drawer-prefilled-section"),children:[s.jsx(yhi,{"data-testid":te("health-monitor-drawer-prefilled-heading"),children:$a.preFilledInput.header}),s.jsxs(Mhi,{"data-testid":te("health-monitor-drawer-runway"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.runway}),f.runway!=null?_W(f.runway)===!0?s.jsx(Dhi,{}):s.jsx(w6,{children:Rqe(f.runway.runwayMonths)}):s.jsx(w6,{children:$a.notApplicable})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-dashboard-last-seen"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.dashboardLastSeen}),s.jsx(w6,{children:f.dashboardLastVisit??$a.notApplicable})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-last-report-sent"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.lastReportSent}),s.jsx(w6,{children:f.lastReportSent??$a.notApplicable})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-product-services"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.zeniProductServices}),s.jsx(w6,{children:s.jsx(Hqe,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-days-to-renewal"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.daysToRenewal}),s.jsx(w6,{children:f.renewalDate??$a.notApplicable})]}),s.jsx(Bhi,{"data-testid":te("health-monitor-drawer-last-engagements"),children:s.jsx(Tko,{label:{label:`${Pui}${$l}`},text:s.jsx(Fhi,{children:f.lastEngagements.length>0?f.lastEngagements.map((F,_)=>s.jsx(Ohi,{"data-testid":te("health-monitor-drawer-engagement",String(_)),children:s.jsx(Lt,{style:{padding:`12px ${o.sp3}`,color:k.heroDark},title:s.jsx(Hhi,{children:F.type==="email"?s.jsxs(mAe,{children:[s.jsxs($f,{children:[s.jsxs(kf,{children:[tAe,$l]}),s.jsx(Sf,{children:F.subject})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[_ui,$l]}),s.jsx(Sf,{children:F.from})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[Hui,$l]}),s.jsx(Sf,{children:F.to})]}),F.cc!=""?s.jsxs($f,{children:[s.jsxs(kf,{children:[Vui,$l]}),s.jsx(Sf,{children:F.cc})]}):null]}):s.jsxs(mAe,{children:[s.jsxs($f,{children:[s.jsxs(kf,{children:[tAe,$l]}),s.jsx(Sf,{children:F.subject})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[Uui,$l]}),s.jsx(Sf,{children:F.hostName})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[Qui,$l]}),s.jsx(Sf,{children:F.attendees})]})]})}),placement:"left",children:s.jsxs(Nhi,{children:[s.jsxs(ihi,{children:[F.type==="email"?s.jsx(Uhi,{"data-testid":te("health-monitor-drawer-engagement-email-icon",String(_))}):s.jsx(Vhi,{"data-testid":te("health-monitor-drawer-engagement-meeting-icon",String(_))}),s.jsx(Zui,{children:F.type==="email"?Ll.settings.notifications.mode.email:Dui.meeting})]}),s.jsx(Qhi,{className:"engagementDot"}),s.jsx(rhi,{children:F.scheduledAt?.utc(!0).local().format(Nui.visual.MMMDCommaYYYYformat)??eAe})]},`${Wi()}_${_}}`)})},_)):eAe}),style:{width:"100%"}})})]})]}),MXe(p?.companyHealthMetric,u?.companyHealthMetricLocalData)===!0||h===!1?s.jsx(ohi,{"data-testid":te("health-monitor-drawer-footer"),children:s.jsx(Gl,{style:{zIndex:2,paddingTop:o.sp3,paddingBottom:o.sp3},formId:rAe(iAe),primaryBtn:{label:Ll.save,style:{minWidth:112},isLoading:u?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:Ll.cancel,style:{minWidth:112},onClick:K}})}):null]})}const qui=(e,t)=>({[D0]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:lqe},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:cqe},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:pke},additionalChurnFactors:{selectedOptions:Qqe(e.additionalChurnFactors),allOptions:Uqe(t)}}}),Zui=i.div``,Jui=i.div``,Xui=i.div``,ehi=i.div``,thi=i.div``,ohi=i.div``,rhi=i.div`
92606
+ `,Bui=i(ke)``,{common:Ll,cockpit:{health:{detailPage:$a,common:{engagementTypes:Dui,labels:{lastEngagements:Pui,factorsThatDecreaseChurnProbability:Tui,factorsThatIncreaseChurnProbability:zui,contributingFactors:Rui,increaseChurnProbability:Fui,decreasingChurnProbability:Oui}}}},dateFormat:Nui}=W.getLocalizedStrings(),{to:Hui,from:_ui,cc:Vui,host:Uui,attendees:Qui,strings:{colon:$l,hyphen:eAe,comma:Wui,space:Gui},texts:{subject:tAe,addMore:Yui,select:Kui}}=Ll,{strings:{percentage:oAe}}=Ll,wS=(e,t)=>`${e}.${t}`,rAe=e=>`${e}_form`,D0="healthMonitorDetails",iAe="healthMonitorPage",nAe="netPromoterScore",aAe="customerSatisfactionScore",sAe="externalProductServiceExposure",lAe="additionalChurnFactors",Uqe=e=>[{label:zui,options:e.increasingChurnProbability.map(t=>({label:t.value,value:t.code}))},{label:Tui,options:e.decreasingChurnProbability.map(t=>({label:t.value,value:t.code}))}],Qqe=e=>e==null?[]:e.increasingChurnProbability.map(t=>t.code).concat(e.decreasingChurnProbability.map(t=>t.code));function Wfn({localData:e,companyHealthMetricViewSelector:t,additionalChurnFactorsOptions:r,analytics:n,urlSource:a,onCloseDrawer:l,onSaveChangesToLocalStore:c,onSaveClick:d}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:u}=t,[h,m]=g.useState(!1),f=Fqe(p),[x,y]=g.useState(!1),[b,w]=g.useState(!1),v=Oi({mode:"all",defaultValues:qui(e,r),reValidateMode:"onBlur"}),A=g.useRef(null);function S(F){p!=null&&n.trackCockpitHealthMonitorChurnFormClicked(F,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:oW(p.companyHealthMetric.subscriptionRenewalDate)??null,netPromoterScore:u?.companyHealthMetricLocalData.netPromoterScore??null,customerSatisfactionScore:u?.companyHealthMetricLocalData.customerSatisfactionScore??null,externalServicesExposure:u?.companyHealthMetricLocalData.externalProductServiceExposure??null,runwayMonths:_W(p.companyHealthMetric.runway)===!0?1e6:p.companyHealthMetric.runway===void 0?null:p.companyHealthMetric.runway.runwayMonths??null,dashBoardLastSeen:oW(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:oW(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const E=v.handleSubmit(()=>{S("Save"),A?.current&&A.current.scrollTo({top:0,behavior:"instant"}),y(!0),m(!0),d()}),I=async(F,_)=>{if(F!=null){const V={..._},O=V[D0][lAe].selectedOptions,z={netPromoterScore:V[D0][nAe]?.selectedOption,customerSatisfactionScore:V[D0][aAe]?.selectedOption,externalProductServiceExposure:V[D0][sAe]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(H=>O.indexOf(H.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(H=>O.indexOf(H.code)!=-1)}};c(z)}},L=g.useRef(null),B=g.useRef(null),[D,P]=g.useState(null),T=g.useRef(null),R=Qqe(e.additionalChurnFactors);g.useEffect(()=>(B.current=setTimeout(()=>{L.current&&(P(L.current),B.current&&clearTimeout(B.current))},10),()=>{B.current!=null&&clearTimeout(B.current)}),[R]),g.useEffect(()=>{const F=v.watch((_,{name:V})=>{V!=null&&_!=null&&Qa(()=>I(V,_))});return()=>{F.unsubscribe()}}),g.useEffect(()=>{if(p!=null){const F=p.controllers.map(_=>`${_.firstName} ${_.lastName}`);a||n.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,F,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function N(F){return F!=null?`${Ll.texts.churnProbability} ${Ll.texts.is} ${f.churnProbabilityPercentage}${oAe}`:`${Ll.texts.churnProbability} ${oAe}`}function K(){S("Cancel"),l()}const q={valueContainer:F=>({...F,padding:`2px ${o.sp3}`,overflow:"unset"}),multiValue:F=>({...F,margin:0})};return s.jsxs($hi,{ref:A,"data-testid":te("health-monitor-drawer"),children:[s.jsxs(bhi,{"data-testid":te("health-monitor-drawer-header"),children:[s.jsx(whi,{"data-testid":te("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${$a.heading}`}),s.jsx(nhi,{"data-testid":te("health-monitor-drawer-close-button"),onClick:K,children:s.jsx(ahi,{})})]}),s.jsxs(Ahi,{children:[t.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?s.jsx(Phi,{"data-testid":te("health-monitor-drawer-error"),children:s.jsxs(Thi,{children:[s.jsx(Rhi,{}),t.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?s.jsx(zhi,{"data-testid":te("health-monitor-drawer-error-text"),children:t.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,s.jsx(lhi,{"data-testid":te("health-monitor-drawer-churn-section"),children:u?.saveStatus?.fetchState==="In-Progress"?s.jsxs(shi,{"data-testid":te("health-monitor-drawer-churn-loader"),children:[s.jsx(Ao,{size:"ExtraLarge",start:!0}),s.jsx($i,{children:$a.calculatingProbability})]}):s.jsxs(vhi,{"data-testid":te("health-monitor-drawer-churn-box"),children:[s.jsx(Chi,{"data-testid":te("health-monitor-drawer-churn-heading"),children:N(f.churnProbabilityPercentage)}),s.jsx(Jui,{"data-testid":te("health-monitor-drawer-churn-meter"),children:s.jsx(zqe,{barHeight:32,percentage:f.churnProbabilityPercentage})}),s.jsx(chi,{"data-testid":te("health-monitor-drawer-churn-reasons"),children:p?.companyHealthMetric.churnProbabilityPercentage!=null&&p?.companyHealthMetric.churnProbabilityReason.length!==0?s.jsxs(s.Fragment,{children:[s.jsx(dhi,{"data-testid":te("health-monitor-drawer-churn-contributing-heading"),children:Rui}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?s.jsxs(dAe,{"data-testid":te("health-monitor-drawer-churn-increasing-factors"),children:[s.jsx(cAe,{children:`${Fui}${$l}`}),s.jsxs(uAe,{children:[p.companyHealthMetric.churnProbabilityReason.map((F,_)=>s.jsx(aW,{children:s.jsx(sW,{children:F.text})},`${Wi()}_${_}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((F,_)=>s.jsxs(aW,{children:[s.jsx(sW,{children:F.value}),s.jsx(pAe,{children:"Newly added"})]},`${Wi()}_${_}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?s.jsxs(dAe,{"data-testid":te("health-monitor-drawer-churn-decreasing-factors"),children:[s.jsx(cAe,{children:`${Oui}${$l}`}),s.jsx(uAe,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((F,_)=>s.jsxs(aW,{children:[s.jsx(sW,{children:F.value}),s.jsx(pAe,{children:"Newly added"})]},`${Wi()}_${_}}`))})]}):null,s.jsxs(hhi,{"data-testid":te("health-monitor-drawer-add-more-button"),onClick:()=>{Epo(T?.current,A?.current),setTimeout(()=>{w(!0)},500)},ref:T,children:[s.jsx(uhi,{}),s.jsx(phi,{children:Yui})]})]}):null})]})}),s.jsxs(Shi,{"data-testid":te("health-monitor-drawer-form-container"),children:[s.jsxs(mhi,{children:[s.jsxs(fhi,{children:[s.jsx(xhi,{"data-testid":te("health-monitor-drawer-manual-input-heading"),children:$a.manualInput.header}),s.jsx(Lt,{maxWidth:"250px",variant:"small-description",data:$a.tooltipTexts.manualInputText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-manual-input-info"),style:{marginTop:o.sp1,marginRight:o.sp0}})})]}),f.companyEngagementMetricsUpdatedAt!=null&&t.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?s.jsx(ghi,{"data-testid":te("health-monitor-drawer-last-updated"),children:f.updatedByUserName!=null?s.jsxs(hAe,{children:[`${Ll.texts.lastUpdatedBy}${$l} ${f.updatedByUserName}`,s.jsx(Yq,{}),`${f.companyEngagementMetricsUpdatedAt.date}${Wui}${Gui}${f.companyEngagementMetricsUpdatedAt.time}`]}):s.jsxs(hAe,{children:[`${Ll.texts.lastUpdated}${$l} ${f.companyEngagementMetricsUpdatedAt.date}`,s.jsx(Yq,{}),`${f.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),s.jsx(Fi,{...v,children:s.jsx("form",{id:rAe(iAe),onSubmit:E,children:s.jsxs(Ehi,{"data-testid":te("health-monitor-drawer-form-fields"),children:[s.jsx(Xui,{"data-testid":te("health-monitor-drawer-nps-field"),children:s.jsx(kye,{label:{label:`${Ll.texts.nps}${$l}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(F,_)=>({input:{textAlign:_.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:Ll.add,name:wS(D0,nAe),defaultValue:{allOptions:lqe,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(F,_)=>_.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:F!=null&&!!F.selectedOption}},style:{width:"auto"}})}),s.jsx(lW,{}),s.jsx(ehi,{"data-testid":te("health-monitor-drawer-csat-field"),children:s.jsx(kye,{label:{label:`${Ll.texts.csat}${$l}`,width:0,labelIcon:s.jsx(Lt,{maxWidth:"300px",variant:"small-description",data:$a.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-csat-info")})}),style:{marginRight:o.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(F,_)=>({input:{textAlign:_.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:Ll.add,name:wS(D0,aAe),defaultValue:{allOptions:cqe,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(F,_)=>_.healthMonitorDetails.netPromoterScore.selectedOption?!0:F!=null&&!!F.selectedOption}},style:{width:"auto"}})}),s.jsx(lW,{}),s.jsx(thi,{"data-testid":te("health-monitor-drawer-external-exposure-field"),children:s.jsx(RD,{label:{label:$a.manualInput.labels.externalProductServices,labelIcon:s.jsx(Lt,{maxWidth:"265px",variant:"small-description",data:$a.tooltipTexts.externalProductServicesText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:o.sp2}},singleSelectPickerField:{placeholder:Ll.add,name:wS(D0,sAe),defaultValue:{allOptions:pke,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:F=>F!=null&&!!F.selectedOption}},style:{width:"auto"}})}),s.jsx(lW,{}),s.jsxs(Lhi,{"data-testid":te("health-monitor-drawer-additional-factors"),additionalNotesHidden:R.length===0,isFocused:b,children:[s.jsx(FSr,{fullWidthSelect:!0,label:{label:`${$a.manualInput.labels.additionalContributingFactorsLabel}${$l}`,labelIcon:s.jsx(Lt,{maxWidth:"280px",variant:"small-description",data:$a.tooltipTexts.additionalContributingFactorsText,placement:"top",children:s.jsx(vS,{"data-testid":te("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:wS(D0,lAe),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Uqe(r),selectedOptions:R},placeholder:Kui,customStyleConfig:q,showSelectedInNewLines:!0},isMenuOpen:b,setIsMenuOpen:w,menuPortalEnabled:!0}),R.length!==0&&s.jsxs(jhi,{"data-testid":te("health-monitor-drawer-notes-composer"),children:[s.jsx(_hi,{}),s.jsx(Ihi,{ref:L,children:D&&Fn.createPortal(s.jsx(Epi,{roomId:`cockpit_${p?.companyInfo.companyId}`,threadMetadata:{application:"cockpit",companyId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",entityId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",companyName:p?.companyInfo.name!=null?p.companyInfo.name:"",tab:"healthMonitor",isGlobalComment:!1,entityType:"healthMonitor.notes",url:window.location.href},composerPlaceholder:$a.manualInput.placeholders.addANote,createThreadCallback:()=>{y(!1)},isSubmitComment:x}),D)})]})]})]})})})]}),s.jsxs(khi,{"data-testid":te("health-monitor-drawer-prefilled-section"),children:[s.jsx(yhi,{"data-testid":te("health-monitor-drawer-prefilled-heading"),children:$a.preFilledInput.header}),s.jsxs(Mhi,{"data-testid":te("health-monitor-drawer-runway"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.runway}),f.runway!=null?_W(f.runway)===!0?s.jsx(Dhi,{}):s.jsx(w6,{children:Rqe(f.runway.runwayMonths)}):s.jsx(w6,{children:$a.notApplicable})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-dashboard-last-seen"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.dashboardLastSeen}),s.jsx(w6,{children:f.dashboardLastVisit??$a.notApplicable})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-last-report-sent"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.lastReportSent}),s.jsx(w6,{children:f.lastReportSent??$a.notApplicable})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-product-services"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.zeniProductServices}),s.jsx(w6,{children:s.jsx(Hqe,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),s.jsxs(CS,{"data-testid":te("health-monitor-drawer-days-to-renewal"),children:[s.jsx(Zy,{children:$a.preFilledInput.labels.daysToRenewal}),s.jsx(w6,{children:f.renewalDate??$a.notApplicable})]}),s.jsx(Bhi,{"data-testid":te("health-monitor-drawer-last-engagements"),children:s.jsx(Tko,{label:{label:`${Pui}${$l}`},text:s.jsx(Fhi,{children:f.lastEngagements.length>0?f.lastEngagements.map((F,_)=>s.jsx(Ohi,{"data-testid":te("health-monitor-drawer-engagement",String(_)),children:s.jsx(Lt,{style:{padding:`12px ${o.sp3}`,color:k.heroDark},title:s.jsx(Hhi,{children:F.type==="email"?s.jsxs(mAe,{children:[s.jsxs($f,{children:[s.jsxs(kf,{children:[tAe,$l]}),s.jsx(Sf,{children:F.subject})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[_ui,$l]}),s.jsx(Sf,{children:F.from})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[Hui,$l]}),s.jsx(Sf,{children:F.to})]}),F.cc!=""?s.jsxs($f,{children:[s.jsxs(kf,{children:[Vui,$l]}),s.jsx(Sf,{children:F.cc})]}):null]}):s.jsxs(mAe,{children:[s.jsxs($f,{children:[s.jsxs(kf,{children:[tAe,$l]}),s.jsx(Sf,{children:F.subject})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[Uui,$l]}),s.jsx(Sf,{children:F.hostName})]}),s.jsxs($f,{children:[s.jsxs(kf,{children:[Qui,$l]}),s.jsx(Sf,{children:F.attendees})]})]})}),placement:"left",children:s.jsxs(Nhi,{children:[s.jsxs(ihi,{children:[F.type==="email"?s.jsx(Uhi,{"data-testid":te("health-monitor-drawer-engagement-email-icon",String(_))}):s.jsx(Vhi,{"data-testid":te("health-monitor-drawer-engagement-meeting-icon",String(_))}),s.jsx(Zui,{children:F.type==="email"?Ll.settings.notifications.mode.email:Dui.meeting})]}),s.jsx(Qhi,{className:"engagementDot"}),s.jsx(rhi,{children:F.scheduledAt?.utc(!0).local().format(Nui.visual.MMMDCommaYYYYformat)??eAe})]},`${Wi()}_${_}}`)})},_)):eAe}),style:{width:"100%"}})})]})]}),MXe(p?.companyHealthMetric,u?.companyHealthMetricLocalData)===!0||h===!1?s.jsx(ohi,{"data-testid":te("health-monitor-drawer-footer"),children:s.jsx(Gl,{style:{zIndex:2,paddingTop:o.sp3,paddingBottom:o.sp3},formId:rAe(iAe),primaryBtn:{label:Ll.save,style:{minWidth:112},isLoading:u?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:Ll.cancel,style:{minWidth:112},onClick:K}})}):null]})}const qui=(e,t)=>({[D0]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:lqe},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:cqe},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:pke},additionalChurnFactors:{selectedOptions:Qqe(e.additionalChurnFactors),allOptions:Uqe(t)}}}),Zui=i.div``,Jui=i.div``,Xui=i.div``,ehi=i.div``,thi=i.div``,ohi=i.div``,rhi=i.div`
92608
92607
  min-width: 100px;
92609
92608
  `,ihi=i.div`
92610
92609
  min-width: 80px;
@@ -93048,7 +93047,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
93048
93047
  margin-left: ${o.sp1};
93049
93048
  cursor: pointer;
93050
93049
  stroke: ${e=>e.theme.colors.primary};
93051
- `,{cockpit:{emptySearchTextSecondLine:$0i},common:{texts:{sorryWeCouldnTFindAnyResults:k0i}}}=W.getLocalizedStrings(),Yfn=({headerActions:e,headerData:t,healthPageData:r,healthPageActions:n,initialOpenThreadRequest:a})=>{const{healthView:l,managementView:c,mixpanelUrl:d}=r,{onColumnSortConfigChanged:p,onRowClick:u,onCockpitReloadData:h,onFiltersChange:m}=n,{filterText:f,filters:x}=l.uiState,y=c.fetchState==="Completed"&&l.fetchState==="Completed"&&l.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>E0i(l)),s.jsxs(L0i,{"data-testid":te("health-monitor-page"),children:[s.jsx(V2,{headerActions:{...e},headerData:{...t,allTabOptions:t.allTabOptions??n0,selectedTabOption:"healthMonitor",filterData:{filterText:f,filters:x},companiesLoaded:y}}),s.jsx(S0i,{healthView:l,initialOpenThreadRequest:a,managementView:c,mixpanelUrl:d,onClearFilter:()=>m({}),onColumnSortConfigChanged:p,onCockpitReloadData:h,onRowClick:u})]})},S0i=({healthView:e,initialOpenThreadRequest:t,managementView:r,mixpanelUrl:n,onClearFilter:a,onCockpitReloadData:l,onColumnSortConfigChanged:c,onRowClick:d})=>{const p=Me();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?s.jsx(j0i,{"data-testid":te("health-monitor-page-error"),children:s.jsx(P3,{selectedCockpitOption:"healthMonitor",onCockpitReloadData:l})}):r.fetchState==="In-Progress"||r.fetchState==="Not-Started"||e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?s.jsx(I0i,{"data-testid":te("health-monitor-page-loader"),children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?s.jsx(M0i,{"data-testid":te("health-monitor-page-empty-state"),children:s.jsx($p,{emptySearchTextFirstLine:k0i,emptySearchTextSecondLine:$0i,filtersApplied:!0,onClearFilter:a})}):s.jsx(B0i,{windowSize:p,"data-testid":te("health-monitor-page-table-wrapper"),children:s.jsx(p0i,{healthView:e,mixpanelUrl:n,onColumnSortConfigChanged:c,onRowClick:d,initialOpenThreadRequest:t})})},E0i=e=>{const t=e.zeniUsers.values,r=sqe,{companies:n}=e;return r.reduce((a,l)=>{switch(l.value){case"companyGroupId":if(n.length>0&&n[0].companyGroup!=null){const c=n[0].companyGroup.map(d=>{const p=d;return{label:p.name,value:p.id}});return{...a,[l.value]:c}}else return{...a,[l.value]:[]};case"verticalProductServices":return{...a,[l.value]:Xii};case"runway":return{...a,[l.value]:rni};case"churnProbabilityPercentage":return{...a,[l.value]:eni};case"netPromoterScore":return{...a,[l.value]:tni};case"customerSatisfactionScore":return{...a,[l.value]:oni};case"monthlyRecurringRevenue":return{...a,[l.value]:Foe};case"externalProductServiceExposure":case"controller":case"customerSuccessManager":{const c=t.map(d=>({label:d.firstName||d.lastName?`${d.firstName} ${d.lastName}`:d.email,value:d.userId,photo:d.photo,email:d.email}));return{...a,[l.value]:c}}default:return{...a,[l.value]:[]}}},{})},L0i=i.div`
93050
+ `,{cockpit:{emptySearchTextSecondLine:$0i},common:{texts:{sorryWeCouldnTFindAnyResults:k0i}}}=W.getLocalizedStrings(),Gfn=({headerActions:e,headerData:t,healthPageData:r,healthPageActions:n,initialOpenThreadRequest:a})=>{const{healthView:l,managementView:c,mixpanelUrl:d}=r,{onColumnSortConfigChanged:p,onRowClick:u,onCockpitReloadData:h,onFiltersChange:m}=n,{filterText:f,filters:x}=l.uiState,y=c.fetchState==="Completed"&&l.fetchState==="Completed"&&l.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>E0i(l)),s.jsxs(L0i,{"data-testid":te("health-monitor-page"),children:[s.jsx(V2,{headerActions:{...e},headerData:{...t,allTabOptions:t.allTabOptions??n0,selectedTabOption:"healthMonitor",filterData:{filterText:f,filters:x},companiesLoaded:y}}),s.jsx(S0i,{healthView:l,initialOpenThreadRequest:a,managementView:c,mixpanelUrl:d,onClearFilter:()=>m({}),onColumnSortConfigChanged:p,onCockpitReloadData:h,onRowClick:u})]})},S0i=({healthView:e,initialOpenThreadRequest:t,managementView:r,mixpanelUrl:n,onClearFilter:a,onCockpitReloadData:l,onColumnSortConfigChanged:c,onRowClick:d})=>{const p=Me();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?s.jsx(j0i,{"data-testid":te("health-monitor-page-error"),children:s.jsx(P3,{selectedCockpitOption:"healthMonitor",onCockpitReloadData:l})}):r.fetchState==="In-Progress"||r.fetchState==="Not-Started"||e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?s.jsx(I0i,{"data-testid":te("health-monitor-page-loader"),children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?s.jsx(M0i,{"data-testid":te("health-monitor-page-empty-state"),children:s.jsx($p,{emptySearchTextFirstLine:k0i,emptySearchTextSecondLine:$0i,filtersApplied:!0,onClearFilter:a})}):s.jsx(B0i,{windowSize:p,"data-testid":te("health-monitor-page-table-wrapper"),children:s.jsx(p0i,{healthView:e,mixpanelUrl:n,onColumnSortConfigChanged:c,onRowClick:d,initialOpenThreadRequest:t})})},E0i=e=>{const t=e.zeniUsers.values,r=sqe,{companies:n}=e;return r.reduce((a,l)=>{switch(l.value){case"companyGroupId":if(n.length>0&&n[0].companyGroup!=null){const c=n[0].companyGroup.map(d=>{const p=d;return{label:p.name,value:p.id}});return{...a,[l.value]:c}}else return{...a,[l.value]:[]};case"verticalProductServices":return{...a,[l.value]:Xii};case"runway":return{...a,[l.value]:rni};case"churnProbabilityPercentage":return{...a,[l.value]:eni};case"netPromoterScore":return{...a,[l.value]:tni};case"customerSatisfactionScore":return{...a,[l.value]:oni};case"monthlyRecurringRevenue":return{...a,[l.value]:Foe};case"externalProductServiceExposure":case"controller":case"customerSuccessManager":{const c=t.map(d=>({label:d.firstName||d.lastName?`${d.firstName} ${d.lastName}`:d.email,value:d.userId,photo:d.photo,email:d.email}));return{...a,[l.value]:c}}default:return{...a,[l.value]:[]}}},{})},L0i=i.div`
93052
93051
  height: calc(100vh - 45px);
93053
93052
  overflow-y: hidden;
93054
93053
  background-color: ${e=>e.theme.colors.grey4};
@@ -93348,7 +93347,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
93348
93347
  height: calc(100vh - 45px);
93349
93348
  overflow-y: hidden;
93350
93349
  background-color: ${e=>e.theme.colors.grey4};
93351
- `,Kfn=({headerData:e,headerActions:t,initialOpenThreadRequest:r,subscriptionPageActions:n,subscriptionPageData:a})=>{const{subscriptionView:l}=a,{onColumnSortConfigChanged:c,changeHandlers:d,onScroll:p,onCompanyNameClicked:u,onPassportIconClicked:h,onCockpitReloadData:m,onPlanOrAddOnClicked:f,onCollapseToggled:x,onFiltersChange:y}=n,b=l.uiState.filterText,w=l.uiState.filters,v=l.fetchState==="Completed"&&l.zeniUsers.fetchState==="Completed";return t.filterActions&&(t.filterActions.getCategoryWiseOptions=()=>Y2i(l)),s.jsxs(W2i,{children:[s.jsx(V2,{headerActions:{...t},headerData:{...e,filterData:{filters:w,filterText:b},companiesLoaded:v,allTabOptions:e.allTabOptions??n0,selectedTabOption:"subscription"}}),s.jsx(G2i,{initialOpenThreadRequest:r,isFilterApplied:w?.categories!=null,subscriptionView:l,changeHandlers:d,onClearFilter:()=>y("subscription",{}),onCockpitReloadData:m,onCollapseToggled:x,onColumnSortConfigChanged:c,onCompanyNameClicked:u,onPassportIconClicked:h,onPlanOrAddOnClicked:f,onScroll:p})]})},G2i=({subscriptionView:e,isFilterApplied:t,initialOpenThreadRequest:r,onColumnSortConfigChanged:n,onCollapseToggled:a,onCockpitReloadData:l,changeHandlers:c,onScroll:d,onPlanOrAddOnClicked:p,onCompanyNameClicked:u,onPassportIconClicked:h,onClearFilter:m})=>{const f=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:l,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?s.jsx(U2i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?t?s.jsx($p,{emptySearchTextFirstLine:_2i,emptySearchTextSecondLine:CAe,filtersApplied:!0,onClearFilter:m}):s.jsx($p,{emptySearchTextFirstLine:V2i,emptySearchTextSecondLine:CAe}):s.jsx(Q2i,{windowSize:f,children:s.jsx(H2i,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:c,onCollapseToggled:a,onColumnSortConfigChanged:n,onCompanyNameClicked:u,onPassportIconClicked:h,onPlanOrAddOnClicked:p,onScroll:d})})},Y2i=e=>{const t=e.zeniUsers.values,r=nqe,{companies:n}=e;return r.reduce((a,l)=>{switch(l.value){case"statusCode":return n.length===0?{...a,[l.value]:[]}:{...a,[l.value]:n[0].primarySubscription?.subscription.subscription.schema.status.map(c=>{const d=c;return{label:d.name,value:d.code}})};case"controllerUserIds":{if(n.length===0)return{...a,[l.value]:[]};const c=t.map(d=>({label:d.firstName||d.lastName?`${d.firstName} ${d.lastName}`:d.email,value:d.userId,photo:d.photo,email:d.email}));return{...a,[l.value]:c}}case"recommendedActionCode":return n.length===0?{...a,[l.value]:[]}:{...a,[l.value]:n[0].primarySubscription?.summary.schema.recommendedAction.map(c=>{const d=c;return{label:d.name,value:d.code}})};case"monthlyRecurringRevenue":return{...a,[l.value]:Foe};case"subscriptionPlans":return{...a,[l.value]:e.subscriptionPlans.map(c=>({label:c.name,value:c.subscriptionPlanId}))};case"subscriptionAddOns":return{...a,[l.value]:e.subscriptionAddOns.map(c=>({label:c.name,value:c.subscriptionAddOnId}))};case"avg2MonthExpenses":return{...a,[l.value]:Wii};case"slabLowerLimit":case"slabUpperLimit":return{...a,[l.value]:Gii};default:return{...a,[l.value]:[]}}},{})},K2i={width:new j(343,580,756)},{subscriptionUpdate:{updatePlan:{applyChanges:Am}},dateFormat:{visual:q2i}}=W.getLocalizedStrings();function Z2i({subscriptionUpdateData:e,subscriptionTermEndDate:t,isSubscriptionDetailsChanged:r,isDisabled:n,sectionId:a,style:l}){const c=Me(),d=t?.format(q2i.MMMDCommaYYYYformat),p=d?`${Am.nextRenewal} (${d})`:Am.nextRenewal;let u=e?.applyEndOfTerm===!0?"readonly":n;return r===!1&&(u="disabled"),s.jsxs(J2i,{style:l,children:[s.jsx(X2i,{children:Am.title}),s.jsxs(tmi,{children:[s.jsx(Cc,{isDisabled:n,label:{label:p},style:{padding:`${o.sp3} ${o.sp0}`},radioField:{name:uW(a,"changeType"),id:"applyEndOfTerm",value:"applyEndOfTerm"}}),s.jsx(Cc,{isDisabled:r===!1?"disabled":n,label:{label:Am.immediately},style:{paddingTop:o.sp3},radioField:{name:uW(a,"changeType"),id:"applyImmediately",value:"applyImmediately"}}),s.jsx(CNe,{isDisabled:u,label:{label:Am.applyProRated},checkBoxField:{name:uW(a,"shouldProrate"),defaultChecked:e?.shouldProrate===!0,style:{paddingLeft:o.sp4}}}),s.jsxs(emi,{size:c,isDisabled:r===!1?"disabled":n,children:[s.jsx(hW,{children:Am.proRatedDescription}),s.jsx(hW,{children:Am.proRatedText1}),s.jsx(hW,{children:Am.proRatedText2})]})]})]})}const uW=(e,t)=>`${e}.${t}`,J2i=i.div`
93350
+ `,Yfn=({headerData:e,headerActions:t,initialOpenThreadRequest:r,subscriptionPageActions:n,subscriptionPageData:a})=>{const{subscriptionView:l}=a,{onColumnSortConfigChanged:c,changeHandlers:d,onScroll:p,onCompanyNameClicked:u,onPassportIconClicked:h,onCockpitReloadData:m,onPlanOrAddOnClicked:f,onCollapseToggled:x,onFiltersChange:y}=n,b=l.uiState.filterText,w=l.uiState.filters,v=l.fetchState==="Completed"&&l.zeniUsers.fetchState==="Completed";return t.filterActions&&(t.filterActions.getCategoryWiseOptions=()=>Y2i(l)),s.jsxs(W2i,{children:[s.jsx(V2,{headerActions:{...t},headerData:{...e,filterData:{filters:w,filterText:b},companiesLoaded:v,allTabOptions:e.allTabOptions??n0,selectedTabOption:"subscription"}}),s.jsx(G2i,{initialOpenThreadRequest:r,isFilterApplied:w?.categories!=null,subscriptionView:l,changeHandlers:d,onClearFilter:()=>y("subscription",{}),onCockpitReloadData:m,onCollapseToggled:x,onColumnSortConfigChanged:c,onCompanyNameClicked:u,onPassportIconClicked:h,onPlanOrAddOnClicked:f,onScroll:p})]})},G2i=({subscriptionView:e,isFilterApplied:t,initialOpenThreadRequest:r,onColumnSortConfigChanged:n,onCollapseToggled:a,onCockpitReloadData:l,changeHandlers:c,onScroll:d,onPlanOrAddOnClicked:p,onCompanyNameClicked:u,onPassportIconClicked:h,onClearFilter:m})=>{const f=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:l,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?s.jsx(U2i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?t?s.jsx($p,{emptySearchTextFirstLine:_2i,emptySearchTextSecondLine:CAe,filtersApplied:!0,onClearFilter:m}):s.jsx($p,{emptySearchTextFirstLine:V2i,emptySearchTextSecondLine:CAe}):s.jsx(Q2i,{windowSize:f,children:s.jsx(H2i,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:c,onCollapseToggled:a,onColumnSortConfigChanged:n,onCompanyNameClicked:u,onPassportIconClicked:h,onPlanOrAddOnClicked:p,onScroll:d})})},Y2i=e=>{const t=e.zeniUsers.values,r=nqe,{companies:n}=e;return r.reduce((a,l)=>{switch(l.value){case"statusCode":return n.length===0?{...a,[l.value]:[]}:{...a,[l.value]:n[0].primarySubscription?.subscription.subscription.schema.status.map(c=>{const d=c;return{label:d.name,value:d.code}})};case"controllerUserIds":{if(n.length===0)return{...a,[l.value]:[]};const c=t.map(d=>({label:d.firstName||d.lastName?`${d.firstName} ${d.lastName}`:d.email,value:d.userId,photo:d.photo,email:d.email}));return{...a,[l.value]:c}}case"recommendedActionCode":return n.length===0?{...a,[l.value]:[]}:{...a,[l.value]:n[0].primarySubscription?.summary.schema.recommendedAction.map(c=>{const d=c;return{label:d.name,value:d.code}})};case"monthlyRecurringRevenue":return{...a,[l.value]:Foe};case"subscriptionPlans":return{...a,[l.value]:e.subscriptionPlans.map(c=>({label:c.name,value:c.subscriptionPlanId}))};case"subscriptionAddOns":return{...a,[l.value]:e.subscriptionAddOns.map(c=>({label:c.name,value:c.subscriptionAddOnId}))};case"avg2MonthExpenses":return{...a,[l.value]:Wii};case"slabLowerLimit":case"slabUpperLimit":return{...a,[l.value]:Gii};default:return{...a,[l.value]:[]}}},{})},K2i={width:new j(343,580,756)},{subscriptionUpdate:{updatePlan:{applyChanges:Am}},dateFormat:{visual:q2i}}=W.getLocalizedStrings();function Z2i({subscriptionUpdateData:e,subscriptionTermEndDate:t,isSubscriptionDetailsChanged:r,isDisabled:n,sectionId:a,style:l}){const c=Me(),d=t?.format(q2i.MMMDCommaYYYYformat),p=d?`${Am.nextRenewal} (${d})`:Am.nextRenewal;let u=e?.applyEndOfTerm===!0?"readonly":n;return r===!1&&(u="disabled"),s.jsxs(J2i,{style:l,children:[s.jsx(X2i,{children:Am.title}),s.jsxs(tmi,{children:[s.jsx(Cc,{isDisabled:n,label:{label:p},style:{padding:`${o.sp3} ${o.sp0}`},radioField:{name:uW(a,"changeType"),id:"applyEndOfTerm",value:"applyEndOfTerm"}}),s.jsx(Cc,{isDisabled:r===!1?"disabled":n,label:{label:Am.immediately},style:{paddingTop:o.sp3},radioField:{name:uW(a,"changeType"),id:"applyImmediately",value:"applyImmediately"}}),s.jsx(CNe,{isDisabled:u,label:{label:Am.applyProRated},checkBoxField:{name:uW(a,"shouldProrate"),defaultChecked:e?.shouldProrate===!0,style:{paddingLeft:o.sp4}}}),s.jsxs(emi,{size:c,isDisabled:r===!1?"disabled":n,children:[s.jsx(hW,{children:Am.proRatedDescription}),s.jsx(hW,{children:Am.proRatedText1}),s.jsx(hW,{children:Am.proRatedText2})]})]})]})}const uW=(e,t)=>`${e}.${t}`,J2i=i.div`
93352
93351
  display: flex;
93353
93352
  flex-direction: column;
93354
93353
  `,X2i=i(ri)`
@@ -93733,7 +93732,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
93733
93732
  background-color: ${e=>e.theme.colors.grey3};
93734
93733
  min-height: 1px;
93735
93734
  max-height: 1px;
93736
- `,nx=(e,t)=>{const{groups:r}=rZe.dropDowns,n=[];return t!=null&&n.push({label:r.recommendedPlan,options:e.filter(a=>a.subscriptionPlanId===t).map(a=>({label:a.name,value:a.subscriptionPlanId}))}),n.push({label:r.allPlans,options:e.filter(a=>a.subscriptionPlanId!==t).map(a=>({label:a.name,value:a.subscriptionPlanId}))}),n},nj=(e,t)=>e==null?void 0:`${(Bt("0,0.00",e)+" "+ogi(t)).trim()}`,ogi=e=>{if(e==null)return"";const{count:t,unit:r}=e;return t===1?`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))}`:`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))} x ${t}`},{common:aj}=W.getLocalizedStrings(),{texts:{review:rgi}}=aj,igi=aj.texts.updatePlan,$Ae="subscriptionUpdatePlanPage",sj="updatePlan",e4="applyChanges";function qfn(e){const t=Me(),r=lt(),{localData:n,isDisabled:a,onSubscriptionDetailsChanged:l,onEstimateSuccess:c,onReviewClick:d,onBackClick:p,onResetClick:u}=e,[h,m]=g.useState(void 0),f=g.useRef(null),{data:x,subscriptionDetail:y,fetchState:b,estimateStatus:w}=n,v=wi(w.fetchState),A=wi(b),S=Oi({mode:"all",reValidateMode:"onChange",defaultValues:g.useMemo(()=>SAe(n),[n])});g.useEffect(()=>()=>{m(void 0)},[]),g.useEffect(()=>{A==="In-Progress"&&b==="Completed"&&S.reset(SAe(n))},[A,b,S,n]),g.useEffect(()=>{v==="In-Progress"&&(w.fetchState==="Error"?h!==w.fetchState&&m(w.fetchState):w.fetchState==="Completed"&&(m(void 0),c()))},[h,v,w.fetchState,c]);const E=async(N,K)=>{if(N.includes(sj)||N.includes(e4)){if(N.includes(e4)){const{applyChanges:q}=K,{changeType:F,shouldProrate:_}=q;F==="applyImmediately"&&x?.applyEndOfTerm===!0&&_===!1?S.setValue(e4,{...q,shouldProrate:!0},{shouldDirty:!0}):F==="applyEndOfTerm"&&x?.applyEndOfTerm===!1&&_===!0&&S.setValue(e4,{...q,shouldProrate:!1},{shouldDirty:!0})}l(K)}};g.useEffect(()=>{const N=S.watch((K,{name:q})=>{q!=null&&K!=null&&Qa(()=>E(q,K))});return()=>{N.unsubscribe()}});const I=S.handleSubmit(N=>{h!=null&&m(void 0),d()}),L=()=>P?.status.code!=="future"?s.jsx(Z2i,{sectionId:e4,style:{paddingBottom:o.sp9},subscriptionUpdateData:x,subscriptionTermEndDate:P?.currentTerm?.end,isSubscriptionDetailsChanged:iZe(n),isDisabled:a}):null,B={review:rgi},D=y?.summary?.summary,P=y?.subscription.subscription,T=y?.plan?.plan.subscriptionPlanId,R=D?.recommendedSubscriptionPlanId!=null&&T===D?.primarySubscriptionPlanId?D?.recommendedSubscriptionPlanId:void 0;return s.jsxs(ngi,{children:[s.jsx(Mh,{title:igi,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:p,scrollableContent:f,source:"SubscriptionUpdatePlanPage"}),h!=null?s.jsx($P,{fetchState:h,customMessageText:w.error?.message??aj.errorMessage.somethingWentWrongPleaseTryAgain,onRemoveSnackbar:()=>m(void 0)}):null,s.jsx(sgi,{ref:f,windowSize:t,children:b==="In-Progress"||b==="Not-Started"?s.jsx(agi,{children:s.jsx(Ao,{size:"Large",start:!0})}):s.jsx(Fi,{...S,children:s.jsxs("form",{id:kAe($Ae),onSubmit:I,children:[s.jsx(Xmi,{sectionId:sj,subscriptionUpdateData:x,recommendedSubscriptionPlanId:R,subscriptionMetaDetails:ax(n),isDisabled:a}),s.jsx(L,{})]})})}),nv(S.formState.dirtyFields)||lgi(n)?s.jsx(Gl,{formId:kAe($Ae),primaryBtn:{label:B.review,isLoading:w.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&w.fetchState!=="In-Progress"},cancelBtn:{label:aj.cancel,shouldResetOnCancel:!0,onClick:()=>{S.reset(cgi(n)),y!=null&&u(y)}}}):null]})}const ngi=i.div`
93735
+ `,nx=(e,t)=>{const{groups:r}=rZe.dropDowns,n=[];return t!=null&&n.push({label:r.recommendedPlan,options:e.filter(a=>a.subscriptionPlanId===t).map(a=>({label:a.name,value:a.subscriptionPlanId}))}),n.push({label:r.allPlans,options:e.filter(a=>a.subscriptionPlanId!==t).map(a=>({label:a.name,value:a.subscriptionPlanId}))}),n},nj=(e,t)=>e==null?void 0:`${(Bt("0,0.00",e)+" "+ogi(t)).trim()}`,ogi=e=>{if(e==null)return"";const{count:t,unit:r}=e;return t===1?`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))}`:`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))} x ${t}`},{common:aj}=W.getLocalizedStrings(),{texts:{review:rgi}}=aj,igi=aj.texts.updatePlan,$Ae="subscriptionUpdatePlanPage",sj="updatePlan",e4="applyChanges";function Kfn(e){const t=Me(),r=lt(),{localData:n,isDisabled:a,onSubscriptionDetailsChanged:l,onEstimateSuccess:c,onReviewClick:d,onBackClick:p,onResetClick:u}=e,[h,m]=g.useState(void 0),f=g.useRef(null),{data:x,subscriptionDetail:y,fetchState:b,estimateStatus:w}=n,v=wi(w.fetchState),A=wi(b),S=Oi({mode:"all",reValidateMode:"onChange",defaultValues:g.useMemo(()=>SAe(n),[n])});g.useEffect(()=>()=>{m(void 0)},[]),g.useEffect(()=>{A==="In-Progress"&&b==="Completed"&&S.reset(SAe(n))},[A,b,S,n]),g.useEffect(()=>{v==="In-Progress"&&(w.fetchState==="Error"?h!==w.fetchState&&m(w.fetchState):w.fetchState==="Completed"&&(m(void 0),c()))},[h,v,w.fetchState,c]);const E=async(N,K)=>{if(N.includes(sj)||N.includes(e4)){if(N.includes(e4)){const{applyChanges:q}=K,{changeType:F,shouldProrate:_}=q;F==="applyImmediately"&&x?.applyEndOfTerm===!0&&_===!1?S.setValue(e4,{...q,shouldProrate:!0},{shouldDirty:!0}):F==="applyEndOfTerm"&&x?.applyEndOfTerm===!1&&_===!0&&S.setValue(e4,{...q,shouldProrate:!1},{shouldDirty:!0})}l(K)}};g.useEffect(()=>{const N=S.watch((K,{name:q})=>{q!=null&&K!=null&&Qa(()=>E(q,K))});return()=>{N.unsubscribe()}});const I=S.handleSubmit(N=>{h!=null&&m(void 0),d()}),L=()=>P?.status.code!=="future"?s.jsx(Z2i,{sectionId:e4,style:{paddingBottom:o.sp9},subscriptionUpdateData:x,subscriptionTermEndDate:P?.currentTerm?.end,isSubscriptionDetailsChanged:iZe(n),isDisabled:a}):null,B={review:rgi},D=y?.summary?.summary,P=y?.subscription.subscription,T=y?.plan?.plan.subscriptionPlanId,R=D?.recommendedSubscriptionPlanId!=null&&T===D?.primarySubscriptionPlanId?D?.recommendedSubscriptionPlanId:void 0;return s.jsxs(ngi,{children:[s.jsx(Mh,{title:igi,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:p,scrollableContent:f,source:"SubscriptionUpdatePlanPage"}),h!=null?s.jsx($P,{fetchState:h,customMessageText:w.error?.message??aj.errorMessage.somethingWentWrongPleaseTryAgain,onRemoveSnackbar:()=>m(void 0)}):null,s.jsx(sgi,{ref:f,windowSize:t,children:b==="In-Progress"||b==="Not-Started"?s.jsx(agi,{children:s.jsx(Ao,{size:"Large",start:!0})}):s.jsx(Fi,{...S,children:s.jsxs("form",{id:kAe($Ae),onSubmit:I,children:[s.jsx(Xmi,{sectionId:sj,subscriptionUpdateData:x,recommendedSubscriptionPlanId:R,subscriptionMetaDetails:ax(n),isDisabled:a}),s.jsx(L,{})]})})}),nv(S.formState.dirtyFields)||lgi(n)?s.jsx(Gl,{formId:kAe($Ae),primaryBtn:{label:B.review,isLoading:w.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&w.fetchState!=="In-Progress"},cancelBtn:{label:aj.cancel,shouldResetOnCancel:!0,onClick:()=>{S.reset(cgi(n)),y!=null&&u(y)}}}):null]})}const ngi=i.div`
93737
93736
  display: flex;
93738
93737
  min-height: 100%;
93739
93738
  flex-direction: column;
@@ -93791,7 +93790,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
93791
93790
  `,kgi=i.div`
93792
93791
  display: flex;
93793
93792
  flex-direction: column;
93794
- `,{common:lj}=W.getLocalizedStrings(),{texts:{review:Sgi}}=lj,Egi=lj.texts.addPlan,EAe="subscriptionAddPlanPage",cj="addPlan",dj="invoiceOption";function Zfn(e){const t=Me(),r=lt(),n=g.useRef(null),{localData:a,isDisabled:l,onSubscriptionDetailsChanged:c,onEstimateSuccess:d,onReviewClick:p,onBackClick:u,onResetClick:h}=e,[m,f]=g.useState(void 0),{data:x,fetchState:y,estimateStatus:b}=a,w=wi(b.fetchState),v=wi(y),A=Oi({mode:"all",reValidateMode:"onChange",defaultValues:g.useMemo(()=>IAe(a),[a])});g.useEffect(()=>()=>{f(void 0)},[]),g.useEffect(()=>{v==="In-Progress"&&y==="Completed"&&A.reset(IAe(a))},[v,y,A,a]),g.useEffect(()=>{w==="In-Progress"&&(b.fetchState==="Error"?m!==b.fetchState&&f(b.fetchState):b.fetchState==="Completed"&&(f(void 0),d()))},[m,w,b.fetchState,d]);const S=async(L,B)=>{(L.includes(cj)||L.includes(dj))&&c(B)};g.useEffect(()=>{const L=A.watch((B,{name:D})=>{D!=null&&B!=null&&Qa(()=>S(D,B))});return()=>{L.unsubscribe()}});const E=A.handleSubmit(L=>{m!=null&&f(void 0),p()}),I={review:Sgi};return s.jsxs(Lgi,{children:[s.jsx(Mh,{title:Egi,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:u,scrollableContent:n,source:"SubscriptionAddPlanPage"}),m!=null?s.jsx($P,{fetchState:m,customMessageText:b.error?.message??lj.errorMessage.somethingWentWrongPleaseTryAgain,onRemoveSnackbar:()=>f(void 0)}):null,s.jsx(jgi,{ref:n,windowSize:t,children:y==="In-Progress"||y==="Not-Started"?s.jsx(Igi,{children:s.jsx(Ao,{size:"Large",start:!0})}):s.jsx(Fi,{...A,children:s.jsxs("form",{id:LAe(EAe),onSubmit:E,children:[s.jsx(ugi,{sectionId:cj,subscriptionCreateData:x,subscriptionMetaDetails:ax(a),isDisabled:l}),s.jsx(bgi,{sectionId:dj,style:{paddingBottom:o.sp9},subscriptionCreateData:x,isDisabled:l})]})})}),nv(A.formState.dirtyFields)||Mgi(a)?s.jsx(Gl,{formId:LAe(EAe),primaryBtn:{label:I.review,isLoading:b.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&b.fetchState!=="In-Progress"},cancelBtn:{label:lj.cancel,shouldResetOnCancel:!0,onClick:()=>{A.reset(Bgi(a)),h()}}}):null]})}const Lgi=i.div`
93793
+ `,{common:lj}=W.getLocalizedStrings(),{texts:{review:Sgi}}=lj,Egi=lj.texts.addPlan,EAe="subscriptionAddPlanPage",cj="addPlan",dj="invoiceOption";function qfn(e){const t=Me(),r=lt(),n=g.useRef(null),{localData:a,isDisabled:l,onSubscriptionDetailsChanged:c,onEstimateSuccess:d,onReviewClick:p,onBackClick:u,onResetClick:h}=e,[m,f]=g.useState(void 0),{data:x,fetchState:y,estimateStatus:b}=a,w=wi(b.fetchState),v=wi(y),A=Oi({mode:"all",reValidateMode:"onChange",defaultValues:g.useMemo(()=>IAe(a),[a])});g.useEffect(()=>()=>{f(void 0)},[]),g.useEffect(()=>{v==="In-Progress"&&y==="Completed"&&A.reset(IAe(a))},[v,y,A,a]),g.useEffect(()=>{w==="In-Progress"&&(b.fetchState==="Error"?m!==b.fetchState&&f(b.fetchState):b.fetchState==="Completed"&&(f(void 0),d()))},[m,w,b.fetchState,d]);const S=async(L,B)=>{(L.includes(cj)||L.includes(dj))&&c(B)};g.useEffect(()=>{const L=A.watch((B,{name:D})=>{D!=null&&B!=null&&Qa(()=>S(D,B))});return()=>{L.unsubscribe()}});const E=A.handleSubmit(L=>{m!=null&&f(void 0),p()}),I={review:Sgi};return s.jsxs(Lgi,{children:[s.jsx(Mh,{title:Egi,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:u,scrollableContent:n,source:"SubscriptionAddPlanPage"}),m!=null?s.jsx($P,{fetchState:m,customMessageText:b.error?.message??lj.errorMessage.somethingWentWrongPleaseTryAgain,onRemoveSnackbar:()=>f(void 0)}):null,s.jsx(jgi,{ref:n,windowSize:t,children:y==="In-Progress"||y==="Not-Started"?s.jsx(Igi,{children:s.jsx(Ao,{size:"Large",start:!0})}):s.jsx(Fi,{...A,children:s.jsxs("form",{id:LAe(EAe),onSubmit:E,children:[s.jsx(ugi,{sectionId:cj,subscriptionCreateData:x,subscriptionMetaDetails:ax(a),isDisabled:l}),s.jsx(bgi,{sectionId:dj,style:{paddingBottom:o.sp9},subscriptionCreateData:x,isDisabled:l})]})})}),nv(A.formState.dirtyFields)||Mgi(a)?s.jsx(Gl,{formId:LAe(EAe),primaryBtn:{label:I.review,isLoading:b.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&b.fetchState!=="In-Progress"},cancelBtn:{label:lj.cancel,shouldResetOnCancel:!0,onClick:()=>{A.reset(Bgi(a)),h()}}}):null]})}const Lgi=i.div`
93795
93794
  display: flex;
93796
93795
  min-height: 100%;
93797
93796
  flex-direction: column;
@@ -94050,7 +94049,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
94050
94049
  height: calc(100vh - 45px);
94051
94050
  overflow-y: hidden;
94052
94051
  background-color: ${e=>e.theme.colors.grey4};
94053
- `,Jfn=({headerData:e,headerActions:t,portfolioPageActions:r,portfolioPageData:n,initialOpenThreadRequest:a})=>{const{portfolioView:l}=n,{onColumnSortConfigChanged:c,onCompanyNameClicked:d,onPassportIconClicked:p,onScroll:u,onFiltersChange:h,onCockpitReloadData:m}=r,f=l.uiState.filterText,x=l.uiState.filters,y=l.fetchState==="Completed";return t.filterActions&&(t.filterActions.getCategoryWiseOptions=()=>z3i()),s.jsxs(P3i,{children:[s.jsx(V2,{headerActions:{...t},headerData:{...e,filterData:{filterText:f,filters:x},companiesLoaded:y,selectedTabOption:"portfolio",allTabOptions:e.allTabOptions??n0}}),s.jsx(T3i,{portfolioView:l,onColumnSortConfigChanged:c,onScroll:u,onCockpitReloadData:m,isFilterApplied:x?.categories!=null,onCompanyNameClicked:d,onPassportIconClicked:p,onClearFilter:()=>h("portfolio",{}),initialOpenThreadRequest:a})]})},T3i=({portfolioView:e,isFilterApplied:t,onColumnSortConfigChanged:r,onCompanyNameClicked:n,onPassportIconClicked:a,onCockpitReloadData:l,onScroll:c,onClearFilter:d,initialOpenThreadRequest:p})=>{const u=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:l,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?s.jsx(B3i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?t?s.jsx($p,{emptySearchTextFirstLine:j3i,emptySearchTextSecondLine:jAe,filtersApplied:!0,onClearFilter:d}):s.jsx($p,{emptySearchTextFirstLine:M3i,emptySearchTextSecondLine:jAe}):s.jsx(D3i,{windowSize:u,children:s.jsx(A3i,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:c,onCompanyNameClicked:n,onPassportIconClicked:a,initialOpenThreadRequest:p})})},z3i=()=>aqe.reduce((e,t)=>{switch(t.value){case"netBurnOrIncome":return{...e,[t.value]:Yii};case"cashPosition":return{...e,[t.value]:Kii};case"expenses":return{...e,[t.value]:qii};case"income":return{...e,[t.value]:Zii};case"runway":return{...e,[t.value]:Jii};default:return{...e,[t.value]:[]}}},{}),{common:ES,dateFormat:R3i,aiAccountantCustomer:F3i}=W.getLocalizedStrings(),Yoe=({operationType:e,onCancel:t,onConfirm:r,dialogTitle:n,dialogDescription:a})=>{const l=lt(),[c,d]=g.useState(""),[p,u]=g.useState(""),h=e==="offboard",m=h||c.length>0&&p.length>0,f=e.replaceAll("_"," "),x=xr(new Date().toISOString()).format(R3i.analytics.YYYYDashMMDashDDFormat),y=n??`${F3i.jobTriggerDialog.title} — ${f}`;return s.jsx(Qs,{titleComponent:s.jsx(Vs,{children:y}),descriptionComponent:a!=null?s.jsx(Us,{children:a}):void 0,primaryButtonText:ES.confirm,secondaryButtonText:ES.cancel,useLegacyStyles:!0,isProceedDisabled:!m,action:{onOkClick:()=>{m&&r(e,c,p)},onCancelClick:t,onClickAway:t},shouldClickAway:!0,style:{background:l.colors.overlayColor},children:!h&&s.jsxs(O3i,{children:[s.jsxs(MAe,{children:[s.jsx(BAe,{children:ES.texts.startDate}),s.jsx(DAe,{type:"date",value:c,max:p.length>0?p:x,onChange:b=>d(b.target.value)})]}),s.jsxs(MAe,{children:[s.jsx(BAe,{children:ES.texts.endDate}),s.jsx(DAe,{type:"date",value:p,min:c.length>0?c:void 0,max:x,onChange:b=>u(b.target.value)})]})]})})},O3i=i.div`
94052
+ `,Zfn=({headerData:e,headerActions:t,portfolioPageActions:r,portfolioPageData:n,initialOpenThreadRequest:a})=>{const{portfolioView:l}=n,{onColumnSortConfigChanged:c,onCompanyNameClicked:d,onPassportIconClicked:p,onScroll:u,onFiltersChange:h,onCockpitReloadData:m}=r,f=l.uiState.filterText,x=l.uiState.filters,y=l.fetchState==="Completed";return t.filterActions&&(t.filterActions.getCategoryWiseOptions=()=>z3i()),s.jsxs(P3i,{children:[s.jsx(V2,{headerActions:{...t},headerData:{...e,filterData:{filterText:f,filters:x},companiesLoaded:y,selectedTabOption:"portfolio",allTabOptions:e.allTabOptions??n0}}),s.jsx(T3i,{portfolioView:l,onColumnSortConfigChanged:c,onScroll:u,onCockpitReloadData:m,isFilterApplied:x?.categories!=null,onCompanyNameClicked:d,onPassportIconClicked:p,onClearFilter:()=>h("portfolio",{}),initialOpenThreadRequest:a})]})},T3i=({portfolioView:e,isFilterApplied:t,onColumnSortConfigChanged:r,onCompanyNameClicked:n,onPassportIconClicked:a,onCockpitReloadData:l,onScroll:c,onClearFilter:d,initialOpenThreadRequest:p})=>{const u=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:l,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?s.jsx(B3i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?t?s.jsx($p,{emptySearchTextFirstLine:j3i,emptySearchTextSecondLine:jAe,filtersApplied:!0,onClearFilter:d}):s.jsx($p,{emptySearchTextFirstLine:M3i,emptySearchTextSecondLine:jAe}):s.jsx(D3i,{windowSize:u,children:s.jsx(A3i,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:c,onCompanyNameClicked:n,onPassportIconClicked:a,initialOpenThreadRequest:p})})},z3i=()=>aqe.reduce((e,t)=>{switch(t.value){case"netBurnOrIncome":return{...e,[t.value]:Yii};case"cashPosition":return{...e,[t.value]:Kii};case"expenses":return{...e,[t.value]:qii};case"income":return{...e,[t.value]:Zii};case"runway":return{...e,[t.value]:Jii};default:return{...e,[t.value]:[]}}},{}),{common:ES,dateFormat:R3i,aiAccountantCustomer:F3i}=W.getLocalizedStrings(),Yoe=({operationType:e,onCancel:t,onConfirm:r,dialogTitle:n,dialogDescription:a})=>{const l=lt(),[c,d]=g.useState(""),[p,u]=g.useState(""),h=e==="offboard",m=h||c.length>0&&p.length>0,f=e.replaceAll("_"," "),x=xr(new Date().toISOString()).format(R3i.analytics.YYYYDashMMDashDDFormat),y=n??`${F3i.jobTriggerDialog.title} — ${f}`;return s.jsx(Qs,{titleComponent:s.jsx(Vs,{children:y}),descriptionComponent:a!=null?s.jsx(Us,{children:a}):void 0,primaryButtonText:ES.confirm,secondaryButtonText:ES.cancel,useLegacyStyles:!0,isProceedDisabled:!m,action:{onOkClick:()=>{m&&r(e,c,p)},onCancelClick:t,onClickAway:t},shouldClickAway:!0,style:{background:l.colors.overlayColor},children:!h&&s.jsxs(O3i,{children:[s.jsxs(MAe,{children:[s.jsx(BAe,{children:ES.texts.startDate}),s.jsx(DAe,{type:"date",value:c,max:p.length>0?p:x,onChange:b=>d(b.target.value)})]}),s.jsxs(MAe,{children:[s.jsx(BAe,{children:ES.texts.endDate}),s.jsx(DAe,{type:"date",value:p,min:c.length>0?c:void 0,max:x,onChange:b=>u(b.target.value)})]})]})})},O3i=i.div`
94054
94053
  display: flex;
94055
94054
  flex-direction: column;
94056
94055
  gap: ${o.sp3};
@@ -94073,7 +94072,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
94073
94072
  outline: none;
94074
94073
  border-color: ${e=>e.theme.colors.primary};
94075
94074
  }
94076
- `,{aiAccountantCustomer:qq,common:{failed:N3i,oauthConsent:{company:H3i},status:{pending:_3i},texts:{lastSync:V3i,lastTraining:U3i,live:Q3i,offboarded:W3i,onboarding:G3i,status:Y3i}}}=W.getLocalizedStrings(),lr={rowHeightPx:C[8],headerHeightPx:44,jobRowHeightPx:44,jobHeaderHeightPx:36,jobTableMinHeightPx:200,jobOperationMinWidthPx:120,jobStatusColumnWidthPx:90,jobDateColumnWidthPx:120,jobByColumnWidthPx:100,jobSkeletonRowCount:3,skeletonLoaderHeightPx:14,accuracyLabelMinWidthPx:80,accuracyValueMinWidthPx:45,accuracySuccessThresholdPercent:80,accuracyAlertThresholdPercent:60,sortIconSize:o.sp2,menuIconSize:o.sp3,statusBadgeVerticalPadding:"2px",accuracyBarHeight:o.sp2,globalNavBarHeightPx:45,pageHeaderHeightPx:75,menuDropdownMinWidthPx:160,checkboxColumnWidthPx:40},Wd={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},K3i=[{key:"companyName",label:H3i,sortable:!0,width:Wd.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:Y3i,sortable:!0,width:Wd.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:qq.table.bookClose,sortable:!0,width:Wd.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:U3i,sortable:!0,width:Wd.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:V3i,sortable:!0,width:Wd.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:qq.table.accuracy,sortable:!0,width:Wd.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:Wd.actions,justifyContent:"center"}],Koe={onboard:{labelKey:"onboard",destructive:!1},evaluate:{labelKey:"evaluate",destructive:!1},full_pipeline:{labelKey:"fullPipeline",destructive:!1},retrain:{labelKey:"retrain",destructive:!1},offboard:{labelKey:"offboard",destructive:!0},cancel_onboarding:{labelKey:"cancelOnboarding",destructive:!0}},cZe=(e,t)=>{const{jobTriggerDialog:r}=qq;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",t):r.singleDescription.replace("__companyName__",t).replace("__datesInstruction__",r.datesInstruction)},qoe=e=>EXe(e).map(t=>({operationType:t,...Koe[t]})),dZe=e=>({active:Q3i,pending:_3i,onboarding:G3i,offboarded:W3i,failed:N3i})[e]??e;function Zoe(){const{useDynamicConfig:e}=wD(),{configValue:t}=e(DFe.aiAccountantOnboardingConfig),r=ii().loggedInUser;return t==null||r?.userId==null?!1:Array.isArray(t.user_list_with_write_access)&&t.user_list_with_write_access.includes(r.userId)}const{common:{strings:N6,texts:{actions:q3i,by:Z3i,created:J3i,lastSync:X3i,lastTraining:efi,offboarded:tfi,status:PAe}},dateFormat:vE,timeFormat:Wb,aiAccountantCustomer:S0}=W.getLocalizedStrings(),Xfn=({customer:e,hasMoreJobs:t,jobs:r,jobsFetchStatus:n,onAction:a,onCancelOnboarding:l,onClose:c,onLoadMoreJobs:d})=>{const[p,u]=g.useState(null),h=Zoe(),m=e.enrollment?.status??"unknown",f=e.enrollment,x=f?.accuracy??{},y=n.fetchState==="In-Progress",b=S=>{u({operationType:S})},w=(S,E,I)=>{a(e,S,E,I),u(null)},v=S=>S<r.length,A=()=>{t&&!y&&d()};return s.jsxs(s.Fragment,{children:[s.jsxs(nfi,{children:[s.jsx(afi,{children:s.jsxs(sfi,{children:[s.jsx(lfi,{}),s.jsxs(cfi,{children:[s.jsx(dfi,{children:e.companyName}),s.jsx(pfi,{children:e.tenantId})]}),s.jsx(ufi,{onClick:c,children:s.jsx(hfi,{})})]})}),s.jsxs(mfi,{children:[s.jsxs(CW,{children:[s.jsx(LS,{children:S0.drawer.enrollmentDetails}),s.jsxs(ffi,{children:[s.jsxs(tb,{children:[s.jsx(ob,{children:PAe}),s.jsx(rb,{children:dZe(m)})]}),s.jsxs(tb,{children:[s.jsx(ob,{children:S0.drawer.onboarded}),s.jsx(rb,{title:f?.onboardedAt!=null?f.onboardedAt.format(Wb.hmmADashDDMMMCommaYYYY):void 0,children:f?.onboardedAt!=null?f.onboardedAt.format(vE.visual.MMMDCommaYYYYformat):N6.emDash})]}),s.jsxs(tb,{children:[s.jsx(ob,{children:efi}),s.jsx(rb,{title:f?.latestTraining!=null?f.latestTraining.format(Wb.hmmADashDDMMMCommaYYYY):void 0,children:f?.latestTraining!=null?f.latestTraining.format(vE.visual.MMMDCommaYYYYformat):N6.emDash})]}),s.jsxs(tb,{children:[s.jsx(ob,{children:X3i}),s.jsx(rb,{title:f?.latestTransactionSync!=null?f.latestTransactionSync.local().format(Wb.hmmADashDDMMMCommaYYYY):void 0,children:f?.latestTransactionSync!=null?f.latestTransactionSync.utc(!0).fromNow():N6.emDash})]}),f?.offboardedAt!=null&&s.jsxs(tb,{children:[s.jsx(ob,{children:tfi}),s.jsx(rb,{title:f.offboardedAt.format(Wb.hmmADashDDMMMCommaYYYY),children:f.offboardedAt.format(vE.visual.MMMDCommaYYYYformat)})]})]})]}),s.jsxs(CW,{children:[s.jsx(LS,{children:S0.drawer.modelAccuracy}),Object.keys(x).length>0?s.jsx(xfi,{children:Object.entries(x).map(([S,E])=>{const I=E*100,L=rfi(I),B=`${I.toFixed(0)}${N6.percentage}`,D=`${I.toFixed(1)}${N6.percentage}`;return s.jsxs(yfi,{children:[s.jsx(bfi,{children:ifi(S)}),s.jsx(wfi,{children:s.jsx(vfi,{style:{width:B,backgroundColor:L}})}),s.jsx(Cfi,{children:D})]},S)})}):s.jsx(TAe,{children:S0.drawer.noAccuracyData})]}),h&&s.jsxs(CW,{children:[s.jsx(LS,{children:q3i}),s.jsx(Afi,{children:qoe(m).map(S=>s.jsx(Qt,{label:S0.actions[S.labelKey],variant:S.destructive?"destructive":"outline",size:"small",onClick:()=>{S.operationType==="cancel_onboarding"?l(e):b(S.operationType)}},S.operationType))})]}),s.jsxs(gfi,{children:[s.jsx(LS,{children:S0.drawer.jobHistory}),r.length===0&&!y?s.jsx(TAe,{children:S0.drawer.noJobsFound}):s.jsxs($fi,{children:[s.jsxs(kfi,{children:[s.jsx(Sfi,{children:s.jsx(St,{children:S0.drawer.operation})}),s.jsx(Efi,{children:s.jsx(St,{children:PAe})}),s.jsx(Lfi,{children:s.jsx(St,{children:J3i})}),s.jsx(Ifi,{children:s.jsx(St,{children:Z3i})})]}),s.jsx(jfi,{children:s.jsx(Mi,{children:({height:S,width:E})=>s.jsx(sC,{isItemLoaded:v,itemCount:t?r.length+1:r.length,loadMoreItems:A,children:({onItemsRendered:I})=>s.jsx(dM,{height:S,width:E,itemCount:r.length,itemSize:lr.jobRowHeightPx,itemData:r,onItemsRendered:I,innerElementType:ofi,overscanCount:lr.jobSkeletonRowCount,children:pZe})})})}),y&&s.jsx(zfi,{children:Array.from({length:lr.jobSkeletonRowCount},(S,E)=>s.jsxs(Rfi,{children:[s.jsx(IS,{$flex:!0,children:s.jsx(Bo,{width:E%2===0?90:70,height:lr.skeletonLoaderHeightPx})}),s.jsx(IS,{children:s.jsx(Bo,{width:60,height:lr.skeletonLoaderHeightPx})}),s.jsx(IS,{children:s.jsx(Bo,{width:o.sp11,height:lr.skeletonLoaderHeightPx})}),s.jsx(IS,{children:s.jsx(Bo,{width:70,height:lr.skeletonLoaderHeightPx})})]},`skeleton-${E}`))})]})]})]})]}),p!=null&&s.jsx(Yoe,{operationType:p.operationType,dialogTitle:S0.actions[Koe[p.operationType].labelKey],dialogDescription:cZe(p.operationType,e.companyName),onCancel:()=>u(null),onConfirm:w})]})},pZe=g.memo(({index:e,style:t,data:r})=>{const n=r[e],a=n.operationType.replaceAll("_"," "),l=n.triggeredBy!=null?`${n.triggeredBy.firstName} ${n.triggeredBy.lastName}`.trim():N6.emDash;return s.jsxs(Mfi,{style:t,children:[s.jsx(Bfi,{children:a}),s.jsx(Dfi,{children:n.status}),s.jsx(Pfi,{title:n.createdAt.format(Wb.hmmADashDDMMMCommaYYYY),children:n.createdAt.format(vE.visual.MMMDCommaYYYYformat)}),s.jsx(Tfi,{children:l})]})});pZe.displayName="JobListItem";const ofi=g.forwardRef(({style:e,...t},r)=>s.jsx("div",{ref:r,style:{...e,position:"relative"},...t})),rfi=e=>e>=lr.accuracySuccessThresholdPercent?k.success:e>=lr.accuracyAlertThresholdPercent?k.alert:k.important,ifi=e=>e.split("_").filter(t=>t.length>0).map(t=>t[0].toUpperCase()+t.slice(1).toLowerCase()).join(" "),nfi=i.div`
94075
+ `,{aiAccountantCustomer:qq,common:{failed:N3i,oauthConsent:{company:H3i},status:{pending:_3i},texts:{lastSync:V3i,lastTraining:U3i,live:Q3i,offboarded:W3i,onboarding:G3i,status:Y3i}}}=W.getLocalizedStrings(),lr={rowHeightPx:C[8],headerHeightPx:44,jobRowHeightPx:44,jobHeaderHeightPx:36,jobTableMinHeightPx:200,jobOperationMinWidthPx:120,jobStatusColumnWidthPx:90,jobDateColumnWidthPx:120,jobByColumnWidthPx:100,jobSkeletonRowCount:3,skeletonLoaderHeightPx:14,accuracyLabelMinWidthPx:80,accuracyValueMinWidthPx:45,accuracySuccessThresholdPercent:80,accuracyAlertThresholdPercent:60,sortIconSize:o.sp2,menuIconSize:o.sp3,statusBadgeVerticalPadding:"2px",accuracyBarHeight:o.sp2,globalNavBarHeightPx:45,pageHeaderHeightPx:75,menuDropdownMinWidthPx:160,checkboxColumnWidthPx:40},Wd={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},K3i=[{key:"companyName",label:H3i,sortable:!0,width:Wd.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:Y3i,sortable:!0,width:Wd.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:qq.table.bookClose,sortable:!0,width:Wd.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:U3i,sortable:!0,width:Wd.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:V3i,sortable:!0,width:Wd.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:qq.table.accuracy,sortable:!0,width:Wd.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:Wd.actions,justifyContent:"center"}],Koe={onboard:{labelKey:"onboard",destructive:!1},evaluate:{labelKey:"evaluate",destructive:!1},full_pipeline:{labelKey:"fullPipeline",destructive:!1},retrain:{labelKey:"retrain",destructive:!1},offboard:{labelKey:"offboard",destructive:!0},cancel_onboarding:{labelKey:"cancelOnboarding",destructive:!0}},cZe=(e,t)=>{const{jobTriggerDialog:r}=qq;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",t):r.singleDescription.replace("__companyName__",t).replace("__datesInstruction__",r.datesInstruction)},qoe=e=>EXe(e).map(t=>({operationType:t,...Koe[t]})),dZe=e=>({active:Q3i,pending:_3i,onboarding:G3i,offboarded:W3i,failed:N3i})[e]??e;function Zoe(){const{useDynamicConfig:e}=wD(),{configValue:t}=e(DFe.aiAccountantOnboardingConfig),r=ii().loggedInUser;return t==null||r?.userId==null?!1:Array.isArray(t.user_list_with_write_access)&&t.user_list_with_write_access.includes(r.userId)}const{common:{strings:N6,texts:{actions:q3i,by:Z3i,created:J3i,lastSync:X3i,lastTraining:efi,offboarded:tfi,status:PAe}},dateFormat:vE,timeFormat:Wb,aiAccountantCustomer:S0}=W.getLocalizedStrings(),Jfn=({customer:e,hasMoreJobs:t,jobs:r,jobsFetchStatus:n,onAction:a,onCancelOnboarding:l,onClose:c,onLoadMoreJobs:d})=>{const[p,u]=g.useState(null),h=Zoe(),m=e.enrollment?.status??"unknown",f=e.enrollment,x=f?.accuracy??{},y=n.fetchState==="In-Progress",b=S=>{u({operationType:S})},w=(S,E,I)=>{a(e,S,E,I),u(null)},v=S=>S<r.length,A=()=>{t&&!y&&d()};return s.jsxs(s.Fragment,{children:[s.jsxs(nfi,{children:[s.jsx(afi,{children:s.jsxs(sfi,{children:[s.jsx(lfi,{}),s.jsxs(cfi,{children:[s.jsx(dfi,{children:e.companyName}),s.jsx(pfi,{children:e.tenantId})]}),s.jsx(ufi,{onClick:c,children:s.jsx(hfi,{})})]})}),s.jsxs(mfi,{children:[s.jsxs(CW,{children:[s.jsx(LS,{children:S0.drawer.enrollmentDetails}),s.jsxs(ffi,{children:[s.jsxs(tb,{children:[s.jsx(ob,{children:PAe}),s.jsx(rb,{children:dZe(m)})]}),s.jsxs(tb,{children:[s.jsx(ob,{children:S0.drawer.onboarded}),s.jsx(rb,{title:f?.onboardedAt!=null?f.onboardedAt.format(Wb.hmmADashDDMMMCommaYYYY):void 0,children:f?.onboardedAt!=null?f.onboardedAt.format(vE.visual.MMMDCommaYYYYformat):N6.emDash})]}),s.jsxs(tb,{children:[s.jsx(ob,{children:efi}),s.jsx(rb,{title:f?.latestTraining!=null?f.latestTraining.format(Wb.hmmADashDDMMMCommaYYYY):void 0,children:f?.latestTraining!=null?f.latestTraining.format(vE.visual.MMMDCommaYYYYformat):N6.emDash})]}),s.jsxs(tb,{children:[s.jsx(ob,{children:X3i}),s.jsx(rb,{title:f?.latestTransactionSync!=null?f.latestTransactionSync.local().format(Wb.hmmADashDDMMMCommaYYYY):void 0,children:f?.latestTransactionSync!=null?f.latestTransactionSync.utc(!0).fromNow():N6.emDash})]}),f?.offboardedAt!=null&&s.jsxs(tb,{children:[s.jsx(ob,{children:tfi}),s.jsx(rb,{title:f.offboardedAt.format(Wb.hmmADashDDMMMCommaYYYY),children:f.offboardedAt.format(vE.visual.MMMDCommaYYYYformat)})]})]})]}),s.jsxs(CW,{children:[s.jsx(LS,{children:S0.drawer.modelAccuracy}),Object.keys(x).length>0?s.jsx(xfi,{children:Object.entries(x).map(([S,E])=>{const I=E*100,L=rfi(I),B=`${I.toFixed(0)}${N6.percentage}`,D=`${I.toFixed(1)}${N6.percentage}`;return s.jsxs(yfi,{children:[s.jsx(bfi,{children:ifi(S)}),s.jsx(wfi,{children:s.jsx(vfi,{style:{width:B,backgroundColor:L}})}),s.jsx(Cfi,{children:D})]},S)})}):s.jsx(TAe,{children:S0.drawer.noAccuracyData})]}),h&&s.jsxs(CW,{children:[s.jsx(LS,{children:q3i}),s.jsx(Afi,{children:qoe(m).map(S=>s.jsx(Qt,{label:S0.actions[S.labelKey],variant:S.destructive?"destructive":"outline",size:"small",onClick:()=>{S.operationType==="cancel_onboarding"?l(e):b(S.operationType)}},S.operationType))})]}),s.jsxs(gfi,{children:[s.jsx(LS,{children:S0.drawer.jobHistory}),r.length===0&&!y?s.jsx(TAe,{children:S0.drawer.noJobsFound}):s.jsxs($fi,{children:[s.jsxs(kfi,{children:[s.jsx(Sfi,{children:s.jsx(St,{children:S0.drawer.operation})}),s.jsx(Efi,{children:s.jsx(St,{children:PAe})}),s.jsx(Lfi,{children:s.jsx(St,{children:J3i})}),s.jsx(Ifi,{children:s.jsx(St,{children:Z3i})})]}),s.jsx(jfi,{children:s.jsx(Mi,{children:({height:S,width:E})=>s.jsx(sC,{isItemLoaded:v,itemCount:t?r.length+1:r.length,loadMoreItems:A,children:({onItemsRendered:I})=>s.jsx(dM,{height:S,width:E,itemCount:r.length,itemSize:lr.jobRowHeightPx,itemData:r,onItemsRendered:I,innerElementType:ofi,overscanCount:lr.jobSkeletonRowCount,children:pZe})})})}),y&&s.jsx(zfi,{children:Array.from({length:lr.jobSkeletonRowCount},(S,E)=>s.jsxs(Rfi,{children:[s.jsx(IS,{$flex:!0,children:s.jsx(Bo,{width:E%2===0?90:70,height:lr.skeletonLoaderHeightPx})}),s.jsx(IS,{children:s.jsx(Bo,{width:60,height:lr.skeletonLoaderHeightPx})}),s.jsx(IS,{children:s.jsx(Bo,{width:o.sp11,height:lr.skeletonLoaderHeightPx})}),s.jsx(IS,{children:s.jsx(Bo,{width:70,height:lr.skeletonLoaderHeightPx})})]},`skeleton-${E}`))})]})]})]})]}),p!=null&&s.jsx(Yoe,{operationType:p.operationType,dialogTitle:S0.actions[Koe[p.operationType].labelKey],dialogDescription:cZe(p.operationType,e.companyName),onCancel:()=>u(null),onConfirm:w})]})},pZe=g.memo(({index:e,style:t,data:r})=>{const n=r[e],a=n.operationType.replaceAll("_"," "),l=n.triggeredBy!=null?`${n.triggeredBy.firstName} ${n.triggeredBy.lastName}`.trim():N6.emDash;return s.jsxs(Mfi,{style:t,children:[s.jsx(Bfi,{children:a}),s.jsx(Dfi,{children:n.status}),s.jsx(Pfi,{title:n.createdAt.format(Wb.hmmADashDDMMMCommaYYYY),children:n.createdAt.format(vE.visual.MMMDCommaYYYYformat)}),s.jsx(Tfi,{children:l})]})});pZe.displayName="JobListItem";const ofi=g.forwardRef(({style:e,...t},r)=>s.jsx("div",{ref:r,style:{...e,position:"relative"},...t})),rfi=e=>e>=lr.accuracySuccessThresholdPercent?k.success:e>=lr.accuracyAlertThresholdPercent?k.alert:k.important,ifi=e=>e.split("_").filter(t=>t.length>0).map(t=>t[0].toUpperCase()+t.slice(1).toLowerCase()).join(" "),nfi=i.div`
94077
94076
  display: flex;
94078
94077
  flex-direction: column;
94079
94078
  background-color: ${e=>e.theme.colors.grey4};
@@ -94523,7 +94522,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
94523
94522
  `,DS=i(ht)`
94524
94523
  color: ${e=>e.theme.colors.primary};
94525
94524
  margin-top: ${o.sp2};
94526
- `,{common:_m,aiAccountantCustomer:$m}=W.getLocalizedStrings(),k4i="evaluate",S4i=[{label:_m.texts.live,value:"active"},{label:_m.status.pending,value:"pending"},{label:_m.texts.onboarding,value:"onboarding"},{label:_m.texts.offboarded,value:"offboarded"},{label:_m.failed,value:"failed"}],E4i=()=>({enrollmentStatus:S4i}),e4n=({headerData:e,headerActions:t,aiAccountantPageActions:r,aiAccountantPageData:n})=>{const a=Me(),l=Zoe(),{aiAccountantView:c}=n,{onAction:d,onBulkAction:p,onCancelOnboarding:u,onClearSelection:h,onCockpitReloadData:m,onColumnSortConfigChanged:f,onCustomerSelected:x,onEvaluateAll:y,onFilterTextChanged:b,onFiltersChange:w,onToggleAllVisible:v,onToggleTenantSelection:A}=r,S=c.fetchState==="Completed",E=c.fetchState==="In-Progress"||c.fetchState==="Not-Started",I=c.fetchState==="Error",L=c.triggerJobStatus.fetchState==="In-Progress",B=c.selectedTenantIds,D=B.length,P=c.unonboardedTenantIds.length,T=D>0,R=g.useMemo(()=>{if(!T)return[];const G=c.selectedCustomersForJobTrigger.map(ae=>qoe(ae.enrollment?.status??"unknown"));if(G.length===0)return[];const[X,...J]=G;return X.filter(ae=>ae.operationType!=="cancel_onboarding"&&J.every(xe=>xe.some(me=>me.operationType===ae.operationType)))},[T,c.selectedCustomersForJobTrigger]),[N,K]=g.useState(!1),q=g.useRef(null),[F,_]=g.useState({top:0,right:0});g.useEffect(()=>{if(N&&q.current!=null){const G=q.current.getBoundingClientRect();_({top:G.bottom,right:window.innerWidth-G.right})}},[N]),g.useEffect(()=>{if(!N)return;const G=()=>K(!1);return document.addEventListener("click",G),window.addEventListener("scroll",G,!0),window.addEventListener("resize",G),()=>{document.removeEventListener("click",G),window.removeEventListener("scroll",G,!0),window.removeEventListener("resize",G)}},[N]);const[V,O]=g.useState(null),z=()=>{P===0||L||O({mode:"evaluateAll",count:P})},H=G=>{K(!1),O({mode:"bulk",operationType:G.operationType,operationLabel:$m.actions[G.labelKey],count:D})},ee=(G,X,J)=>{V!=null&&(V.mode==="evaluateAll"?y(X,J):p(G,X,J),O(null))},Y=T||P===0||L;return s.jsxs(L4i,{children:[s.jsx(V2,{headerActions:{...t,filterActions:{onFilterTextChanged:(G,X)=>{b(X)},getCategoryWiseOptions:E4i,onFiltersChange:w}},headerData:{...e,allTabOptions:e.allTabOptions??n0,companiesLoaded:S,filterData:{filterText:c.uiState.filterText,filters:c.uiState.filters},selectedTabOption:"aiAccountant"}}),s.jsx(I4i,{windowSize:a,children:E?s.jsx(x4i,{}):I?s.jsx(P3,{onCockpitReloadData:m,selectedCockpitOption:"aiAccountant"}):s.jsxs(N4i,{children:[s.jsxs(j4i,{children:[s.jsx(M4i,{children:T&&s.jsxs(s.Fragment,{children:[s.jsx(D4i,{children:$m.bulkActions.selectedCount.replace("__count__",String(D))}),s.jsx(P4i,{type:"button",onClick:h,children:_m.clear})]})}),s.jsxs(B4i,{children:[s.jsx(Ofi,{isEnabled:!E,spinRefreshIcon:E,onClick:()=>m("aiAccountant")}),l&&!T&&s.jsx(Qt,{label:_m.texts.evaluateAll,variant:"primary",size:"small",disabled:Y,onClick:z}),l&&T&&s.jsxs(T4i,{children:[s.jsxs(z4i,{ref:q,onClick:G=>G.stopPropagation(),children:[s.jsx(Qt,{label:$m.bulkActions.menuLabel,variant:"primary",size:"small",disabled:R.length===0||L,onClick:()=>K(!N)}),N&&R.length>0&&Fn.createPortal(s.jsx(F4i,{style:{top:F.top,right:F.right},children:R.map(G=>s.jsx(O4i,{onClick:()=>H(G),children:$m.actions[G.labelKey]},G.operationType))}),document.body)]}),R.length===0&&s.jsx(R4i,{children:$m.bulkActions.disabledInfo})]})]})]}),s.jsx(A4i,{averageAccuracy:c.averageAccuracy,customers:c.customers}),s.jsx(Wfi,{customers:c.customers,sortKey:c.uiState.sortKey,sortOrder:c.uiState.sortOrder,selectedTenantIds:B,onColumnSortConfigChanged:f,onRowClick:x,onAction:d,onCancelOnboarding:u,onToggleAllVisible:v,onToggleTenantSelection:A})]})}),V!=null&&s.jsx(Yoe,{operationType:V.mode==="evaluateAll"?k4i:V.operationType,dialogTitle:V.mode==="evaluateAll"?_m.texts.evaluateAll:V.operationLabel,dialogDescription:V.mode==="evaluateAll"?$m.bulkActions.evaluateAllDialogDescription.replace("__count__",String(V.count)):V.operationType==="offboard"?$m.bulkActions.bulkDialogDescriptionOffboard.replace("__count__",String(V.count)):$m.bulkActions.bulkDialogDescription.replace("__count__",String(V.count)).replace("__action__",V.operationLabel),onCancel:()=>O(null),onConfirm:ee})]})},L4i=i.div`
94525
+ `,{common:_m,aiAccountantCustomer:$m}=W.getLocalizedStrings(),k4i="evaluate",S4i=[{label:_m.texts.live,value:"active"},{label:_m.status.pending,value:"pending"},{label:_m.texts.onboarding,value:"onboarding"},{label:_m.texts.offboarded,value:"offboarded"},{label:_m.failed,value:"failed"}],E4i=()=>({enrollmentStatus:S4i}),Xfn=({headerData:e,headerActions:t,aiAccountantPageActions:r,aiAccountantPageData:n})=>{const a=Me(),l=Zoe(),{aiAccountantView:c}=n,{onAction:d,onBulkAction:p,onCancelOnboarding:u,onClearSelection:h,onCockpitReloadData:m,onColumnSortConfigChanged:f,onCustomerSelected:x,onEvaluateAll:y,onFilterTextChanged:b,onFiltersChange:w,onToggleAllVisible:v,onToggleTenantSelection:A}=r,S=c.fetchState==="Completed",E=c.fetchState==="In-Progress"||c.fetchState==="Not-Started",I=c.fetchState==="Error",L=c.triggerJobStatus.fetchState==="In-Progress",B=c.selectedTenantIds,D=B.length,P=c.unonboardedTenantIds.length,T=D>0,R=g.useMemo(()=>{if(!T)return[];const G=c.selectedCustomersForJobTrigger.map(ae=>qoe(ae.enrollment?.status??"unknown"));if(G.length===0)return[];const[X,...J]=G;return X.filter(ae=>ae.operationType!=="cancel_onboarding"&&J.every(xe=>xe.some(me=>me.operationType===ae.operationType)))},[T,c.selectedCustomersForJobTrigger]),[N,K]=g.useState(!1),q=g.useRef(null),[F,_]=g.useState({top:0,right:0});g.useEffect(()=>{if(N&&q.current!=null){const G=q.current.getBoundingClientRect();_({top:G.bottom,right:window.innerWidth-G.right})}},[N]),g.useEffect(()=>{if(!N)return;const G=()=>K(!1);return document.addEventListener("click",G),window.addEventListener("scroll",G,!0),window.addEventListener("resize",G),()=>{document.removeEventListener("click",G),window.removeEventListener("scroll",G,!0),window.removeEventListener("resize",G)}},[N]);const[V,O]=g.useState(null),z=()=>{P===0||L||O({mode:"evaluateAll",count:P})},H=G=>{K(!1),O({mode:"bulk",operationType:G.operationType,operationLabel:$m.actions[G.labelKey],count:D})},ee=(G,X,J)=>{V!=null&&(V.mode==="evaluateAll"?y(X,J):p(G,X,J),O(null))},Y=T||P===0||L;return s.jsxs(L4i,{children:[s.jsx(V2,{headerActions:{...t,filterActions:{onFilterTextChanged:(G,X)=>{b(X)},getCategoryWiseOptions:E4i,onFiltersChange:w}},headerData:{...e,allTabOptions:e.allTabOptions??n0,companiesLoaded:S,filterData:{filterText:c.uiState.filterText,filters:c.uiState.filters},selectedTabOption:"aiAccountant"}}),s.jsx(I4i,{windowSize:a,children:E?s.jsx(x4i,{}):I?s.jsx(P3,{onCockpitReloadData:m,selectedCockpitOption:"aiAccountant"}):s.jsxs(N4i,{children:[s.jsxs(j4i,{children:[s.jsx(M4i,{children:T&&s.jsxs(s.Fragment,{children:[s.jsx(D4i,{children:$m.bulkActions.selectedCount.replace("__count__",String(D))}),s.jsx(P4i,{type:"button",onClick:h,children:_m.clear})]})}),s.jsxs(B4i,{children:[s.jsx(Ofi,{isEnabled:!E,spinRefreshIcon:E,onClick:()=>m("aiAccountant")}),l&&!T&&s.jsx(Qt,{label:_m.texts.evaluateAll,variant:"primary",size:"small",disabled:Y,onClick:z}),l&&T&&s.jsxs(T4i,{children:[s.jsxs(z4i,{ref:q,onClick:G=>G.stopPropagation(),children:[s.jsx(Qt,{label:$m.bulkActions.menuLabel,variant:"primary",size:"small",disabled:R.length===0||L,onClick:()=>K(!N)}),N&&R.length>0&&Fn.createPortal(s.jsx(F4i,{style:{top:F.top,right:F.right},children:R.map(G=>s.jsx(O4i,{onClick:()=>H(G),children:$m.actions[G.labelKey]},G.operationType))}),document.body)]}),R.length===0&&s.jsx(R4i,{children:$m.bulkActions.disabledInfo})]})]})]}),s.jsx(A4i,{averageAccuracy:c.averageAccuracy,customers:c.customers}),s.jsx(Wfi,{customers:c.customers,sortKey:c.uiState.sortKey,sortOrder:c.uiState.sortOrder,selectedTenantIds:B,onColumnSortConfigChanged:f,onRowClick:x,onAction:d,onCancelOnboarding:u,onToggleAllVisible:v,onToggleTenantSelection:A})]})}),V!=null&&s.jsx(Yoe,{operationType:V.mode==="evaluateAll"?k4i:V.operationType,dialogTitle:V.mode==="evaluateAll"?_m.texts.evaluateAll:V.operationLabel,dialogDescription:V.mode==="evaluateAll"?$m.bulkActions.evaluateAllDialogDescription.replace("__count__",String(V.count)):V.operationType==="offboard"?$m.bulkActions.bulkDialogDescriptionOffboard.replace("__count__",String(V.count)):$m.bulkActions.bulkDialogDescription.replace("__count__",String(V.count)).replace("__action__",V.operationLabel),onCancel:()=>O(null),onConfirm:ee})]})},L4i=i.div`
94527
94526
  height: calc(100vh - ${lr.globalNavBarHeightPx}px);
94528
94527
  overflow-y: hidden;
94529
94528
  background-color: ${e=>e.theme.colors.grey4};
@@ -95036,7 +95035,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
95036
95035
  height: calc(100vh - 45px);
95037
95036
  overflow-y: hidden;
95038
95037
  background-color: ${e=>e.theme.colors.grey4};
95039
- `,t4n=({headerData:e,headerActions:t,initialOpenThreadRequest:r,onboardingPageActions:n,onboardingPageData:a})=>{const[l,c]=g.useState(!1),[d,p]=g.useState(void 0),[u,h]=g.useState(void 0),{analytics:m}=Ra(),{onboardingView:f,qboConnectionPoolFlag:x}=a,{onScroll:y,onOnboardingStepClicked:b,onCancelClicked:w,onGoLiveClicked:v,onUpdateCustomerCreationStatus:A,onCockpitReloadData:S,onSendInviteClick:E,onColumnSortConfigChanged:I,redirectToDashboardOnboarding:L,onRetryBankAccountConnection:B,onQBOConnectClick:D}=n,P=f.fetchState==="Completed"&&f.zeniUsers.fetchState==="Completed",T={onOkClick:()=>{c(!1),d!=null&&(E(d),u!=null&&m.trackOnboardingSendInvite(d,!1,u))},onCancelClick:()=>{c(!1)}};return s.jsxs(y7i,{children:[l===!0?s.jsx(Qs,{titleComponent:s.jsx(Vs,{style:{paddingLeft:o.sp6,paddingRight:o.sp6},children:qAe.confirmationPopup.title}),descriptionComponent:s.jsx(Us,{children:qAe.confirmationPopup.subTitle}),primaryButtonText:m7i,secondaryButtonText:h7i,action:T,style:{background:k.overlayDark}}):null,s.jsx(V2,{headerActions:{...t},headerData:{...e,allTabOptions:e.allTabOptions??n0,companiesLoaded:P,filterData:{filterText:f.uiState.filterText,disableFilters:!0},selectedTabOption:"onboarding"}}),s.jsx(b7i,{initialOpenThreadRequest:r,onColumnSortConfigChanged:I,onCockpitReloadData:S,onGoLiveClicked:v,onQBOConnectClick:D,onRetryBankAccountConnection:B,onScroll:y,onSendInviteClick:(R,N,K)=>{N?(E(R),m.trackOnboardingSendInvite(R,!0,K)):(p(R),h(K),c(!0))},onboardingView:f,onOnboardingStepClicked:b,onCancelClicked:w,onUpdateCustomerCreationStatus:A,qboConnectionPoolFlag:x,redirectToDashboardOnboarding:L})]})},b7i=({onboardingView:e,qboConnectionPoolFlag:t,initialOpenThreadRequest:r,onSendInviteClick:n,onScroll:a,onOnboardingStepClicked:l,onCancelClicked:c,onGoLiveClicked:d,onUpdateCustomerCreationStatus:p,onCockpitReloadData:u,onColumnSortConfigChanged:h,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:f,onQBOConnectClick:x})=>{const y=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:u,selectedCockpitOption:"onboarding"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?s.jsx(f7i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.onboardingCustomers.length===0?s.jsx($p,{emptySearchTextFirstLine:g7i,emptySearchTextSecondLine:u7i}):s.jsx(x7i,{windowSize:y,children:s.jsx(a7i,{initialOpenThreadRequest:r,onCancelClicked:c,onColumnSortConfigChanged:h,onGoLiveClicked:d,onQBOConnectClick:x,onRetryBankAccountConnection:f,onScroll:a,onSendInviteClick:n,onUpdateCustomerCreationStatus:p,onboardingView:e,qboConnectionPoolFlag:t,redirectToDashboardOnboarding:m,onOnboardingStepClicked:l})})},{common:{add:w7i},cockpit:{onboarding:{customer:{companyCredentials:v7i,companyDomain:C7i,domain:A7i}}}}=W.getLocalizedStrings(),$7i=({localData:e,labelWidth:t,onCompanyDomainBlurred:r,isOnboardingAllowedForUser:n})=>{const{isCustomerCreated:a,isEmailGroupCreated:l,companyEmailDomain:c,companyId:d}=e.newOnboardingCustomerLocalData,p=a===!0||l===!0||d!=null||n===!1,u=c!=null&&L7i(c);return s.jsxs(k7i,{children:[s.jsx(E7i,{children:v7i}),s.jsx(S7i,{children:s.jsx(Sr,{label:{label:C7i,width:t},text:{type:"text",name:"companySection.companyDomain",placeholder:`${w7i} ${A7i}`,options:{required:!0,pattern:cFe}},onBlur:()=>{u&&r(c)},isDisabled:p===!0?"readonly":void 0})})]})},k7i=i.div`
95038
+ `,e4n=({headerData:e,headerActions:t,initialOpenThreadRequest:r,onboardingPageActions:n,onboardingPageData:a})=>{const[l,c]=g.useState(!1),[d,p]=g.useState(void 0),[u,h]=g.useState(void 0),{analytics:m}=Ra(),{onboardingView:f,qboConnectionPoolFlag:x}=a,{onScroll:y,onOnboardingStepClicked:b,onCancelClicked:w,onGoLiveClicked:v,onUpdateCustomerCreationStatus:A,onCockpitReloadData:S,onSendInviteClick:E,onColumnSortConfigChanged:I,redirectToDashboardOnboarding:L,onRetryBankAccountConnection:B,onQBOConnectClick:D}=n,P=f.fetchState==="Completed"&&f.zeniUsers.fetchState==="Completed",T={onOkClick:()=>{c(!1),d!=null&&(E(d),u!=null&&m.trackOnboardingSendInvite(d,!1,u))},onCancelClick:()=>{c(!1)}};return s.jsxs(y7i,{children:[l===!0?s.jsx(Qs,{titleComponent:s.jsx(Vs,{style:{paddingLeft:o.sp6,paddingRight:o.sp6},children:qAe.confirmationPopup.title}),descriptionComponent:s.jsx(Us,{children:qAe.confirmationPopup.subTitle}),primaryButtonText:m7i,secondaryButtonText:h7i,action:T,style:{background:k.overlayDark}}):null,s.jsx(V2,{headerActions:{...t},headerData:{...e,allTabOptions:e.allTabOptions??n0,companiesLoaded:P,filterData:{filterText:f.uiState.filterText,disableFilters:!0},selectedTabOption:"onboarding"}}),s.jsx(b7i,{initialOpenThreadRequest:r,onColumnSortConfigChanged:I,onCockpitReloadData:S,onGoLiveClicked:v,onQBOConnectClick:D,onRetryBankAccountConnection:B,onScroll:y,onSendInviteClick:(R,N,K)=>{N?(E(R),m.trackOnboardingSendInvite(R,!0,K)):(p(R),h(K),c(!0))},onboardingView:f,onOnboardingStepClicked:b,onCancelClicked:w,onUpdateCustomerCreationStatus:A,qboConnectionPoolFlag:x,redirectToDashboardOnboarding:L})]})},b7i=({onboardingView:e,qboConnectionPoolFlag:t,initialOpenThreadRequest:r,onSendInviteClick:n,onScroll:a,onOnboardingStepClicked:l,onCancelClicked:c,onGoLiveClicked:d,onUpdateCustomerCreationStatus:p,onCockpitReloadData:u,onColumnSortConfigChanged:h,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:f,onQBOConnectClick:x})=>{const y=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:u,selectedCockpitOption:"onboarding"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?s.jsx(f7i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.onboardingCustomers.length===0?s.jsx($p,{emptySearchTextFirstLine:g7i,emptySearchTextSecondLine:u7i}):s.jsx(x7i,{windowSize:y,children:s.jsx(a7i,{initialOpenThreadRequest:r,onCancelClicked:c,onColumnSortConfigChanged:h,onGoLiveClicked:d,onQBOConnectClick:x,onRetryBankAccountConnection:f,onScroll:a,onSendInviteClick:n,onUpdateCustomerCreationStatus:p,onboardingView:e,qboConnectionPoolFlag:t,redirectToDashboardOnboarding:m,onOnboardingStepClicked:l})})},{common:{add:w7i},cockpit:{onboarding:{customer:{companyCredentials:v7i,companyDomain:C7i,domain:A7i}}}}=W.getLocalizedStrings(),$7i=({localData:e,labelWidth:t,onCompanyDomainBlurred:r,isOnboardingAllowedForUser:n})=>{const{isCustomerCreated:a,isEmailGroupCreated:l,companyEmailDomain:c,companyId:d}=e.newOnboardingCustomerLocalData,p=a===!0||l===!0||d!=null||n===!1,u=c!=null&&L7i(c);return s.jsxs(k7i,{children:[s.jsx(E7i,{children:v7i}),s.jsx(S7i,{children:s.jsx(Sr,{label:{label:C7i,width:t},text:{type:"text",name:"companySection.companyDomain",placeholder:`${w7i} ${A7i}`,options:{required:!0,pattern:cFe}},onBlur:()=>{u&&r(c)},isDisabled:p===!0?"readonly":void 0})})]})},k7i=i.div`
95040
95039
  display: flex;
95041
95040
  flex-direction: column;
95042
95041
  gap: ${o.sp2};
@@ -95291,7 +95290,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
95291
95290
  color: ${k.importantDark};
95292
95291
  padding: ${o.sp2} ${o.sp2};
95293
95292
  border-radius: ${o.sp1};
95294
- `,{common:gn,cockpit:{onboarding:tl}}=W.getLocalizedStrings(),E6i=gn.no,L6i=gn.yes,Po=gn.strings,XAe="onboardingCustomerPage",I6i="companySection",_u="groupSection",An="customerSection",wZe="qboConnectionSection",cb={labelWidth:new j(120,180),largeLabelWidth:new j(120,210,210),extraLargeLabelWidth:new j(240,240,240),buttonWidth:new j(135,135)};function o4n({localData:e,screenType:t,qboConnectClicked:r,analytics:n,onOnboardingCustomerDataUpdated:a,onCloseClick:l,onSaveClick:c,onViewClick:d,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:u,onQBOConnectClick:h}){const m=lt(),f=Me(),x=cb.labelWidth.value(f),y=cb.largeLabelWidth.value(f),b=cb.extraLargeLabelWidth.value(f),w=Oi({mode:"all",reValidateMode:"onChange",defaultValues:g.useMemo(()=>db(e),[e])}),{emailGroupFetchState:v,newOnboardingCustomerLocalData:A,onboardingCompletedCompanies:S,isOnboardingAllowedForUser:E,fetchState:I,sendInviteFetchState:L,uiState:B,companyView:D,externalConnections:P}=e,[T,R]=g.useState(Po.empty),[N,K]=g.useState(Po.empty),[q]=g.useState(Po.empty),[F,_]=g.useState(Po.empty),[V,O]=g.useState(Po.empty),[z,H]=g.useState(!1),[ee,Y]=g.useState(!1),[G,X]=g.useState(tl.customer.completePreOnboardingText),[J,ae]=g.useState(!1),xe=g.useRef(null),me=g.useRef(null),de=g.useRef(null),{isExistingCustomer:ce,isCustomerOnboardedSuccessfully:ge}=P6i(e),be=ce&&ge?tl.customer.customerNameExistInManagementText:tl.customer.customerNameExistInOnboardingText,ie=g.useMemo(()=>be.replace("_company-domain_",A.companyEmailDomain??Po.empty),[v.fetchState]),ne=D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,fe=g.useCallback(()=>{const He=w.getValues();return He[An].realmId!==He[An].confirmRealmId?(_(tl.customer.realmIdWarning),w.trigger(`${An}.confirmRealmId`),!1):(_(Po.empty),w.clearErrors(`${An}.confirmRealmId`),!0)},[w]),ve=g.useCallback(()=>{const He=w.getValues();return He[An].entityType.selectedOption?.value=="Subsidiary"&&He[An].company.selectedOption==null?(w.setError("customerSection.company",{type:"required"}),!1):(w.clearErrors("customerSection.company"),!0)},[w]),re=g.useCallback(()=>A.customerName?.firstName&&!A.customerName?.lastName||!A.customerName?.firstName&&A.customerName?.lastName?(w.trigger(`${An}.customerName`),!1):(A.customerName?.firstName||A.customerName?.lastName)&&!A.email?(w.trigger(`${An}.email`),!1):(A.customerName?.firstName||A.customerName?.lastName)&&A.email&&A.selectedProducts?.length===0?(O(tl.customer.productsWarning),w.trigger(`${An}.products`),!1):!0,[w,A.customerName,A.email,A.selectedProducts]),he=g.useCallback(()=>fe()&&ve()&&re(),[ve,fe,re]),Ee=w.handleSubmit(()=>{X(tl.customer.completePreOnboardingText),he()&&Y(!0)},()=>{he(),console.warn("Onboarding customer form error")}),Be=w.getValues()[An].email??Po.empty,we=(He=!1)=>{const bt={companyDomain:A.companyEmailDomain??Po.empty,primaryContactEmail:Be},Mt={groupName:A.groupName??Po.empty,groupEmail:A.groupId??Po.empty,groupDescription:A.groupDescription??Po.empty},Ft={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:Be,companyName:A.name??Po.empty,entittyType:A.isSubsidiary===!0?gn.texts.subsidiary:gn.texts.parent??Po.empty,chargebeeId:A.chargebeeId??Po.empty,products:A.selectedProducts??[],qboRealmId:A.qboRealmId??Po.empty,hubSpotId:A.hubSpotId},pt={isSendInvite:He,isInviteAlreadySent:D?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:A.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:A.accountingConnectionCreationMode==="customer",qboConnectionStatus:D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};n?.trackOnboardingSaveOrSendInvite(bt,Mt,Ft,pt)},Pe=()=>{const He={companyEmailDomain:A.companyEmailDomain??Po.empty,primaryContactEmail:Be},bt={groupName:A.groupName??Po.empty,groupEmail:A.groupId??Po.empty,groupDescription:A.groupDescription??Po.empty,isCompanyEmailDomainAvailable:!0};n?.trackOnboardingNewCustomerGroupCreationCheck(He,bt)},ze=()=>{let He=!0;const bt=w.getValues();if(bt[_u].groupEmail!==Po.empty&&bt[_u].groupName===Po.empty)R(tl.customer.groupNameWarning),w.setError("groupSection.groupName",{type:"required"}),He=!1;else if(bt[_u].groupName!==Po.empty&&bt[_u].groupEmail===Po.empty)K(tl.customer.groupEmailWarning),w.setError("groupSection.groupEmail",{type:"required"}),He=!1;else{const{error:Mt}=w.getFieldState("groupSection.groupName"),{error:Ft}=w.getFieldState("groupSection.groupEmail");(Mt==null||Mt.type==="required")&&(Ft==null||Ft.type==="required")&&(He=!1,w.clearErrors("groupSection")),R(Po.empty),K(Po.empty)}return He},tt={onOkClick:()=>{H(!1),w.reset(),l()},onCancelClick:()=>{H(!1)}},Ue={onOkClick:()=>{Y(!1),c(!0),we(!0)},onCancelClick:()=>{Y(!1)}},je=async(He,bt)=>{const Mt={...bt};if(He.includes("groupName")&&bt[_u].groupName!=Po.empty&&(bt[_u].groupName=bt[_u].groupName.charAt(0).toUpperCase()+bt[_u].groupName.slice(1)),(He.includes("groupName")||He.includes("groupEmail"))&&ze(),He.includes("confirmRealmId")&&_(Po.empty),He.includes("products")&&Eo(A.selectedProducts??[],bt[An].products.selectedOptions)===!1){O(Po.empty);const Ft=T6i(A.selectedProducts??[],bt[An].products.selectedOptions.map(ut=>PXe(ut)).filter(ut=>ut!=null));Mt[An].products.selectedOptions=Ft;const pt=pj(e.allProductsList,Ft);w.setValue(`${An}.products`,{allOptions:pt,selectedOptions:Ft})}He.includes("realmId")&&Xt(w.formState.errors,`${An}.confirmRealmId`)&&w.trigger(`${An}.confirmRealmId`),a(Mt)},_e=He=>{const{dirtyFields:bt}=w.formState;bt.companySection?.companyDomain===!0&&p(He)},$e=()=>{Object.keys(w.formState.errors).length===0&&(u?.(),X(Po.empty))},Ne=()=>{v.fetchState==="Error"?p(A.companyEmailDomain):he()&&Object.keys(w.formState.errors).length===0&&(c(L.fetchState==="Error"),we())},Ze=()=>{he()&&Object.keys(w.formState.errors).length===0&&(c(!1),we())};g.useEffect(()=>{const He=w.watch((bt,{name:Mt})=>{Mt!=null&&bt!=null&&Qa(()=>je(Mt,bt))});return()=>{He.unsubscribe()}}),g.useEffect(()=>{A.isCustomerCreationDisabled===!0&&(w.resetField("customerSection",{defaultValue:db(e)[An],keepDirty:!0}),w.clearErrors("customerSection"))},[A.isCustomerCreationDisabled]),g.useEffect(()=>{ae(A.isSubsidiary===!0),A.isSubsidiary!==!0&&w.resetField("customerSection.company",{defaultValue:db(e)[An].company,keepDirty:!0}),w.resetField("customerSection.entityType",{defaultValue:db(e)[An].entityType,keepDirty:!0})},[A.isSubsidiary]),g.useEffect(()=>{v.fetchState==="Completed"&&(w.reset(db(e)),ce||Pe())},[v.fetchState]),g.useEffect(()=>{B.selectedStep==="STEP_1"?xe.current?.scrollIntoView():B.selectedStep==="STEP_2"?me.current?.scrollIntoView():B.selectedStep==="STEP_3"&&de.current?.scrollIntoView()},[]),g.useEffect(()=>{const He=D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(P?.saveConnectionState==="Error"){const bt={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:w.getValues()[An].email??Po.empty,qboConnectionResponseMessage:gn.texts.unableToConnectQuickbooksPleaseTryAgain,isSuccess:!1};n?.trackOnboardingZeniManagedQBOConnection(bt)}else if(He??!1){const bt={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:w.getValues()[An].email??Po.empty,qboConnectionResponseMessage:gn.texts.congratulationsYouHaveSuccessfullyEstablishedAConnectionWith,isSuccess:!0};n?.trackOnboardingZeniManagedQBOConnection(bt)}},[P?.saveConnectionState,D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),g.useEffect(()=>{if(A.accountingConnectionCreationMode){const He=D?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??Po.empty;if(A.accountingConnectionCreationMode!==He){const bt={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:w.getValues()[An].email??Po.empty,isZeniOrCustomer:A.accountingConnectionCreationMode??Po.empty};n?.trackOnboardingQBOConnectionSelected(bt)}}},[A.accountingConnectionCreationMode]);const Oe=(He,bt)=>{const{fetchState:Mt}=He,{isEmailGroupCreated:Ft,selectedProducts:pt}=bt,ut=Mt!=="Completed"&&Ft==null,zt=pt==null||pt.length===0,Yt=(pt?.includes("zeni_checking")===!0||pt?.includes("zeni_treasury")===!0||pt?.includes("zeni_cards")===!0||pt?.includes("zeni_payroll")===!0||pt?.includes("zeni_cfo")===!0||pt?.includes("zeni_tax")===!0)&&pt?.includes("bookkeeping")===!1;return ut||zt||Yt},et=g.useMemo(()=>{const He=w.formState.isValid,bt=A.selectedProducts!=null&&(A.selectedProducts.includes("zeni_payroll")===!0||A.selectedProducts.includes("zeni_cfo")===!0||A.selectedProducts.includes("zeni_tax")===!0),Mt=A.selectedProducts!=null&&(A.selectedProducts.includes("zeni_checking")===!0||A.selectedProducts.includes("zeni_cards")===!0||bt)&&A.selectedProducts.includes("bookkeeping")===!1;return He!==!0||v.fetchState==="In-Progress"||v.fetchState==="Error"||I==="In-Progress"||I==="Error"||E!==!0||A.selectedProducts==null||A.selectedProducts.length===0||A.accountingConnectionCreationMode==null&&!Mt||A.accountingConnectionCreationMode==="zeni_user"&&ne!==!0&&!Mt||v.fetchState==="Completed"&&ce||D?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[v.fetchState,ce,E,I,w.formState.isValid,A.accountingConnectionCreationMode,ne,A.selectedProducts,D?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),mt=g.useMemo(()=>L.fetchState!=="In-Progress"&&L.fetchState!=="Error"&&I!=="In-Progress"&&I!=="Error"&&v.fetchState!=="In-Progress"&&ce===!0,[v.fetchState,ce,I,L.fetchState]);return s.jsxs(s.Fragment,{children:[z===!0?s.jsx(Qs,{titleComponent:s.jsx(Vs,{children:gn.confirmationPopup.discardTitle}),descriptionComponent:s.jsx(Us,{children:gn.confirmationPopup.discardDescription}),primaryButtonText:gn.confirmationPopup.discard,secondaryButtonText:gn.cancel,proceedButtonVariant:"destructive",action:tt,style:{background:k.overlayDark}}):null,ee===!0?s.jsx(Qs,{titleComponent:s.jsx(Vs,{style:{paddingLeft:o.sp6,paddingRight:o.sp6},children:tl.confirmationPopup.title}),descriptionComponent:s.jsx(Us,{children:tl.confirmationPopup.subTitle}),primaryButtonText:L6i,secondaryButtonText:E6i,action:Ue,style:{background:k.overlayDark}}):null,s.jsx(zD,{title:t==="create"?gn.texts.newCustomer:gn.texts.editCustomer,backgroundColor:m.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(w.formState.dirtyFields).length>0?H(!0):(w.reset(),l())}}),s.jsxs(j6i,{children:[s.jsx(M6i,{children:tl.customer.subTitle}),s.jsx(Fi,{...w,children:s.jsxs("form",{id:`${XAe}_form`,onSubmit:Ee,children:[s.jsx($7i,{localData:e,labelWidth:x,onCompanyDomainBlurred:_e,primaryEmailDomainAdditionalLabel:q,isOnboardingAllowedForUser:E}),mt===!0?s.jsxs(IW,{children:[s.jsxs(jW,{children:[s.jsxs(e$e,{children:[s.jsx(LW,{}),s.jsx(ue,{children:tl.customer.groupCreationError})]}),s.jsx(D6i,{children:ie})]}),s.jsx(Qt,{style:{padding:`${o.sp1} ${o.sp2}`,backgroundColor:m.colors.champion,borderColor:m.colors.champion,color:m.mode==="light"?Qn.primary:Rt.primary,height:"30px",width:o.sp7},label:gn.view,size:"small",onClick:()=>{d(ge?"management":"onboarding")}})]}):null,v.fetchState==="Error"||I==="Error"||L.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?s.jsxs(IW,{children:[s.jsx(jW,{children:s.jsxs(e$e,{children:[s.jsx(LW,{}),s.jsx(oo,{children:tl.customer.emailgroupAPIError})]})}),s.jsx(Qt,{style:{padding:`${o.sp1} ${o.sp2}`,backgroundColor:m.colors.champion,borderColor:m.colors.champion,color:m.mode==="light"?Qn.primary:Rt.primary},label:tl.customer.tryAgainText,size:"small",onClick:Ne})]}):null,L.fetchState==="Error"&&e.error!=null&&e.error?.code===406?s.jsxs(IW,{children:[s.jsx(LW,{}),s.jsxs(jW,{children:[s.jsx(oo,{children:G!==Po.empty?tl.customer.preOnboardingError:tl.customer.preOnboardingSaveError}),G!==Po.empty?s.jsx(Qt,{style:{padding:`${o.sp1} ${o.sp2}`,backgroundColor:m.colors.champion,borderColor:m.colors.champion,color:m.mode==="light"?Qn.primary:Rt.primary},label:G,size:"small",onClick:$e}):null]})]}):null,s.jsx(bZe,{groupEmailAdditionalLabel:N,groupNameAdditionalLabel:T,labelWidth:x,localData:e,ref:xe,sectionId:_u}),s.jsx(yZe,{localData:e,onboardedCompanies:S.companies,isSubsidiary:J,labelWidth:x,largeLabelWidth:y,extraLargeLabelWidth:b,realmIdAdditionalLabel:F,productsAdditionalLabel:V,ref:me,sectionId:An,isDisabled:E===!1?"disabled":void 0}),s.jsx(B6i,{children:s.jsx(h6i,{isSectionDisabled:Oe(v,A),sectionId:wZe,isLoading:r===!0||P?.fetchState==="In-Progress"||P?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:h,isConnected:D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:D?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||D?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:P?.saveConnectionState})})]})})]}),s.jsx(Gl,{formId:`${XAe}_form`,primaryBtn:{label:D?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?gn.texts.resendInvite:gn.texts.sendInvite,style:{width:cb.buttonWidth.value(f),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:L.fetchState==="In-Progress",isDisabled:et},cancelBtn:{label:gn.save,style:{width:cb.buttonWidth.value(f),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(nv(w.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:I==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:Ze,reverseSpinnerColor:!1}})]})}const db=e=>{const{newOnboardingCustomerLocalData:t,onboardingCompletedCompanies:r}=e;let n;const a=r.companies.find(l=>l.companyInfo.companyId===t.parentCompanyId);return a!=null&&(n={label:a.companyInfo.name,value:a.companyInfo.companyId}),{[I6i]:{companyDomain:t.companyEmailDomain??Po.empty},[_u]:{groupName:t.groupName??Po.empty,groupEmail:t.groupId??Po.empty,groupDescription:t.groupDescription??Po.empty},[An]:{name:t.name??Po.empty,entityType:{allOptions:[{label:gn.texts.parent,value:gn.texts.parent},{label:gn.texts.subsidiary,value:gn.texts.subsidiary}],selectedOption:t.isSubsidiary===!0?{label:gn.texts.subsidiary,value:gn.texts.subsidiary}:{label:gn.texts.parent,value:gn.texts.parent}},company:{selectedOption:n,allOptions:r.companies.map(l=>({label:l.companyInfo.name,value:l.companyInfo.companyId}))},realmId:t.qboRealmId??Po.empty,confirmRealmId:t.qboRealmId??Po.empty,chargebeeId:t.chargebeeId??Po.empty,hubSpotId:t.hubSpotId??Po.empty,email:t.email??Po.empty,customerName:t.customerName??{firstName:Po.empty,lastName:Po.empty},products:{allOptions:pj(e.allProductsList,t.selectedProducts??[]),selectedOptions:t.selectedProducts??[]}},[wZe]:{accountingConnectionCreationMode:t.accountingConnectionCreationMode}}},j6i=i.div`
95293
+ `,{common:gn,cockpit:{onboarding:tl}}=W.getLocalizedStrings(),E6i=gn.no,L6i=gn.yes,Po=gn.strings,XAe="onboardingCustomerPage",I6i="companySection",_u="groupSection",An="customerSection",wZe="qboConnectionSection",cb={labelWidth:new j(120,180),largeLabelWidth:new j(120,210,210),extraLargeLabelWidth:new j(240,240,240),buttonWidth:new j(135,135)};function t4n({localData:e,screenType:t,qboConnectClicked:r,analytics:n,onOnboardingCustomerDataUpdated:a,onCloseClick:l,onSaveClick:c,onViewClick:d,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:u,onQBOConnectClick:h}){const m=lt(),f=Me(),x=cb.labelWidth.value(f),y=cb.largeLabelWidth.value(f),b=cb.extraLargeLabelWidth.value(f),w=Oi({mode:"all",reValidateMode:"onChange",defaultValues:g.useMemo(()=>db(e),[e])}),{emailGroupFetchState:v,newOnboardingCustomerLocalData:A,onboardingCompletedCompanies:S,isOnboardingAllowedForUser:E,fetchState:I,sendInviteFetchState:L,uiState:B,companyView:D,externalConnections:P}=e,[T,R]=g.useState(Po.empty),[N,K]=g.useState(Po.empty),[q]=g.useState(Po.empty),[F,_]=g.useState(Po.empty),[V,O]=g.useState(Po.empty),[z,H]=g.useState(!1),[ee,Y]=g.useState(!1),[G,X]=g.useState(tl.customer.completePreOnboardingText),[J,ae]=g.useState(!1),xe=g.useRef(null),me=g.useRef(null),de=g.useRef(null),{isExistingCustomer:ce,isCustomerOnboardedSuccessfully:ge}=P6i(e),be=ce&&ge?tl.customer.customerNameExistInManagementText:tl.customer.customerNameExistInOnboardingText,ie=g.useMemo(()=>be.replace("_company-domain_",A.companyEmailDomain??Po.empty),[v.fetchState]),ne=D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,fe=g.useCallback(()=>{const He=w.getValues();return He[An].realmId!==He[An].confirmRealmId?(_(tl.customer.realmIdWarning),w.trigger(`${An}.confirmRealmId`),!1):(_(Po.empty),w.clearErrors(`${An}.confirmRealmId`),!0)},[w]),ve=g.useCallback(()=>{const He=w.getValues();return He[An].entityType.selectedOption?.value=="Subsidiary"&&He[An].company.selectedOption==null?(w.setError("customerSection.company",{type:"required"}),!1):(w.clearErrors("customerSection.company"),!0)},[w]),re=g.useCallback(()=>A.customerName?.firstName&&!A.customerName?.lastName||!A.customerName?.firstName&&A.customerName?.lastName?(w.trigger(`${An}.customerName`),!1):(A.customerName?.firstName||A.customerName?.lastName)&&!A.email?(w.trigger(`${An}.email`),!1):(A.customerName?.firstName||A.customerName?.lastName)&&A.email&&A.selectedProducts?.length===0?(O(tl.customer.productsWarning),w.trigger(`${An}.products`),!1):!0,[w,A.customerName,A.email,A.selectedProducts]),he=g.useCallback(()=>fe()&&ve()&&re(),[ve,fe,re]),Ee=w.handleSubmit(()=>{X(tl.customer.completePreOnboardingText),he()&&Y(!0)},()=>{he(),console.warn("Onboarding customer form error")}),Be=w.getValues()[An].email??Po.empty,we=(He=!1)=>{const bt={companyDomain:A.companyEmailDomain??Po.empty,primaryContactEmail:Be},Mt={groupName:A.groupName??Po.empty,groupEmail:A.groupId??Po.empty,groupDescription:A.groupDescription??Po.empty},Ft={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:Be,companyName:A.name??Po.empty,entittyType:A.isSubsidiary===!0?gn.texts.subsidiary:gn.texts.parent??Po.empty,chargebeeId:A.chargebeeId??Po.empty,products:A.selectedProducts??[],qboRealmId:A.qboRealmId??Po.empty,hubSpotId:A.hubSpotId},pt={isSendInvite:He,isInviteAlreadySent:D?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:A.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:A.accountingConnectionCreationMode==="customer",qboConnectionStatus:D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};n?.trackOnboardingSaveOrSendInvite(bt,Mt,Ft,pt)},Pe=()=>{const He={companyEmailDomain:A.companyEmailDomain??Po.empty,primaryContactEmail:Be},bt={groupName:A.groupName??Po.empty,groupEmail:A.groupId??Po.empty,groupDescription:A.groupDescription??Po.empty,isCompanyEmailDomainAvailable:!0};n?.trackOnboardingNewCustomerGroupCreationCheck(He,bt)},ze=()=>{let He=!0;const bt=w.getValues();if(bt[_u].groupEmail!==Po.empty&&bt[_u].groupName===Po.empty)R(tl.customer.groupNameWarning),w.setError("groupSection.groupName",{type:"required"}),He=!1;else if(bt[_u].groupName!==Po.empty&&bt[_u].groupEmail===Po.empty)K(tl.customer.groupEmailWarning),w.setError("groupSection.groupEmail",{type:"required"}),He=!1;else{const{error:Mt}=w.getFieldState("groupSection.groupName"),{error:Ft}=w.getFieldState("groupSection.groupEmail");(Mt==null||Mt.type==="required")&&(Ft==null||Ft.type==="required")&&(He=!1,w.clearErrors("groupSection")),R(Po.empty),K(Po.empty)}return He},tt={onOkClick:()=>{H(!1),w.reset(),l()},onCancelClick:()=>{H(!1)}},Ue={onOkClick:()=>{Y(!1),c(!0),we(!0)},onCancelClick:()=>{Y(!1)}},je=async(He,bt)=>{const Mt={...bt};if(He.includes("groupName")&&bt[_u].groupName!=Po.empty&&(bt[_u].groupName=bt[_u].groupName.charAt(0).toUpperCase()+bt[_u].groupName.slice(1)),(He.includes("groupName")||He.includes("groupEmail"))&&ze(),He.includes("confirmRealmId")&&_(Po.empty),He.includes("products")&&Eo(A.selectedProducts??[],bt[An].products.selectedOptions)===!1){O(Po.empty);const Ft=T6i(A.selectedProducts??[],bt[An].products.selectedOptions.map(ut=>PXe(ut)).filter(ut=>ut!=null));Mt[An].products.selectedOptions=Ft;const pt=pj(e.allProductsList,Ft);w.setValue(`${An}.products`,{allOptions:pt,selectedOptions:Ft})}He.includes("realmId")&&Xt(w.formState.errors,`${An}.confirmRealmId`)&&w.trigger(`${An}.confirmRealmId`),a(Mt)},_e=He=>{const{dirtyFields:bt}=w.formState;bt.companySection?.companyDomain===!0&&p(He)},$e=()=>{Object.keys(w.formState.errors).length===0&&(u?.(),X(Po.empty))},Ne=()=>{v.fetchState==="Error"?p(A.companyEmailDomain):he()&&Object.keys(w.formState.errors).length===0&&(c(L.fetchState==="Error"),we())},Ze=()=>{he()&&Object.keys(w.formState.errors).length===0&&(c(!1),we())};g.useEffect(()=>{const He=w.watch((bt,{name:Mt})=>{Mt!=null&&bt!=null&&Qa(()=>je(Mt,bt))});return()=>{He.unsubscribe()}}),g.useEffect(()=>{A.isCustomerCreationDisabled===!0&&(w.resetField("customerSection",{defaultValue:db(e)[An],keepDirty:!0}),w.clearErrors("customerSection"))},[A.isCustomerCreationDisabled]),g.useEffect(()=>{ae(A.isSubsidiary===!0),A.isSubsidiary!==!0&&w.resetField("customerSection.company",{defaultValue:db(e)[An].company,keepDirty:!0}),w.resetField("customerSection.entityType",{defaultValue:db(e)[An].entityType,keepDirty:!0})},[A.isSubsidiary]),g.useEffect(()=>{v.fetchState==="Completed"&&(w.reset(db(e)),ce||Pe())},[v.fetchState]),g.useEffect(()=>{B.selectedStep==="STEP_1"?xe.current?.scrollIntoView():B.selectedStep==="STEP_2"?me.current?.scrollIntoView():B.selectedStep==="STEP_3"&&de.current?.scrollIntoView()},[]),g.useEffect(()=>{const He=D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(P?.saveConnectionState==="Error"){const bt={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:w.getValues()[An].email??Po.empty,qboConnectionResponseMessage:gn.texts.unableToConnectQuickbooksPleaseTryAgain,isSuccess:!1};n?.trackOnboardingZeniManagedQBOConnection(bt)}else if(He??!1){const bt={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:w.getValues()[An].email??Po.empty,qboConnectionResponseMessage:gn.texts.congratulationsYouHaveSuccessfullyEstablishedAConnectionWith,isSuccess:!0};n?.trackOnboardingZeniManagedQBOConnection(bt)}},[P?.saveConnectionState,D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),g.useEffect(()=>{if(A.accountingConnectionCreationMode){const He=D?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??Po.empty;if(A.accountingConnectionCreationMode!==He){const bt={firstName:A.customerName?.firstName??Po.empty,lastName:A.customerName?.lastName??Po.empty,customerEmail:w.getValues()[An].email??Po.empty,isZeniOrCustomer:A.accountingConnectionCreationMode??Po.empty};n?.trackOnboardingQBOConnectionSelected(bt)}}},[A.accountingConnectionCreationMode]);const Oe=(He,bt)=>{const{fetchState:Mt}=He,{isEmailGroupCreated:Ft,selectedProducts:pt}=bt,ut=Mt!=="Completed"&&Ft==null,zt=pt==null||pt.length===0,Yt=(pt?.includes("zeni_checking")===!0||pt?.includes("zeni_treasury")===!0||pt?.includes("zeni_cards")===!0||pt?.includes("zeni_payroll")===!0||pt?.includes("zeni_cfo")===!0||pt?.includes("zeni_tax")===!0)&&pt?.includes("bookkeeping")===!1;return ut||zt||Yt},et=g.useMemo(()=>{const He=w.formState.isValid,bt=A.selectedProducts!=null&&(A.selectedProducts.includes("zeni_payroll")===!0||A.selectedProducts.includes("zeni_cfo")===!0||A.selectedProducts.includes("zeni_tax")===!0),Mt=A.selectedProducts!=null&&(A.selectedProducts.includes("zeni_checking")===!0||A.selectedProducts.includes("zeni_cards")===!0||bt)&&A.selectedProducts.includes("bookkeeping")===!1;return He!==!0||v.fetchState==="In-Progress"||v.fetchState==="Error"||I==="In-Progress"||I==="Error"||E!==!0||A.selectedProducts==null||A.selectedProducts.length===0||A.accountingConnectionCreationMode==null&&!Mt||A.accountingConnectionCreationMode==="zeni_user"&&ne!==!0&&!Mt||v.fetchState==="Completed"&&ce||D?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[v.fetchState,ce,E,I,w.formState.isValid,A.accountingConnectionCreationMode,ne,A.selectedProducts,D?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),mt=g.useMemo(()=>L.fetchState!=="In-Progress"&&L.fetchState!=="Error"&&I!=="In-Progress"&&I!=="Error"&&v.fetchState!=="In-Progress"&&ce===!0,[v.fetchState,ce,I,L.fetchState]);return s.jsxs(s.Fragment,{children:[z===!0?s.jsx(Qs,{titleComponent:s.jsx(Vs,{children:gn.confirmationPopup.discardTitle}),descriptionComponent:s.jsx(Us,{children:gn.confirmationPopup.discardDescription}),primaryButtonText:gn.confirmationPopup.discard,secondaryButtonText:gn.cancel,proceedButtonVariant:"destructive",action:tt,style:{background:k.overlayDark}}):null,ee===!0?s.jsx(Qs,{titleComponent:s.jsx(Vs,{style:{paddingLeft:o.sp6,paddingRight:o.sp6},children:tl.confirmationPopup.title}),descriptionComponent:s.jsx(Us,{children:tl.confirmationPopup.subTitle}),primaryButtonText:L6i,secondaryButtonText:E6i,action:Ue,style:{background:k.overlayDark}}):null,s.jsx(zD,{title:t==="create"?gn.texts.newCustomer:gn.texts.editCustomer,backgroundColor:m.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(w.formState.dirtyFields).length>0?H(!0):(w.reset(),l())}}),s.jsxs(j6i,{children:[s.jsx(M6i,{children:tl.customer.subTitle}),s.jsx(Fi,{...w,children:s.jsxs("form",{id:`${XAe}_form`,onSubmit:Ee,children:[s.jsx($7i,{localData:e,labelWidth:x,onCompanyDomainBlurred:_e,primaryEmailDomainAdditionalLabel:q,isOnboardingAllowedForUser:E}),mt===!0?s.jsxs(IW,{children:[s.jsxs(jW,{children:[s.jsxs(e$e,{children:[s.jsx(LW,{}),s.jsx(ue,{children:tl.customer.groupCreationError})]}),s.jsx(D6i,{children:ie})]}),s.jsx(Qt,{style:{padding:`${o.sp1} ${o.sp2}`,backgroundColor:m.colors.champion,borderColor:m.colors.champion,color:m.mode==="light"?Qn.primary:Rt.primary,height:"30px",width:o.sp7},label:gn.view,size:"small",onClick:()=>{d(ge?"management":"onboarding")}})]}):null,v.fetchState==="Error"||I==="Error"||L.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?s.jsxs(IW,{children:[s.jsx(jW,{children:s.jsxs(e$e,{children:[s.jsx(LW,{}),s.jsx(oo,{children:tl.customer.emailgroupAPIError})]})}),s.jsx(Qt,{style:{padding:`${o.sp1} ${o.sp2}`,backgroundColor:m.colors.champion,borderColor:m.colors.champion,color:m.mode==="light"?Qn.primary:Rt.primary},label:tl.customer.tryAgainText,size:"small",onClick:Ne})]}):null,L.fetchState==="Error"&&e.error!=null&&e.error?.code===406?s.jsxs(IW,{children:[s.jsx(LW,{}),s.jsxs(jW,{children:[s.jsx(oo,{children:G!==Po.empty?tl.customer.preOnboardingError:tl.customer.preOnboardingSaveError}),G!==Po.empty?s.jsx(Qt,{style:{padding:`${o.sp1} ${o.sp2}`,backgroundColor:m.colors.champion,borderColor:m.colors.champion,color:m.mode==="light"?Qn.primary:Rt.primary},label:G,size:"small",onClick:$e}):null]})]}):null,s.jsx(bZe,{groupEmailAdditionalLabel:N,groupNameAdditionalLabel:T,labelWidth:x,localData:e,ref:xe,sectionId:_u}),s.jsx(yZe,{localData:e,onboardedCompanies:S.companies,isSubsidiary:J,labelWidth:x,largeLabelWidth:y,extraLargeLabelWidth:b,realmIdAdditionalLabel:F,productsAdditionalLabel:V,ref:me,sectionId:An,isDisabled:E===!1?"disabled":void 0}),s.jsx(B6i,{children:s.jsx(h6i,{isSectionDisabled:Oe(v,A),sectionId:wZe,isLoading:r===!0||P?.fetchState==="In-Progress"||P?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:h,isConnected:D?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:D?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||D?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:P?.saveConnectionState})})]})})]}),s.jsx(Gl,{formId:`${XAe}_form`,primaryBtn:{label:D?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?gn.texts.resendInvite:gn.texts.sendInvite,style:{width:cb.buttonWidth.value(f),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:L.fetchState==="In-Progress",isDisabled:et},cancelBtn:{label:gn.save,style:{width:cb.buttonWidth.value(f),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(nv(w.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:I==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:Ze,reverseSpinnerColor:!1}})]})}const db=e=>{const{newOnboardingCustomerLocalData:t,onboardingCompletedCompanies:r}=e;let n;const a=r.companies.find(l=>l.companyInfo.companyId===t.parentCompanyId);return a!=null&&(n={label:a.companyInfo.name,value:a.companyInfo.companyId}),{[I6i]:{companyDomain:t.companyEmailDomain??Po.empty},[_u]:{groupName:t.groupName??Po.empty,groupEmail:t.groupId??Po.empty,groupDescription:t.groupDescription??Po.empty},[An]:{name:t.name??Po.empty,entityType:{allOptions:[{label:gn.texts.parent,value:gn.texts.parent},{label:gn.texts.subsidiary,value:gn.texts.subsidiary}],selectedOption:t.isSubsidiary===!0?{label:gn.texts.subsidiary,value:gn.texts.subsidiary}:{label:gn.texts.parent,value:gn.texts.parent}},company:{selectedOption:n,allOptions:r.companies.map(l=>({label:l.companyInfo.name,value:l.companyInfo.companyId}))},realmId:t.qboRealmId??Po.empty,confirmRealmId:t.qboRealmId??Po.empty,chargebeeId:t.chargebeeId??Po.empty,hubSpotId:t.hubSpotId??Po.empty,email:t.email??Po.empty,customerName:t.customerName??{firstName:Po.empty,lastName:Po.empty},products:{allOptions:pj(e.allProductsList,t.selectedProducts??[]),selectedOptions:t.selectedProducts??[]}},[wZe]:{accountingConnectionCreationMode:t.accountingConnectionCreationMode}}},j6i=i.div`
95295
95294
  display: flex;
95296
95295
  justify-content: flex-start;
95297
95296
  height: 100%;
@@ -95594,7 +95593,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
95594
95593
  `,B8i=i(nn)`
95595
95594
  width: ${o.sp10};
95596
95595
  height: ${o.sp10};
95597
- `,{dateFormat:{visual:{MMSlashYYYYFormat:D8i}},cockpit:{monthEndReport:{insightsNotAvailable:P8i,agentInsights:{regenerateTitle:T8i,regenerateDescription:z8i,regenerateConfirm:R8i}}},common:{errorMessage:{somethingWentWrong:F8i},cancel:O8i}}=W.getLocalizedStrings(),a$e=({message:e,onReload:t})=>s.jsxs(M8i,{onClick:t,children:[s.jsx(B8i,{}),s.jsx(j8i,{children:e})]}),r4n=e=>{const{monthEndReportView:t,companyId:r,previewMode:n,onRefresh:a,onNavigateBack:l}=e,{openThread:c,setOpenThread:d}=g.useContext(Ni),p=Wr().subtract(1,"month").format(D8i),[u,h]=g.useState(!1),[m,f]=g.useState(!1),[x,y]=g.useState(0),[b,w]=g.useState({hasUnpersistedEdits:!1,isPending:!1}),v=b.isPending,[A,S]=g.useState(!1),E=g.useCallback(()=>{y(N=>N+1),a()},[a]),I=g.useCallback(()=>{if(v){S(!0);return}E()},[v,E]);g.useEffect(()=>{A&&!v&&(S(!1),E())},[A,v,E]);const L=()=>{if(t.agentInsightsEditedAt!=null||b.hasUnpersistedEdits){f(!0);return}I()};if(t.fetchState==="Not-Started"||t.fetchState==="In-Progress"||t.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||t.companyMonthEndReportTemplatesData.fetchState==="In-Progress")return s.jsx(RS,{children:s.jsx(I8i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})})});if(t.fetchState==="Error"||t.companyMonthEndReportTemplatesData.fetchState==="Error")return s.jsx(RS,{children:s.jsx(a$e,{onReload:a,message:F8i})});if(t.html==null)return s.jsx(RS,{children:s.jsx(a$e,{onReload:a,message:P8i})});const B={application:"cockpit",companyId:r,entityId:r,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:t.companyName,url:window.location.href,selectedRange:p},{url:D,...P}=B,T={...P},R=`cockpit_${r}`;return s.jsx(Cd,{id:R,children:s.jsxs(RS,{children:[s.jsx(CZe,{companyName:t.companyName,threadMetadata:T,onAllThreadsClick:()=>{c!=null&&d(null),h(!0)},onNavigateBack:l,onRefresh:L}),s.jsx(f8i,{...e,allThreadsSectionOpen:u,filterMetaData:T,newThreadMetadata:B,regenerationCount:x,onAgentInsightSaveStateChange:w,onCloseAllThreadsSection:()=>h(!1)},`${n}_${r}_${t.templateData?.insight_month_year??""}`),m?s.jsx(Qs,{titleComponent:s.jsx(Vs,{children:T8i}),descriptionComponent:s.jsx(Us,{children:z8i}),primaryButtonText:R8i,secondaryButtonText:O8i,primaryButtonWidth:168,secondaryButtonWidth:124,action:{onOkClick:()=>{f(!1),I()},onCancelClick:()=>f(!1),onClickAway:()=>f(!1)}}):null]})})},MW=i.div`
95596
+ `,{dateFormat:{visual:{MMSlashYYYYFormat:D8i}},cockpit:{monthEndReport:{insightsNotAvailable:P8i,agentInsights:{regenerateTitle:T8i,regenerateDescription:z8i,regenerateConfirm:R8i}}},common:{errorMessage:{somethingWentWrong:F8i},cancel:O8i}}=W.getLocalizedStrings(),a$e=({message:e,onReload:t})=>s.jsxs(M8i,{onClick:t,children:[s.jsx(B8i,{}),s.jsx(j8i,{children:e})]}),o4n=e=>{const{monthEndReportView:t,companyId:r,previewMode:n,onRefresh:a,onNavigateBack:l}=e,{openThread:c,setOpenThread:d}=g.useContext(Ni),p=Wr().subtract(1,"month").format(D8i),[u,h]=g.useState(!1),[m,f]=g.useState(!1),[x,y]=g.useState(0),[b,w]=g.useState({hasUnpersistedEdits:!1,isPending:!1}),v=b.isPending,[A,S]=g.useState(!1),E=g.useCallback(()=>{y(N=>N+1),a()},[a]),I=g.useCallback(()=>{if(v){S(!0);return}E()},[v,E]);g.useEffect(()=>{A&&!v&&(S(!1),E())},[A,v,E]);const L=()=>{if(t.agentInsightsEditedAt!=null||b.hasUnpersistedEdits){f(!0);return}I()};if(t.fetchState==="Not-Started"||t.fetchState==="In-Progress"||t.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||t.companyMonthEndReportTemplatesData.fetchState==="In-Progress")return s.jsx(RS,{children:s.jsx(I8i,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})})});if(t.fetchState==="Error"||t.companyMonthEndReportTemplatesData.fetchState==="Error")return s.jsx(RS,{children:s.jsx(a$e,{onReload:a,message:F8i})});if(t.html==null)return s.jsx(RS,{children:s.jsx(a$e,{onReload:a,message:P8i})});const B={application:"cockpit",companyId:r,entityId:r,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:t.companyName,url:window.location.href,selectedRange:p},{url:D,...P}=B,T={...P},R=`cockpit_${r}`;return s.jsx(Cd,{id:R,children:s.jsxs(RS,{children:[s.jsx(CZe,{companyName:t.companyName,threadMetadata:T,onAllThreadsClick:()=>{c!=null&&d(null),h(!0)},onNavigateBack:l,onRefresh:L}),s.jsx(f8i,{...e,allThreadsSectionOpen:u,filterMetaData:T,newThreadMetadata:B,regenerationCount:x,onAgentInsightSaveStateChange:w,onCloseAllThreadsSection:()=>h(!1)},`${n}_${r}_${t.templateData?.insight_month_year??""}`),m?s.jsx(Qs,{titleComponent:s.jsx(Vs,{children:T8i}),descriptionComponent:s.jsx(Us,{children:z8i}),primaryButtonText:R8i,secondaryButtonText:O8i,primaryButtonWidth:168,secondaryButtonWidth:124,action:{onOkClick:()=>{f(!1),I()},onCancelClick:()=>f(!1),onClickAway:()=>f(!1)}}):null]})})},MW=i.div`
95598
95597
  display: flex;
95599
95598
  justify-content: flex-end;
95600
95599
  align-items: center;
@@ -95717,7 +95716,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
95717
95716
  padding-bottom: ${o.sp5};
95718
95717
  `,X8i=i(qo)`
95719
95718
  color: ${e=>e.theme.colors.grey1};
95720
- `,{common:{strings:Zq,datePicker:e9i,texts:t9i,errorMessage:{somethingWentWrong:o9i}},dateFormat:Jq,cockpit:r9i}=W.getLocalizedStrings(),{slash:s$e}=Zq,{visual:{YYYYformat:i9i,MMMformat:n9i}}=Jq,a9i=({historicData:e,companyId:t,newThreadMetadata:r,containerRef:n,sortedThreads:a})=>{const{addThread:l,setOpenThread:c}=g.useContext(Ni),d=g.useRef(null),[p,u]=g.useState(),[h,m]=g.useState(!1),f="monthEndReportHistoricDataPage",x=CKe(JI,!1,!1),y=n.current?.getBoundingClientRect(),b=x!=null&&x.coords!=null&&y?{left:x.coords.left-y.left,top:x.coords.top-y.top}:void 0,w=Oi({mode:"all",defaultValues:l$e(e),values:l$e(e)}),v=()=>{d.current&&d.current.scrollIntoView({behavior:"smooth"})};g.useEffect(()=>{u(uke(e.attachmentFile))},[e.attachmentFile]);const A=g.useCallback(()=>{const S=window.getSelection()?.getRangeAt(0),E=wKe();if(!S||E==null)return;const I={...r,...E,startPath:E.startPath.join(),endPath:E.endPath.join()},L=`${Wi()}${Xo}`,B=`cockpit_${t}`;l(L,{type:"thread",visibility:"public",id:L,roomId:B,createdAt:new Date,updatedAt:new Date,comments:[],metadata:I,resolved:!1}),c(L)},[l,t,r,c]);return s.jsx(Fi,{...w,children:s.jsx("form",{id:s9i(f),children:s.jsxs(q8i,{children:[s.jsx(xKe,{previewMode:!0,subject:e.subject,sectionId:k8}),s.jsxs(N8i,{id:JI,ref:n,children:[s.jsxs(H8i,{className:"monthEndReportCanvasWrapper",children:[p!=null?s.jsx(_8i,{onClick:v,children:s.jsx(jKe,{loading:!1,fileSizeError:h,setFileSizeError:m})}):null,s.jsx(Fe,{style:{position:"relative"},dangerouslySetInnerHTML:{__html:AKe(e.concatenatedHtml)}}),p!=null?s.jsx(yKe,{ref:d,fileName:p.name,fileSize:mFe(p.data),isRemovable:!1}):null]}),b?s.jsx(IKe,{style:{zIndex:15},coords:b,alignment:x.alignment,onClick:A}):null,s.jsx(LKe,{canvasContainerRef:n,sortedThreads:a,editorMode:!1})]})]})})})},i4n=e=>{const{monthEndReportHistoricData:t,reportSentDate:r,onRefresh:n,onNavigateBack:a,onDateChange:l}=e,c=lt(),[d,p]=g.useState(!1),[u,h]=g.useState(),m=g.useRef(null),[f,x]=g.useState(0),[y,b]=g.useState(0),w=gKe(d,250),{data:v,companyId:A,companyName:S,firstMonthOfFY:E}=t,I=VQe(r.format(Jq.visual.MMMMFormat)),L=Number(r.format(i9i)),B=E>I?L-1:L;g.useEffect(()=>{const de=I>0?I-1:12;h(`${L0e(de.toString(),2,"0")}${s$e}${L}`)},[]);const D={application:"cockpit",companyId:A,entityId:A,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:S,url:window.location.href,selectedRange:u},{url:P,...T}=D,R={...T},N=t.fetchState==="Not-Started"||t.fetchState==="In-Progress",{threadsRefs:K,sortedThreads:q,threadsPositions:F,observer:_,unresolvedThreadsMap:V,handleRemoveFloatingThread:O}=vKe(R,m,!1,N),z=g.useRef(null),[H,ee]=g.useState(0),Y=g.useCallback(()=>{const de=K.current?.[K.current?.length-1];ee(window.scrollY+(de?.getBoundingClientRect()?.bottom??0))},[K]),G=g.useCallback(()=>{d?b(Math.min((window.innerWidth-$h)/2,window.innerWidth-$h-aA-C[4])):x(Math.min((window.innerWidth-$h)/2,window.innerWidth-$h-Z4))},[d]);g.useEffect(()=>{G()},[d,G]),g.useEffect(()=>(window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}),[G]),g.useEffect(()=>(window.addEventListener("scroll",Y),()=>window.removeEventListener("scroll",Y)),[Y]);const{openThread:X,setOpenThread:J}=g.useContext(Ni);g.useEffect(()=>{X!=null&&d&&p(!1)},[d,X,p]);const ae=CJr(E,t.historicReportSentDates),xe=g.useCallback((de,ce)=>{const ge=E>de?ce+1:ce;l(b9(ge,de-1));const be=de>0?de-1:12;h(`${L0e(be.toString(),2,"0")}${s$e}${ge}`)},[E,l]);if(t.fetchState==="Not-Started"||t.fetchState==="In-Progress")return s.jsxs(BW,{children:[s.jsx(MW,{children:s.jsx(DW,{onClick:a})}),s.jsx(GLr,{fetchState:t.fetchState,styles:{margin:o.sp0}})]});if(t.fetchState==="Error")return s.jsxs(BW,{children:[s.jsx(MW,{children:s.jsx(DW,{onClick:a})}),s.jsx(Iwe,{onReload:n,message:o9i})]});if(v?.concatenatedHtml==null)return s.jsxs(BW,{children:[s.jsx(MW,{children:s.jsx(DW,{onClick:a})}),s.jsx(Iwe,{onReload:n,message:r9i.monthEndReport.insightsNotAvailable})]});const me=`cockpit_${A}`;return s.jsx(Cd,{id:me,children:s.jsxs(V8i,{children:[s.jsx(CZe,{companyName:t.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:ae,label:`${r.format(n9i)} ${B}`,selectedMonth:{month:I,year:B},onChange:xe},threadMetadata:R,onAllThreadsClick:()=>{X!=null&&J(null),p(!0)}}),s.jsxs(Y8i,{ref:z,style:H>0?{height:H}:void 0,children:[s.jsx(U8i,{availableWidth:d?y:f}),s.jsxs(K8i,{children:[s.jsx(a9i,{historicData:v,newThreadMetadata:D,companyId:A,sortedThreads:q,containerRef:m}),s.jsxs(J8i,{children:[s.jsx(Eqe,{user:t.reportLastSentByUser}),s.jsx(Z8i,{}),s.jsxs(X8i,{children:[e9i.businessDay,Zq.space,t.data?.reportSentDate!=null?F$e(t.data.reportSentDate):null,":",Zq.space,t.data?.reportSentDate?.format(Jq.visual.MMMDFormat)]})]})]}),w?s.jsx(G8i,{allThreadsSectionOpen:d,children:s.jsx(See,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${c.colors.grey3}`,boxShadow:`${o.sp0} 1px 2px ${o.sp0} ${k.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${o.sp5} - ${o.sp5})`,backgroundColor:c.colors.background},threadsContainerStyle:{paddingBottom:o.sp5},collapsibleThreadStyle:{width:`calc(100% - ${o.sp4})`},allowComposer:!1,drawerTitle:t9i.comments,filter:R,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(de,ce)=>{J(ce);const ge=q.findIndex(be=>be[0]===ce);p(!1),K.current?.[ge]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):s.jsx($Ke,{observer:_,canvasContainerRef:m,sortedThreads:q,threadsPositions:F,threadsRefs:K,unresolvedThreadsMap:V,editorMode:!1,style:{minWidth:`${Z4}px`,position:"relative",height:"fit-content",width:"auto",top:`${m.current?.offsetTop}px`},handleRemoveFloatingThread:O})]})]})})},l$e=e=>({[k8]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),s9i=e=>`${e}_form`,l9i=e=>g.createElement("svg",{width:98,height:121,viewBox:"0 0 98 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M49.2796 0.921875C32.9744 0.921875 19.7096 14.1944 19.7096 30.5087C19.7125 35.7639 21.1132 40.9238 23.7681 45.459C26.423 49.9943 30.2365 53.7418 34.8175 56.317C34.4083 56.561 33.9588 56.7299 33.4901 56.8156C26.6518 57.6437 22.4965 58.8342 19.5952 60.7958C16.8429 62.6568 15.2375 65.1511 14.0552 69.4056C14.0509 69.4209 14.0466 69.4363 14.0431 69.4518L10.0918 85.7362C9.51826 88.1132 9.82738 90.6176 10.9617 92.7837C12.0961 94.9499 13.9785 96.6304 16.2589 97.5129L20.1569 99.0144H10.7796C7.99797 99.0144 5.33033 100.119 3.36345 102.086C1.39658 104.053 0.291567 106.721 0.291504 109.502V110.435C0.291815 113.216 1.39693 115.884 3.36378 117.85C5.33063 119.817 7.99813 120.922 10.7796 120.922H53.2747C53.6551 120.922 54.0199 120.771 54.2889 120.502C54.5579 120.233 54.709 119.868 54.709 119.488C54.709 119.107 54.5579 118.742 54.2889 118.473C54.0199 118.204 53.6551 118.053 53.2747 118.053H34.0289C38.6739 116.234 43.0832 113.862 47.1618 110.989C59.9371 101.998 69.4844 101.883 69.5755 101.883H86.6115C88.6324 101.883 90.5704 102.686 91.9994 104.115C93.4283 105.544 94.2311 107.482 94.2311 109.502V110.435C94.2308 112.455 93.4279 114.393 91.999 115.822C90.5701 117.251 88.6322 118.053 86.6115 118.053H62.8365C62.4561 118.053 62.0913 118.204 61.8223 118.473C61.5533 118.742 61.4022 119.107 61.4022 119.488C61.4022 119.868 61.5533 120.233 61.8223 120.502C62.0913 120.771 62.4561 120.922 62.8365 120.922H86.6115C89.3932 120.922 92.0609 119.817 94.0278 117.85C95.9947 115.883 97.0996 113.215 97.0996 110.433V109.501C97.0996 106.72 95.9947 104.052 94.0278 102.085C92.0609 100.118 89.3932 99.013 86.6115 99.013H77.2552L81.1289 97.5124C83.4101 96.6305 85.2933 94.95 86.4283 92.7836C87.5633 90.6172 87.8728 88.1123 87.2993 85.7348L83.3471 69.4504C83.3435 69.4349 83.3393 69.42 83.335 69.4047C81.0779 61.2834 76.7211 58.4595 63.9108 56.8156C63.6617 56.7812 63.4178 56.7159 63.1848 56.6214C67.9202 54.1003 71.88 50.3378 74.6396 45.7373C77.3993 41.1368 78.8546 35.872 78.8496 30.5073C78.8496 14.1942 65.5848 0.921875 49.2796 0.921875ZM50.0808 3.84176C56.084 4.02211 61.8511 6.22111 66.4504 10.0835C71.0497 13.9459 74.2125 19.2461 75.4278 25.1278C76.6431 31.0094 75.84 37.1291 73.1483 42.498C70.4565 47.867 66.0332 52.1716 60.5931 54.7165C59.1024 53.1795 57.8049 51.1354 57.3184 49.7456C58.4778 48.8954 59.4906 47.8615 60.3167 46.6848C60.9625 46.9809 61.6621 47.1419 62.3724 47.1577C62.8095 47.1603 63.2432 47.0811 63.6512 46.9243C64.5464 46.5762 65.7044 45.6681 66.1373 43.3181C66.2624 42.9869 66.4272 42.6721 66.628 42.3806L66.7279 42.2148C68.7825 38.8099 69.2671 36.263 68.2103 34.43C67.7877 33.7064 67.1417 33.1394 66.3694 32.8142C66.4922 32.3725 66.5552 31.9163 66.5566 31.4579V29.7934C66.5566 24.4319 64.183 20.499 58.861 17.0401C58.612 16.8783 58.3989 16.667 58.235 16.4194C58.071 16.1718 57.9598 15.8931 57.9081 15.6007C57.125 11.0899 54.1033 8.50358 49.6158 8.50358H49.613C42.7338 8.50525 41.4374 13.4875 41.1983 15.6301C41.1628 15.9531 41.0576 16.2647 40.8901 16.5432C40.7227 16.8217 40.4968 17.0607 40.2282 17.2436C36.7881 19.5877 32.8393 23.1325 32.8393 29.7934V31.4579C32.8389 31.9742 32.9165 32.4876 33.0695 32.9808C32.4212 33.2864 31.8789 33.7785 31.5119 34.3941C30.4489 36.1843 30.9504 38.7427 33.0456 42.2153L33.133 42.36C33.3398 42.6607 33.5094 42.9854 33.6381 43.3269C33.9878 45.1621 34.9709 46.0635 35.7344 46.4966C36.4514 46.8873 37.2576 47.0851 38.074 47.0704C38.4264 47.0695 38.7782 47.0401 39.1259 46.9826C39.7172 47.7756 40.3958 48.4996 41.1489 49.141C40.3987 51.1167 38.8989 53.0103 37.368 54.4238C32.9251 52.2043 29.188 48.7913 26.5758 44.5673C23.9635 40.3432 22.5793 35.4752 22.5781 30.5087C22.5811 26.9366 23.3008 23.4015 24.6945 20.1126C26.0883 16.8237 28.1278 13.8479 30.6922 11.3613C33.2567 8.87477 36.294 6.92806 39.6244 5.63643C42.9547 4.34481 46.5104 3.73454 50.0808 3.84176V3.84176ZM49.6125 11.3716H49.6148C52.6985 11.3716 54.5375 12.9592 55.0811 16.0909C55.2008 16.7719 55.4592 17.4211 55.8404 17.998C56.2216 18.575 56.7174 19.0673 57.2969 19.4445C61.7759 22.3556 63.6871 25.4502 63.6871 29.793V31.4574C63.6872 31.8279 63.5967 32.1929 63.4235 32.5204C63.2502 32.8479 62.9995 33.1281 62.6931 33.3366V30.1506C62.6908 29.0631 62.4335 27.9912 61.9419 27.0212C61.4503 26.0511 60.7381 25.2098 59.8624 24.5648C57.1677 22.6285 53.7984 24.3061 53.6562 24.3785C53.605 24.4045 53.5554 24.4335 53.5077 24.4654C51.1056 26.0768 48.8478 26.0308 45.9671 24.3085C44.5197 23.32 41.5837 23.1611 39.9541 24.4266C38.9025 25.1029 38.0381 26.0333 37.4408 27.1317C36.8435 28.2302 36.5325 29.4614 36.5365 30.7118V33.2124C36.2772 32.9993 36.0684 32.7314 35.925 32.428C35.7816 32.1245 35.7073 31.793 35.7073 31.4574V29.793C35.7073 25.5322 37.4846 22.5834 41.8426 19.614C42.4535 19.1982 42.9671 18.6551 43.348 18.0219C43.7289 17.3888 43.9681 16.6806 44.0491 15.9462C44.3864 12.9103 46.258 11.3724 49.6125 11.3716ZM42.9781 26.3894C43.5413 26.3894 44.1076 26.5022 44.3521 26.6774C44.3832 26.6999 44.4156 26.7216 44.4478 26.7414C48.2475 29.0291 51.7046 29.0839 55.0125 26.9086C55.356 26.7553 57.0461 26.072 58.1756 26.8833C58.6864 27.2611 59.1017 27.7533 59.3881 28.3204C59.6746 28.8875 59.8242 29.5138 59.8251 30.1492V39.1638C59.8346 40.5106 59.5775 41.846 59.0687 43.0931C58.5599 44.3401 57.8093 45.4742 56.8603 46.4299C55.9113 47.3856 54.7826 48.1442 53.5392 48.6618C52.2957 49.1794 50.9622 49.4459 49.6153 49.4459C48.2684 49.4459 46.9349 49.1794 45.6914 48.6618C44.448 48.1442 43.3193 47.3856 42.3703 46.4299C41.4213 45.4742 40.6707 44.3401 40.1619 43.0931C39.6531 41.846 39.396 40.5106 39.4055 39.1638L39.4051 30.7118C39.4026 29.9319 39.5988 29.1642 39.9752 28.4812C40.3516 27.7981 40.8958 27.2222 41.5564 26.8077C41.6082 26.7751 41.6578 26.7393 41.7049 26.7003C41.9698 26.4814 42.4723 26.3894 42.9781 26.3894ZM64.8091 35.3101C64.9906 35.3368 65.165 35.3995 65.322 35.4944C65.4791 35.5893 65.6156 35.7146 65.7237 35.8629C65.8941 36.1581 66.2926 37.3823 64.2707 40.7329L64.1755 40.8922C63.8002 41.5108 63.4455 42.0954 63.316 42.798C63.1702 43.5909 62.9076 44.1338 62.6138 44.2495C62.3092 44.316 61.9912 44.2814 61.708 44.151C62.3602 42.5697 62.6953 40.8757 62.6941 39.1652V36.4316C63.4779 36.2303 64.2027 35.8459 64.8091 35.3101V35.3101ZM34.7204 35.4301C35.2551 35.8691 35.8732 36.1952 36.5375 36.3886V39.1652C36.536 40.8714 36.8691 42.5613 37.5179 44.1393C37.3892 44.1108 37.2652 44.0643 37.1495 44.0011C37.0209 43.9282 36.63 43.7063 36.4562 42.7896C36.3224 42.087 35.9653 41.4972 35.5869 40.873L35.5019 40.7329C33.8673 38.0236 33.6415 36.4418 33.9752 35.8652C34.0639 35.7464 34.1755 35.6466 34.3035 35.5719C34.4315 35.4971 34.5733 35.4489 34.7204 35.4301ZM43.572 50.7798C45.2964 51.6836 47.2015 52.1892 49.1472 52.2594C51.0929 52.3295 53.0295 51.9624 54.8145 51.185C55.503 52.7783 56.4174 54.2641 57.5294 55.5966C55.8184 62.7256 51.9726 67.8702 46.0773 70.8823C43.7618 72.0558 41.27 72.8428 38.7005 73.2121V57.0594C40.6315 55.4367 42.498 53.2058 43.572 50.7798ZM59.8769 57.9292C60.5403 58.4659 61.2737 58.9097 62.0568 59.2486C59.9126 69.1211 55.1295 77.1108 47.8239 83.0068C45.0554 85.2523 41.984 87.0961 38.7005 88.4838V84.0797C41.0671 83.8122 45.8154 82.543 51.2503 77.062C51.383 76.9283 51.4881 76.7698 51.5595 76.5954C51.6309 76.4211 51.6673 76.2344 51.6666 76.0461C51.6658 75.8577 51.628 75.6713 51.5552 75.4975C51.4824 75.3238 51.3761 75.1661 51.2424 75.0334C50.9723 74.7656 50.6069 74.616 50.2266 74.6176C49.8462 74.6192 49.4821 74.7718 49.2143 75.0418C44.594 79.7008 40.6461 80.8889 38.7005 81.1832V76.1086C41.683 75.7301 44.5792 74.8464 47.265 73.4955C51.6634 71.2764 57.241 66.7984 59.8769 57.9292ZM35.8339 58.9941V91.0545L33.4518 89.7005V80.5235C33.4518 80.1431 33.3007 79.7783 33.0317 79.5093C32.7628 79.2403 32.398 79.0892 32.0176 79.0892C31.6372 79.0892 31.2724 79.2403 31.0034 79.5093C30.7344 79.7783 30.5833 80.1431 30.5833 80.5235V88.0716L27.1783 86.1354L26.7446 60.8925C27.4993 60.7008 28.3155 60.524 29.199 60.3588L29.1995 60.3593V69.4906C29.1995 69.871 29.3506 70.2358 29.6196 70.5047C29.8885 70.7737 30.2533 70.9248 30.6337 70.9248C31.0141 70.9248 31.3789 70.7737 31.6479 70.5047C31.9169 70.2358 32.068 69.871 32.068 69.4906V59.8938C32.635 59.8141 33.2247 59.7373 33.837 59.6632C34.5352 59.5528 35.2101 59.3267 35.8339 58.9941V58.9941ZM64.8642 59.841C66.498 60.0748 67.9475 60.3316 69.2384 60.6147C69.0142 63.3677 67.9385 70.5555 62.8514 75.4279C62.7154 75.5582 62.6063 75.714 62.5305 75.8864C62.4546 76.0589 62.4135 76.2446 62.4094 76.4329C62.4054 76.6212 62.4384 76.8085 62.5067 76.9841C62.575 77.1596 62.6772 77.32 62.8075 77.4561C62.9378 77.5921 63.0936 77.7012 63.2661 77.777C63.4385 77.8528 63.6242 77.894 63.8125 77.898C64.0008 77.9021 64.1881 77.8691 64.3637 77.8008C64.5392 77.7324 64.6996 77.6302 64.8357 77.4999C70.3593 72.2111 71.7222 64.7855 72.0583 61.3505C73.3289 61.7263 74.5513 62.2488 75.701 62.9075C75.6503 65.9403 74.7925 77.8281 64.76 84.4532C64.5999 84.5557 64.4618 84.689 64.3537 84.8453C64.2455 85.0016 64.1696 85.1779 64.1301 85.3639C64.0907 85.5498 64.0887 85.7418 64.1241 85.9285C64.1595 86.1153 64.2317 86.2931 64.3365 86.4517C64.4413 86.6103 64.5765 86.7465 64.7344 86.8524C64.8923 86.9583 65.0696 87.0317 65.2561 87.0685C65.4426 87.1052 65.6346 87.1045 65.8208 87.0664C66.007 87.0283 66.1838 86.9535 66.3409 86.8465C71.6878 83.3153 75.4975 77.9065 77.3575 71.2059C77.8907 69.2799 78.2534 67.3108 78.4416 65.3213C79.4455 66.6635 80.0371 68.2544 80.5654 70.1498L84.512 86.4113C84.9225 88.1121 84.7011 89.904 83.8891 91.4537C83.077 93.0034 81.7296 94.2053 80.0976 94.8358L69.314 99.013H62.5825C62.5992 98.5058 62.4787 98.0035 62.2337 97.5591C61.7499 96.6821 61.1164 95.8965 60.362 95.2377L62.8458 93.7904C65.7686 95.2672 69.0004 96.0285 72.275 96.0114C72.6684 96.0114 73.0714 96.0007 73.4819 95.9777C73.6716 95.9697 73.8579 95.924 74.0299 95.8434C74.2018 95.7628 74.3561 95.6488 74.4837 95.5081C74.6112 95.3674 74.7096 95.2027 74.773 95.0237C74.8364 94.8446 74.8636 94.6548 74.8531 94.4652C74.8426 94.2755 74.7945 94.0899 74.7116 93.919C74.6287 93.7481 74.5127 93.5953 74.3703 93.4696C74.228 93.3439 74.062 93.2477 73.8822 93.1867C73.7023 93.1256 73.5121 93.1009 73.3227 93.1139C70.8018 93.2547 68.2788 92.8773 65.9095 92.005L74.692 86.8875C75.0183 86.6948 75.2549 86.3808 75.3504 86.0141C75.4459 85.6474 75.3924 85.2578 75.2015 84.9304C75.0107 84.6031 74.6981 84.3645 74.332 84.2669C73.9659 84.1693 73.576 84.2205 73.2475 84.4093L57.5066 93.5817C56.1863 93.1236 54.7739 92.9966 53.3931 93.2117C52.0124 93.4269 50.7055 93.9776 49.5873 94.8157L48.6643 95.5001C48.5304 95.4205 48.3911 95.3438 48.2422 95.2723C47.9751 95.1448 47.7037 95.0231 47.428 94.9067C56.5064 90.843 59.3085 85.1014 59.4385 84.8249C59.595 84.4822 59.6103 84.0917 59.4813 83.7378C59.3522 83.3838 59.0891 83.0949 58.7488 82.9334C58.4084 82.7719 58.0182 82.7507 57.6624 82.8745C57.3066 82.9984 57.0138 83.2572 56.8473 83.5951C56.8392 83.6116 56.0169 85.2804 53.8191 87.3596C51.8123 89.2583 48.215 91.8914 42.4529 93.732C41.8642 93.7075 41.2745 93.7357 40.6908 93.8161L38.7005 92.6844V91.5671C42.6145 90.0729 46.2659 87.9655 49.5177 85.324C54.9887 80.9385 62.0006 72.9935 64.8642 59.841ZM23.8891 61.7828L24.2795 84.4873L24.2048 84.4481C23.8664 84.265 23.4693 84.2235 23.1004 84.3327C22.7315 84.4419 22.4209 84.6929 22.2367 85.0306C22.0525 85.3684 22.0098 85.7654 22.1178 86.1347C22.2258 86.5039 22.4758 86.8153 22.813 87.0005L31.3032 91.7814C31.3173 91.7895 31.3311 91.7978 31.3457 91.8052L37.2705 95.1733C36.4189 95.8053 35.7066 96.6058 35.1779 97.525C35.1707 97.5369 35.1643 97.549 35.1574 97.5614C34.9113 98.0057 34.7871 98.5071 34.7974 99.0148H28.1392L17.2893 94.8353C15.6584 94.2042 14.3121 93.0023 13.501 91.453C12.6898 89.9038 12.469 88.1126 12.8796 86.4127L16.8257 70.1512C17.9834 65.9983 19.5804 63.4623 23.8891 61.7828ZM54.4854 95.989C55.5433 95.9455 56.5925 96.1967 57.5161 96.7145C58.4397 97.2322 59.2014 97.9963 59.7163 98.9214C59.7134 98.952 59.6656 99.0144 59.6379 99.0144H50.5122C50.5835 98.5926 50.5633 98.1605 50.4529 97.7472L51.3003 97.1193C52.2238 96.4302 53.334 96.0362 54.4854 95.989ZM41.9412 96.5926C42.1716 96.5887 42.4018 96.5962 42.6307 96.6127H42.6457H42.6471C44.1604 96.7679 45.6344 97.1896 47.0008 97.8584C47.1767 97.9369 47.3382 98.0442 47.4788 98.1758C47.5934 98.2908 47.721 98.4521 47.6763 98.5689C47.5938 98.7032 47.4786 98.8144 47.3414 98.892C47.2042 98.9697 47.0496 99.0113 46.892 99.013H37.6776V98.9705L37.6706 98.9439C38.7185 97.1942 40.3283 96.6203 41.9412 96.5926ZM10.7796 101.883H57.7358C53.4157 103.661 49.3139 105.93 45.5109 108.643C34.377 116.48 24.2433 117.936 23.334 118.053H10.7796C9.7789 118.053 8.78805 117.856 7.86358 117.473C6.93911 117.09 6.09912 116.529 5.39157 115.821C4.68403 115.114 4.12279 114.274 3.7399 113.349C3.35701 112.425 3.15997 111.434 3.16003 110.433V109.502C3.16003 107.482 3.9628 105.544 5.39174 104.115C6.82067 102.686 8.75873 101.883 10.7796 101.883V101.883ZM9.70899 105.504C9.3286 105.504 8.96379 105.655 8.69481 105.924C8.42584 106.193 8.27473 106.557 8.27473 106.938C8.27473 107.318 8.42584 107.683 8.69481 107.952C8.96379 108.221 9.3286 108.372 9.70899 108.372H10.3542C10.7346 108.372 11.0994 108.221 11.3684 107.952C11.6374 107.683 11.7885 107.318 11.7885 106.938C11.7885 106.557 11.6374 106.193 11.3684 105.924C11.0994 105.655 10.7346 105.504 10.3542 105.504H9.70899ZM14.982 105.504C14.6016 105.504 14.2368 105.655 13.9678 105.924C13.6988 106.193 13.5477 106.557 13.5477 106.938C13.5477 107.318 13.6988 107.683 13.9678 107.952C14.2368 108.221 14.6016 108.372 14.982 108.372H33.3192C33.6996 108.372 34.0644 108.221 34.3334 107.952C34.6024 107.683 34.7535 107.318 34.7535 106.938C34.7535 106.557 34.6024 106.193 34.3334 105.924C34.0644 105.655 33.6996 105.504 33.3192 105.504H14.982Z",fill:"#D4D8DD"})),{cockpit:{review:{reachedZeni:c9i}}}=W.getLocalizedStrings(),d9i=i.div`
95719
+ `,{common:{strings:Zq,datePicker:e9i,texts:t9i,errorMessage:{somethingWentWrong:o9i}},dateFormat:Jq,cockpit:r9i}=W.getLocalizedStrings(),{slash:s$e}=Zq,{visual:{YYYYformat:i9i,MMMformat:n9i}}=Jq,a9i=({historicData:e,companyId:t,newThreadMetadata:r,containerRef:n,sortedThreads:a})=>{const{addThread:l,setOpenThread:c}=g.useContext(Ni),d=g.useRef(null),[p,u]=g.useState(),[h,m]=g.useState(!1),f="monthEndReportHistoricDataPage",x=CKe(JI,!1,!1),y=n.current?.getBoundingClientRect(),b=x!=null&&x.coords!=null&&y?{left:x.coords.left-y.left,top:x.coords.top-y.top}:void 0,w=Oi({mode:"all",defaultValues:l$e(e),values:l$e(e)}),v=()=>{d.current&&d.current.scrollIntoView({behavior:"smooth"})};g.useEffect(()=>{u(uke(e.attachmentFile))},[e.attachmentFile]);const A=g.useCallback(()=>{const S=window.getSelection()?.getRangeAt(0),E=wKe();if(!S||E==null)return;const I={...r,...E,startPath:E.startPath.join(),endPath:E.endPath.join()},L=`${Wi()}${Xo}`,B=`cockpit_${t}`;l(L,{type:"thread",visibility:"public",id:L,roomId:B,createdAt:new Date,updatedAt:new Date,comments:[],metadata:I,resolved:!1}),c(L)},[l,t,r,c]);return s.jsx(Fi,{...w,children:s.jsx("form",{id:s9i(f),children:s.jsxs(q8i,{children:[s.jsx(xKe,{previewMode:!0,subject:e.subject,sectionId:k8}),s.jsxs(N8i,{id:JI,ref:n,children:[s.jsxs(H8i,{className:"monthEndReportCanvasWrapper",children:[p!=null?s.jsx(_8i,{onClick:v,children:s.jsx(jKe,{loading:!1,fileSizeError:h,setFileSizeError:m})}):null,s.jsx(Fe,{style:{position:"relative"},dangerouslySetInnerHTML:{__html:AKe(e.concatenatedHtml)}}),p!=null?s.jsx(yKe,{ref:d,fileName:p.name,fileSize:mFe(p.data),isRemovable:!1}):null]}),b?s.jsx(IKe,{style:{zIndex:15},coords:b,alignment:x.alignment,onClick:A}):null,s.jsx(LKe,{canvasContainerRef:n,sortedThreads:a,editorMode:!1})]})]})})})},r4n=e=>{const{monthEndReportHistoricData:t,reportSentDate:r,onRefresh:n,onNavigateBack:a,onDateChange:l}=e,c=lt(),[d,p]=g.useState(!1),[u,h]=g.useState(),m=g.useRef(null),[f,x]=g.useState(0),[y,b]=g.useState(0),w=gKe(d,250),{data:v,companyId:A,companyName:S,firstMonthOfFY:E}=t,I=VQe(r.format(Jq.visual.MMMMFormat)),L=Number(r.format(i9i)),B=E>I?L-1:L;g.useEffect(()=>{const de=I>0?I-1:12;h(`${L0e(de.toString(),2,"0")}${s$e}${L}`)},[]);const D={application:"cockpit",companyId:A,entityId:A,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:S,url:window.location.href,selectedRange:u},{url:P,...T}=D,R={...T},N=t.fetchState==="Not-Started"||t.fetchState==="In-Progress",{threadsRefs:K,sortedThreads:q,threadsPositions:F,observer:_,unresolvedThreadsMap:V,handleRemoveFloatingThread:O}=vKe(R,m,!1,N),z=g.useRef(null),[H,ee]=g.useState(0),Y=g.useCallback(()=>{const de=K.current?.[K.current?.length-1];ee(window.scrollY+(de?.getBoundingClientRect()?.bottom??0))},[K]),G=g.useCallback(()=>{d?b(Math.min((window.innerWidth-$h)/2,window.innerWidth-$h-aA-C[4])):x(Math.min((window.innerWidth-$h)/2,window.innerWidth-$h-Z4))},[d]);g.useEffect(()=>{G()},[d,G]),g.useEffect(()=>(window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}),[G]),g.useEffect(()=>(window.addEventListener("scroll",Y),()=>window.removeEventListener("scroll",Y)),[Y]);const{openThread:X,setOpenThread:J}=g.useContext(Ni);g.useEffect(()=>{X!=null&&d&&p(!1)},[d,X,p]);const ae=CJr(E,t.historicReportSentDates),xe=g.useCallback((de,ce)=>{const ge=E>de?ce+1:ce;l(b9(ge,de-1));const be=de>0?de-1:12;h(`${L0e(be.toString(),2,"0")}${s$e}${ge}`)},[E,l]);if(t.fetchState==="Not-Started"||t.fetchState==="In-Progress")return s.jsxs(BW,{children:[s.jsx(MW,{children:s.jsx(DW,{onClick:a})}),s.jsx(GLr,{fetchState:t.fetchState,styles:{margin:o.sp0}})]});if(t.fetchState==="Error")return s.jsxs(BW,{children:[s.jsx(MW,{children:s.jsx(DW,{onClick:a})}),s.jsx(Iwe,{onReload:n,message:o9i})]});if(v?.concatenatedHtml==null)return s.jsxs(BW,{children:[s.jsx(MW,{children:s.jsx(DW,{onClick:a})}),s.jsx(Iwe,{onReload:n,message:r9i.monthEndReport.insightsNotAvailable})]});const me=`cockpit_${A}`;return s.jsx(Cd,{id:me,children:s.jsxs(V8i,{children:[s.jsx(CZe,{companyName:t.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:ae,label:`${r.format(n9i)} ${B}`,selectedMonth:{month:I,year:B},onChange:xe},threadMetadata:R,onAllThreadsClick:()=>{X!=null&&J(null),p(!0)}}),s.jsxs(Y8i,{ref:z,style:H>0?{height:H}:void 0,children:[s.jsx(U8i,{availableWidth:d?y:f}),s.jsxs(K8i,{children:[s.jsx(a9i,{historicData:v,newThreadMetadata:D,companyId:A,sortedThreads:q,containerRef:m}),s.jsxs(J8i,{children:[s.jsx(Eqe,{user:t.reportLastSentByUser}),s.jsx(Z8i,{}),s.jsxs(X8i,{children:[e9i.businessDay,Zq.space,t.data?.reportSentDate!=null?F$e(t.data.reportSentDate):null,":",Zq.space,t.data?.reportSentDate?.format(Jq.visual.MMMDFormat)]})]})]}),w?s.jsx(G8i,{allThreadsSectionOpen:d,children:s.jsx(See,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${c.colors.grey3}`,boxShadow:`${o.sp0} 1px 2px ${o.sp0} ${k.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${o.sp5} - ${o.sp5})`,backgroundColor:c.colors.background},threadsContainerStyle:{paddingBottom:o.sp5},collapsibleThreadStyle:{width:`calc(100% - ${o.sp4})`},allowComposer:!1,drawerTitle:t9i.comments,filter:R,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(de,ce)=>{J(ce);const ge=q.findIndex(be=>be[0]===ce);p(!1),K.current?.[ge]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):s.jsx($Ke,{observer:_,canvasContainerRef:m,sortedThreads:q,threadsPositions:F,threadsRefs:K,unresolvedThreadsMap:V,editorMode:!1,style:{minWidth:`${Z4}px`,position:"relative",height:"fit-content",width:"auto",top:`${m.current?.offsetTop}px`},handleRemoveFloatingThread:O})]})]})})},l$e=e=>({[k8]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),s9i=e=>`${e}_form`,l9i=e=>g.createElement("svg",{width:98,height:121,viewBox:"0 0 98 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M49.2796 0.921875C32.9744 0.921875 19.7096 14.1944 19.7096 30.5087C19.7125 35.7639 21.1132 40.9238 23.7681 45.459C26.423 49.9943 30.2365 53.7418 34.8175 56.317C34.4083 56.561 33.9588 56.7299 33.4901 56.8156C26.6518 57.6437 22.4965 58.8342 19.5952 60.7958C16.8429 62.6568 15.2375 65.1511 14.0552 69.4056C14.0509 69.4209 14.0466 69.4363 14.0431 69.4518L10.0918 85.7362C9.51826 88.1132 9.82738 90.6176 10.9617 92.7837C12.0961 94.9499 13.9785 96.6304 16.2589 97.5129L20.1569 99.0144H10.7796C7.99797 99.0144 5.33033 100.119 3.36345 102.086C1.39658 104.053 0.291567 106.721 0.291504 109.502V110.435C0.291815 113.216 1.39693 115.884 3.36378 117.85C5.33063 119.817 7.99813 120.922 10.7796 120.922H53.2747C53.6551 120.922 54.0199 120.771 54.2889 120.502C54.5579 120.233 54.709 119.868 54.709 119.488C54.709 119.107 54.5579 118.742 54.2889 118.473C54.0199 118.204 53.6551 118.053 53.2747 118.053H34.0289C38.6739 116.234 43.0832 113.862 47.1618 110.989C59.9371 101.998 69.4844 101.883 69.5755 101.883H86.6115C88.6324 101.883 90.5704 102.686 91.9994 104.115C93.4283 105.544 94.2311 107.482 94.2311 109.502V110.435C94.2308 112.455 93.4279 114.393 91.999 115.822C90.5701 117.251 88.6322 118.053 86.6115 118.053H62.8365C62.4561 118.053 62.0913 118.204 61.8223 118.473C61.5533 118.742 61.4022 119.107 61.4022 119.488C61.4022 119.868 61.5533 120.233 61.8223 120.502C62.0913 120.771 62.4561 120.922 62.8365 120.922H86.6115C89.3932 120.922 92.0609 119.817 94.0278 117.85C95.9947 115.883 97.0996 113.215 97.0996 110.433V109.501C97.0996 106.72 95.9947 104.052 94.0278 102.085C92.0609 100.118 89.3932 99.013 86.6115 99.013H77.2552L81.1289 97.5124C83.4101 96.6305 85.2933 94.95 86.4283 92.7836C87.5633 90.6172 87.8728 88.1123 87.2993 85.7348L83.3471 69.4504C83.3435 69.4349 83.3393 69.42 83.335 69.4047C81.0779 61.2834 76.7211 58.4595 63.9108 56.8156C63.6617 56.7812 63.4178 56.7159 63.1848 56.6214C67.9202 54.1003 71.88 50.3378 74.6396 45.7373C77.3993 41.1368 78.8546 35.872 78.8496 30.5073C78.8496 14.1942 65.5848 0.921875 49.2796 0.921875ZM50.0808 3.84176C56.084 4.02211 61.8511 6.22111 66.4504 10.0835C71.0497 13.9459 74.2125 19.2461 75.4278 25.1278C76.6431 31.0094 75.84 37.1291 73.1483 42.498C70.4565 47.867 66.0332 52.1716 60.5931 54.7165C59.1024 53.1795 57.8049 51.1354 57.3184 49.7456C58.4778 48.8954 59.4906 47.8615 60.3167 46.6848C60.9625 46.9809 61.6621 47.1419 62.3724 47.1577C62.8095 47.1603 63.2432 47.0811 63.6512 46.9243C64.5464 46.5762 65.7044 45.6681 66.1373 43.3181C66.2624 42.9869 66.4272 42.6721 66.628 42.3806L66.7279 42.2148C68.7825 38.8099 69.2671 36.263 68.2103 34.43C67.7877 33.7064 67.1417 33.1394 66.3694 32.8142C66.4922 32.3725 66.5552 31.9163 66.5566 31.4579V29.7934C66.5566 24.4319 64.183 20.499 58.861 17.0401C58.612 16.8783 58.3989 16.667 58.235 16.4194C58.071 16.1718 57.9598 15.8931 57.9081 15.6007C57.125 11.0899 54.1033 8.50358 49.6158 8.50358H49.613C42.7338 8.50525 41.4374 13.4875 41.1983 15.6301C41.1628 15.9531 41.0576 16.2647 40.8901 16.5432C40.7227 16.8217 40.4968 17.0607 40.2282 17.2436C36.7881 19.5877 32.8393 23.1325 32.8393 29.7934V31.4579C32.8389 31.9742 32.9165 32.4876 33.0695 32.9808C32.4212 33.2864 31.8789 33.7785 31.5119 34.3941C30.4489 36.1843 30.9504 38.7427 33.0456 42.2153L33.133 42.36C33.3398 42.6607 33.5094 42.9854 33.6381 43.3269C33.9878 45.1621 34.9709 46.0635 35.7344 46.4966C36.4514 46.8873 37.2576 47.0851 38.074 47.0704C38.4264 47.0695 38.7782 47.0401 39.1259 46.9826C39.7172 47.7756 40.3958 48.4996 41.1489 49.141C40.3987 51.1167 38.8989 53.0103 37.368 54.4238C32.9251 52.2043 29.188 48.7913 26.5758 44.5673C23.9635 40.3432 22.5793 35.4752 22.5781 30.5087C22.5811 26.9366 23.3008 23.4015 24.6945 20.1126C26.0883 16.8237 28.1278 13.8479 30.6922 11.3613C33.2567 8.87477 36.294 6.92806 39.6244 5.63643C42.9547 4.34481 46.5104 3.73454 50.0808 3.84176V3.84176ZM49.6125 11.3716H49.6148C52.6985 11.3716 54.5375 12.9592 55.0811 16.0909C55.2008 16.7719 55.4592 17.4211 55.8404 17.998C56.2216 18.575 56.7174 19.0673 57.2969 19.4445C61.7759 22.3556 63.6871 25.4502 63.6871 29.793V31.4574C63.6872 31.8279 63.5967 32.1929 63.4235 32.5204C63.2502 32.8479 62.9995 33.1281 62.6931 33.3366V30.1506C62.6908 29.0631 62.4335 27.9912 61.9419 27.0212C61.4503 26.0511 60.7381 25.2098 59.8624 24.5648C57.1677 22.6285 53.7984 24.3061 53.6562 24.3785C53.605 24.4045 53.5554 24.4335 53.5077 24.4654C51.1056 26.0768 48.8478 26.0308 45.9671 24.3085C44.5197 23.32 41.5837 23.1611 39.9541 24.4266C38.9025 25.1029 38.0381 26.0333 37.4408 27.1317C36.8435 28.2302 36.5325 29.4614 36.5365 30.7118V33.2124C36.2772 32.9993 36.0684 32.7314 35.925 32.428C35.7816 32.1245 35.7073 31.793 35.7073 31.4574V29.793C35.7073 25.5322 37.4846 22.5834 41.8426 19.614C42.4535 19.1982 42.9671 18.6551 43.348 18.0219C43.7289 17.3888 43.9681 16.6806 44.0491 15.9462C44.3864 12.9103 46.258 11.3724 49.6125 11.3716ZM42.9781 26.3894C43.5413 26.3894 44.1076 26.5022 44.3521 26.6774C44.3832 26.6999 44.4156 26.7216 44.4478 26.7414C48.2475 29.0291 51.7046 29.0839 55.0125 26.9086C55.356 26.7553 57.0461 26.072 58.1756 26.8833C58.6864 27.2611 59.1017 27.7533 59.3881 28.3204C59.6746 28.8875 59.8242 29.5138 59.8251 30.1492V39.1638C59.8346 40.5106 59.5775 41.846 59.0687 43.0931C58.5599 44.3401 57.8093 45.4742 56.8603 46.4299C55.9113 47.3856 54.7826 48.1442 53.5392 48.6618C52.2957 49.1794 50.9622 49.4459 49.6153 49.4459C48.2684 49.4459 46.9349 49.1794 45.6914 48.6618C44.448 48.1442 43.3193 47.3856 42.3703 46.4299C41.4213 45.4742 40.6707 44.3401 40.1619 43.0931C39.6531 41.846 39.396 40.5106 39.4055 39.1638L39.4051 30.7118C39.4026 29.9319 39.5988 29.1642 39.9752 28.4812C40.3516 27.7981 40.8958 27.2222 41.5564 26.8077C41.6082 26.7751 41.6578 26.7393 41.7049 26.7003C41.9698 26.4814 42.4723 26.3894 42.9781 26.3894ZM64.8091 35.3101C64.9906 35.3368 65.165 35.3995 65.322 35.4944C65.4791 35.5893 65.6156 35.7146 65.7237 35.8629C65.8941 36.1581 66.2926 37.3823 64.2707 40.7329L64.1755 40.8922C63.8002 41.5108 63.4455 42.0954 63.316 42.798C63.1702 43.5909 62.9076 44.1338 62.6138 44.2495C62.3092 44.316 61.9912 44.2814 61.708 44.151C62.3602 42.5697 62.6953 40.8757 62.6941 39.1652V36.4316C63.4779 36.2303 64.2027 35.8459 64.8091 35.3101V35.3101ZM34.7204 35.4301C35.2551 35.8691 35.8732 36.1952 36.5375 36.3886V39.1652C36.536 40.8714 36.8691 42.5613 37.5179 44.1393C37.3892 44.1108 37.2652 44.0643 37.1495 44.0011C37.0209 43.9282 36.63 43.7063 36.4562 42.7896C36.3224 42.087 35.9653 41.4972 35.5869 40.873L35.5019 40.7329C33.8673 38.0236 33.6415 36.4418 33.9752 35.8652C34.0639 35.7464 34.1755 35.6466 34.3035 35.5719C34.4315 35.4971 34.5733 35.4489 34.7204 35.4301ZM43.572 50.7798C45.2964 51.6836 47.2015 52.1892 49.1472 52.2594C51.0929 52.3295 53.0295 51.9624 54.8145 51.185C55.503 52.7783 56.4174 54.2641 57.5294 55.5966C55.8184 62.7256 51.9726 67.8702 46.0773 70.8823C43.7618 72.0558 41.27 72.8428 38.7005 73.2121V57.0594C40.6315 55.4367 42.498 53.2058 43.572 50.7798ZM59.8769 57.9292C60.5403 58.4659 61.2737 58.9097 62.0568 59.2486C59.9126 69.1211 55.1295 77.1108 47.8239 83.0068C45.0554 85.2523 41.984 87.0961 38.7005 88.4838V84.0797C41.0671 83.8122 45.8154 82.543 51.2503 77.062C51.383 76.9283 51.4881 76.7698 51.5595 76.5954C51.6309 76.4211 51.6673 76.2344 51.6666 76.0461C51.6658 75.8577 51.628 75.6713 51.5552 75.4975C51.4824 75.3238 51.3761 75.1661 51.2424 75.0334C50.9723 74.7656 50.6069 74.616 50.2266 74.6176C49.8462 74.6192 49.4821 74.7718 49.2143 75.0418C44.594 79.7008 40.6461 80.8889 38.7005 81.1832V76.1086C41.683 75.7301 44.5792 74.8464 47.265 73.4955C51.6634 71.2764 57.241 66.7984 59.8769 57.9292ZM35.8339 58.9941V91.0545L33.4518 89.7005V80.5235C33.4518 80.1431 33.3007 79.7783 33.0317 79.5093C32.7628 79.2403 32.398 79.0892 32.0176 79.0892C31.6372 79.0892 31.2724 79.2403 31.0034 79.5093C30.7344 79.7783 30.5833 80.1431 30.5833 80.5235V88.0716L27.1783 86.1354L26.7446 60.8925C27.4993 60.7008 28.3155 60.524 29.199 60.3588L29.1995 60.3593V69.4906C29.1995 69.871 29.3506 70.2358 29.6196 70.5047C29.8885 70.7737 30.2533 70.9248 30.6337 70.9248C31.0141 70.9248 31.3789 70.7737 31.6479 70.5047C31.9169 70.2358 32.068 69.871 32.068 69.4906V59.8938C32.635 59.8141 33.2247 59.7373 33.837 59.6632C34.5352 59.5528 35.2101 59.3267 35.8339 58.9941V58.9941ZM64.8642 59.841C66.498 60.0748 67.9475 60.3316 69.2384 60.6147C69.0142 63.3677 67.9385 70.5555 62.8514 75.4279C62.7154 75.5582 62.6063 75.714 62.5305 75.8864C62.4546 76.0589 62.4135 76.2446 62.4094 76.4329C62.4054 76.6212 62.4384 76.8085 62.5067 76.9841C62.575 77.1596 62.6772 77.32 62.8075 77.4561C62.9378 77.5921 63.0936 77.7012 63.2661 77.777C63.4385 77.8528 63.6242 77.894 63.8125 77.898C64.0008 77.9021 64.1881 77.8691 64.3637 77.8008C64.5392 77.7324 64.6996 77.6302 64.8357 77.4999C70.3593 72.2111 71.7222 64.7855 72.0583 61.3505C73.3289 61.7263 74.5513 62.2488 75.701 62.9075C75.6503 65.9403 74.7925 77.8281 64.76 84.4532C64.5999 84.5557 64.4618 84.689 64.3537 84.8453C64.2455 85.0016 64.1696 85.1779 64.1301 85.3639C64.0907 85.5498 64.0887 85.7418 64.1241 85.9285C64.1595 86.1153 64.2317 86.2931 64.3365 86.4517C64.4413 86.6103 64.5765 86.7465 64.7344 86.8524C64.8923 86.9583 65.0696 87.0317 65.2561 87.0685C65.4426 87.1052 65.6346 87.1045 65.8208 87.0664C66.007 87.0283 66.1838 86.9535 66.3409 86.8465C71.6878 83.3153 75.4975 77.9065 77.3575 71.2059C77.8907 69.2799 78.2534 67.3108 78.4416 65.3213C79.4455 66.6635 80.0371 68.2544 80.5654 70.1498L84.512 86.4113C84.9225 88.1121 84.7011 89.904 83.8891 91.4537C83.077 93.0034 81.7296 94.2053 80.0976 94.8358L69.314 99.013H62.5825C62.5992 98.5058 62.4787 98.0035 62.2337 97.5591C61.7499 96.6821 61.1164 95.8965 60.362 95.2377L62.8458 93.7904C65.7686 95.2672 69.0004 96.0285 72.275 96.0114C72.6684 96.0114 73.0714 96.0007 73.4819 95.9777C73.6716 95.9697 73.8579 95.924 74.0299 95.8434C74.2018 95.7628 74.3561 95.6488 74.4837 95.5081C74.6112 95.3674 74.7096 95.2027 74.773 95.0237C74.8364 94.8446 74.8636 94.6548 74.8531 94.4652C74.8426 94.2755 74.7945 94.0899 74.7116 93.919C74.6287 93.7481 74.5127 93.5953 74.3703 93.4696C74.228 93.3439 74.062 93.2477 73.8822 93.1867C73.7023 93.1256 73.5121 93.1009 73.3227 93.1139C70.8018 93.2547 68.2788 92.8773 65.9095 92.005L74.692 86.8875C75.0183 86.6948 75.2549 86.3808 75.3504 86.0141C75.4459 85.6474 75.3924 85.2578 75.2015 84.9304C75.0107 84.6031 74.6981 84.3645 74.332 84.2669C73.9659 84.1693 73.576 84.2205 73.2475 84.4093L57.5066 93.5817C56.1863 93.1236 54.7739 92.9966 53.3931 93.2117C52.0124 93.4269 50.7055 93.9776 49.5873 94.8157L48.6643 95.5001C48.5304 95.4205 48.3911 95.3438 48.2422 95.2723C47.9751 95.1448 47.7037 95.0231 47.428 94.9067C56.5064 90.843 59.3085 85.1014 59.4385 84.8249C59.595 84.4822 59.6103 84.0917 59.4813 83.7378C59.3522 83.3838 59.0891 83.0949 58.7488 82.9334C58.4084 82.7719 58.0182 82.7507 57.6624 82.8745C57.3066 82.9984 57.0138 83.2572 56.8473 83.5951C56.8392 83.6116 56.0169 85.2804 53.8191 87.3596C51.8123 89.2583 48.215 91.8914 42.4529 93.732C41.8642 93.7075 41.2745 93.7357 40.6908 93.8161L38.7005 92.6844V91.5671C42.6145 90.0729 46.2659 87.9655 49.5177 85.324C54.9887 80.9385 62.0006 72.9935 64.8642 59.841ZM23.8891 61.7828L24.2795 84.4873L24.2048 84.4481C23.8664 84.265 23.4693 84.2235 23.1004 84.3327C22.7315 84.4419 22.4209 84.6929 22.2367 85.0306C22.0525 85.3684 22.0098 85.7654 22.1178 86.1347C22.2258 86.5039 22.4758 86.8153 22.813 87.0005L31.3032 91.7814C31.3173 91.7895 31.3311 91.7978 31.3457 91.8052L37.2705 95.1733C36.4189 95.8053 35.7066 96.6058 35.1779 97.525C35.1707 97.5369 35.1643 97.549 35.1574 97.5614C34.9113 98.0057 34.7871 98.5071 34.7974 99.0148H28.1392L17.2893 94.8353C15.6584 94.2042 14.3121 93.0023 13.501 91.453C12.6898 89.9038 12.469 88.1126 12.8796 86.4127L16.8257 70.1512C17.9834 65.9983 19.5804 63.4623 23.8891 61.7828ZM54.4854 95.989C55.5433 95.9455 56.5925 96.1967 57.5161 96.7145C58.4397 97.2322 59.2014 97.9963 59.7163 98.9214C59.7134 98.952 59.6656 99.0144 59.6379 99.0144H50.5122C50.5835 98.5926 50.5633 98.1605 50.4529 97.7472L51.3003 97.1193C52.2238 96.4302 53.334 96.0362 54.4854 95.989ZM41.9412 96.5926C42.1716 96.5887 42.4018 96.5962 42.6307 96.6127H42.6457H42.6471C44.1604 96.7679 45.6344 97.1896 47.0008 97.8584C47.1767 97.9369 47.3382 98.0442 47.4788 98.1758C47.5934 98.2908 47.721 98.4521 47.6763 98.5689C47.5938 98.7032 47.4786 98.8144 47.3414 98.892C47.2042 98.9697 47.0496 99.0113 46.892 99.013H37.6776V98.9705L37.6706 98.9439C38.7185 97.1942 40.3283 96.6203 41.9412 96.5926ZM10.7796 101.883H57.7358C53.4157 103.661 49.3139 105.93 45.5109 108.643C34.377 116.48 24.2433 117.936 23.334 118.053H10.7796C9.7789 118.053 8.78805 117.856 7.86358 117.473C6.93911 117.09 6.09912 116.529 5.39157 115.821C4.68403 115.114 4.12279 114.274 3.7399 113.349C3.35701 112.425 3.15997 111.434 3.16003 110.433V109.502C3.16003 107.482 3.9628 105.544 5.39174 104.115C6.82067 102.686 8.75873 101.883 10.7796 101.883V101.883ZM9.70899 105.504C9.3286 105.504 8.96379 105.655 8.69481 105.924C8.42584 106.193 8.27473 106.557 8.27473 106.938C8.27473 107.318 8.42584 107.683 8.69481 107.952C8.96379 108.221 9.3286 108.372 9.70899 108.372H10.3542C10.7346 108.372 11.0994 108.221 11.3684 107.952C11.6374 107.683 11.7885 107.318 11.7885 106.938C11.7885 106.557 11.6374 106.193 11.3684 105.924C11.0994 105.655 10.7346 105.504 10.3542 105.504H9.70899ZM14.982 105.504C14.6016 105.504 14.2368 105.655 13.9678 105.924C13.6988 106.193 13.5477 106.557 13.5477 106.938C13.5477 107.318 13.6988 107.683 13.9678 107.952C14.2368 108.221 14.6016 108.372 14.982 108.372H33.3192C33.6996 108.372 34.0644 108.221 34.3334 107.952C34.6024 107.683 34.7535 107.318 34.7535 106.938C34.7535 106.557 34.6024 106.193 34.3334 105.924C34.0644 105.655 33.6996 105.504 33.3192 105.504H14.982Z",fill:"#D4D8DD"})),{cockpit:{review:{reachedZeni:c9i}}}=W.getLocalizedStrings(),d9i=i.div`
95721
95720
  justify-content: center;
95722
95721
  align-items: center;
95723
95722
  display: flex;
@@ -96025,7 +96024,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
96025
96024
  height: calc(100vh - 60px);
96026
96025
  overflow-y: hidden;
96027
96026
  background-color: ${e=>e.theme.colors.grey4};
96028
- `,n4n=({headerData:e,headerActions:t,initialOpenThreadRequest:r,reviewPageActions:n,reviewPageData:a,analytics:l})=>{const{reviewView:c,zeniUserFetchState:d,allUsers:p,isReviewVendorColumnVisible:u}=a,{onColumnSortConfigChanged:h,onCockpitReloadData:m,onCompanyNameClicked:f,onClickAuditScore:x,onClickWarningsCount:y,onTransactionTagClicked:b,onRetryBankAccountConnection:w,onReviewVendorTagClicked:v,onUncategorizedAccountsErrorClick:A}=n,S=c.uiState.filterText,E=c.fetchState==="Completed",I=g.useMemo(()=>t.filterActions?{...t,filterActions:{...t.filterActions}}:t,[t]);return s.jsxs(Sxi,{children:[s.jsx(V2,{headerActions:I,headerData:{...e,allTabOptions:e.allTabOptions??n0,filterData:{filterText:S,disableFilters:!0},selectedTabOption:"audit",companiesLoaded:E}}),s.jsx(Exi,{allUsers:p,analytics:l,initialOpenThreadRequest:r,isReviewVendorColumnVisible:u,reviewView:c,zeniUserFetchState:d,onColumnSortConfigChanged:h,onCockpitReloadData:m,onCompanyNameClicked:f,onClickAuditScore:x,onClickWarningsCount:y,onRetryBankAccountConnection:w,onReviewVendorTagClicked:v,onTransactionTagClicked:b,onUncategorizedAccountsErrorClick:A})]})},Exi=({reviewView:e,zeniUserFetchState:t,allUsers:r,isReviewVendorColumnVisible:n,analytics:a,initialOpenThreadRequest:l,onClickAuditScore:c,onColumnSortConfigChanged:d,onCockpitReloadData:p,onCompanyNameClicked:u,onClickWarningsCount:h,onTransactionTagClicked:m,onRetryBankAccountConnection:f,onReviewVendorTagClicked:x,onUncategorizedAccountsErrorClick:y})=>{const b=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:p,selectedCockpitOption:"audit"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||t==="In-Progress"||t==="Not-Started"?s.jsx($xi,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?e.uiState.filterText.trim().length>0?s.jsx($p,{emptySearchTextFirstLine:Cxi,emptySearchTextSecondLine:Axi}):s.jsx(h9i,{}):s.jsx(kxi,{windowSize:b,children:s.jsx(xxi,{allUsers:r,analytics:a,initialOpenThreadRequest:l,isReviewVendorColumnVisible:n,reviewView:e,onColumnSortConfigChanged:d,onCompanyNameClicked:u,onClickAuditScore:c,onClickWarningsCount:h,onRetryBankAccountConnection:f,onReviewVendorTagClicked:x,onTransactionTagClicked:m,onUncategorizedAccountsErrorClick:y})})},{common:km,dateFormat:Lxi,cockpit:p$e}=W.getLocalizedStrings(),Ixi=i.div`
96027
+ `,i4n=({headerData:e,headerActions:t,initialOpenThreadRequest:r,reviewPageActions:n,reviewPageData:a,analytics:l})=>{const{reviewView:c,zeniUserFetchState:d,allUsers:p,isReviewVendorColumnVisible:u}=a,{onColumnSortConfigChanged:h,onCockpitReloadData:m,onCompanyNameClicked:f,onClickAuditScore:x,onClickWarningsCount:y,onTransactionTagClicked:b,onRetryBankAccountConnection:w,onReviewVendorTagClicked:v,onUncategorizedAccountsErrorClick:A}=n,S=c.uiState.filterText,E=c.fetchState==="Completed",I=g.useMemo(()=>t.filterActions?{...t,filterActions:{...t.filterActions}}:t,[t]);return s.jsxs(Sxi,{children:[s.jsx(V2,{headerActions:I,headerData:{...e,allTabOptions:e.allTabOptions??n0,filterData:{filterText:S,disableFilters:!0},selectedTabOption:"audit",companiesLoaded:E}}),s.jsx(Exi,{allUsers:p,analytics:l,initialOpenThreadRequest:r,isReviewVendorColumnVisible:u,reviewView:c,zeniUserFetchState:d,onColumnSortConfigChanged:h,onCockpitReloadData:m,onCompanyNameClicked:f,onClickAuditScore:x,onClickWarningsCount:y,onRetryBankAccountConnection:w,onReviewVendorTagClicked:v,onTransactionTagClicked:b,onUncategorizedAccountsErrorClick:A})]})},Exi=({reviewView:e,zeniUserFetchState:t,allUsers:r,isReviewVendorColumnVisible:n,analytics:a,initialOpenThreadRequest:l,onClickAuditScore:c,onColumnSortConfigChanged:d,onCockpitReloadData:p,onCompanyNameClicked:u,onClickWarningsCount:h,onTransactionTagClicked:m,onRetryBankAccountConnection:f,onReviewVendorTagClicked:x,onUncategorizedAccountsErrorClick:y})=>{const b=Me();return e.fetchState==="Error"?s.jsx(P3,{onCockpitReloadData:p,selectedCockpitOption:"audit"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||t==="In-Progress"||t==="Not-Started"?s.jsx($xi,{children:s.jsx(Ao,{size:"ExtraLarge",start:!0})}):e.companies.length===0?e.uiState.filterText.trim().length>0?s.jsx($p,{emptySearchTextFirstLine:Cxi,emptySearchTextSecondLine:Axi}):s.jsx(h9i,{}):s.jsx(kxi,{windowSize:b,children:s.jsx(xxi,{allUsers:r,analytics:a,initialOpenThreadRequest:l,isReviewVendorColumnVisible:n,reviewView:e,onColumnSortConfigChanged:d,onCompanyNameClicked:u,onClickAuditScore:c,onClickWarningsCount:h,onRetryBankAccountConnection:f,onReviewVendorTagClicked:x,onTransactionTagClicked:m,onUncategorizedAccountsErrorClick:y})})},{common:km,dateFormat:Lxi,cockpit:p$e}=W.getLocalizedStrings(),Ixi=i.div`
96029
96028
  display: flex;
96030
96029
  width: 100%;
96031
96030
  padding: ${o.sp3};
@@ -96295,7 +96294,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
96295
96294
  width: ${o.sp4};
96296
96295
  height: ${o.sp4};
96297
96296
  color: ${e=>e.theme.colors.grey2};
96298
- `,Xq={navBarHeight:new j(62,62,62),navBarPaddingLeft:new j(C[3],C[3],C[8]),navBarPaddingRight:new j(C[3],C[3],C[8])},{cockpit:{review:Yyi},timeFormat:Kyi,common:ub,dateFormat:zW}=W.getLocalizedStrings(),a4n=({isAuditScoreCompleted:e,auditRuleGroups:t,loggedInUser:r,isMonthEnd:n,auditReportGroupView:a,allUsers:l,reviewCompanyView:c,style:d,analytics:p,handleFetchAuditReportGroupView:u,handleGenerateAuditReport:h,handleCancelIconClick:m,handleRuleClick:f,handleReasonAuditRule:x})=>{const y=Me(),[b,w]=g.useState(RW(t,1)),[v,A]=g.useState({id:t[0]?.auditRuleGroupId,index:0}),[S,E]=g.useState(!1),[I,L]=g.useState(1),[B,D]=g.useState(!1),[P,T]=g.useState(null),R=g.useMemo(()=>c?.controllers.map(O=>`${O.user.firstName} ${O.user.middleName} ${O.user.lastName}`)??[],[c?.controllers]),N={fixesRequired:0,totalChecks:0,auditScorePercentage:0,bypassedAuditScore:0,auditReportLastGeneratedDate:null};g.useEffect(()=>{a.auditReportGroups.forEach(O=>{a.auditReportGroups.forEach(H=>{H.auditReportGroupId===v.id&&(H.fetchState==="Completed"||H.fetchState==="Error")&&A({id:t[v.index+1]?.auditRuleGroupId,index:v.index+1})});const z=O.auditReport?.auditRulesGroupReport.find(H=>H.auditRuleGroupId===O.auditReportGroupId);(O.fetchState==="Completed"&&v.id===O.auditReportGroupId&&b[O.auditReportGroupId].isActive===!0&&z?.sequence===I||O.fetchState==="Error"&&v.id===O.auditReportGroupId)&&(L(I+1),w(RW(t,I+1)))})},[a.auditReportGroups,I,t,b]),g.useEffect(()=>{if(a.auditReportGroups.filter(z=>z.fetchState==="In-Progress").length===0&&E(!0),a.auditReportGroups.filter(z=>z.fetchState==="Completed"||z.fetchState==="Error").length===t.length){D(!0);let z=0;a.auditReportGroups.forEach(X=>{z=z+SZe(X.auditReport?.auditRulesGroupReport[0]?.auditRules)});const H=qyi(a),ee=Wr().startOf("month").subtract(1,"date").format(zW.visual.MMMYYYYFormat),Y=c?.customerGroup,G=Math.ceil(a.auditReportGroups[0].auditReport?.auditSummary.auditScorePercentage??0);p.trackAuditScorePercentage(Wr().format(zW.analytics.MMSlashDDSlashYYYYFormat),ee,G,c?.name??"",H,z,R,Y??null)}const O=a.auditReportGroups.find(z=>z.fetchState==="Completed");O?.auditReport?.status?.lastRefreshSuccessTime!=null&&T(O)},[a.auditReportGroups,t.length,p,c,a,R]);const K=()=>{w(RW(t,1)),A({id:t[0]?.auditRuleGroupId,index:0}),E(!1),L(1),D(!1),T(null)},q=()=>{K();const O=t.map(z=>z.auditRuleGroupId);h(O)},F=()=>{m()},_=O=>{u(O)},V=(O,z,H)=>{p.trackAuditIssuesClicked(H,c?.name??"",R,Wr().format(zW.analytics.MMSlashDDSlashYYYYFormat)),f(O,z)};return s.jsxs(Zyi,{style:d,children:[s.jsx(tbi,{windowSize:y,style:d,children:s.jsx(obi,{children:s.jsxs(rbi,{windowSize:y,children:[s.jsx(Jyi,{}),s.jsxs(ibi,{children:[s.jsx(nbi,{children:c?.name}),s.jsx(abi,{children:B?P?.auditReport?.status?.lastRefreshSuccessTime?.utc(!0).local().format(Kyi.hmmADashDDMMMCommaYYYY):ub.strings.empty})]}),s.jsxs(lbi,{children:[s.jsxs(sbi,{isGenerateClickEnabled:S,onClick:q,children:[s.jsx(dbi,{}),s.jsx(cbi,{children:Yyi.auditReportDrawer.updateScore})]}),s.jsx(pbi,{onClick:F,children:s.jsx(ubi,{})})]})]})})}),s.jsxs(Xyi,{children:[s.jsx(ebi,{children:s.jsx(Nxi,{auditSummaryData:c!=null?c.auditSummary:N,isAuditScoreLoadingCompleted:B&&e,isMonthEnd:n})}),s.jsxs(g$e,{children:[s.jsx(f$e,{children:ub.texts.business}),s.jsx(x$e,{children:t.filter(O=>O.ruleType===ub.texts.business.toLowerCase()).map(O=>{const z=a.auditReportGroups.find(H=>H.auditReportGroupId===O.auditRuleGroupId);return z!=null&&Object.keys(b).length>0?s.jsx(h$e,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:l,isMonthEnd:n,ruleGroup:O,groupIdWithActiveStatus:b,auditReportGroup:z,setGroupIdWithActiveStatus:w,onClickRetryGroupFetch:_,onClickRule:V,handleReasonAuditRule:x},O.auditRuleGroupId):null})})]}),s.jsxs(g$e,{children:[s.jsx(f$e,{children:ub.settings.title.accounting}),s.jsx(x$e,{children:t.filter(O=>O.ruleType===ub.settings.title.accounting.toLowerCase()).map(O=>{const z=a.auditReportGroups.find(H=>H.auditReportGroupId===O.auditRuleGroupId);return z!=null&&Object.keys(b).length>0?s.jsx(h$e,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:l,isMonthEnd:n,ruleGroup:O,groupIdWithActiveStatus:b,auditReportGroup:z,setGroupIdWithActiveStatus:w,onClickRetryGroupFetch:_,onClickRule:V,handleReasonAuditRule:x},O.auditRuleGroupId):null})})]})]})]})},RW=(e,t)=>{const r={},n={};return e.forEach(a=>{const{ruleType:l,sequence:c}=a;n[l]===void 0?n[l]={first:c,last:c}:(c<n[l].first&&(n[l].first=c),c>n[l].last&&(n[l].last=c))}),e.forEach(a=>{const{auditRuleGroupId:l,ruleType:c,sequence:d}=a,p=d<=t,u=d===n[c].first,h=d===n[c].last;r[l]={isActive:p,isGroupExpanded:!1,isFirst:u,isLast:h}}),r},qyi=e=>e.auditReportGroups.filter(t=>t.auditReport?.auditRulesGroupReport[0].isSuccess===!1).map(t=>t.auditReportGroupId),Zyi=i.div`
96297
+ `,Xq={navBarHeight:new j(62,62,62),navBarPaddingLeft:new j(C[3],C[3],C[8]),navBarPaddingRight:new j(C[3],C[3],C[8])},{cockpit:{review:Yyi},timeFormat:Kyi,common:ub,dateFormat:zW}=W.getLocalizedStrings(),n4n=({isAuditScoreCompleted:e,auditRuleGroups:t,loggedInUser:r,isMonthEnd:n,auditReportGroupView:a,allUsers:l,reviewCompanyView:c,style:d,analytics:p,handleFetchAuditReportGroupView:u,handleGenerateAuditReport:h,handleCancelIconClick:m,handleRuleClick:f,handleReasonAuditRule:x})=>{const y=Me(),[b,w]=g.useState(RW(t,1)),[v,A]=g.useState({id:t[0]?.auditRuleGroupId,index:0}),[S,E]=g.useState(!1),[I,L]=g.useState(1),[B,D]=g.useState(!1),[P,T]=g.useState(null),R=g.useMemo(()=>c?.controllers.map(O=>`${O.user.firstName} ${O.user.middleName} ${O.user.lastName}`)??[],[c?.controllers]),N={fixesRequired:0,totalChecks:0,auditScorePercentage:0,bypassedAuditScore:0,auditReportLastGeneratedDate:null};g.useEffect(()=>{a.auditReportGroups.forEach(O=>{a.auditReportGroups.forEach(H=>{H.auditReportGroupId===v.id&&(H.fetchState==="Completed"||H.fetchState==="Error")&&A({id:t[v.index+1]?.auditRuleGroupId,index:v.index+1})});const z=O.auditReport?.auditRulesGroupReport.find(H=>H.auditRuleGroupId===O.auditReportGroupId);(O.fetchState==="Completed"&&v.id===O.auditReportGroupId&&b[O.auditReportGroupId].isActive===!0&&z?.sequence===I||O.fetchState==="Error"&&v.id===O.auditReportGroupId)&&(L(I+1),w(RW(t,I+1)))})},[a.auditReportGroups,I,t,b]),g.useEffect(()=>{if(a.auditReportGroups.filter(z=>z.fetchState==="In-Progress").length===0&&E(!0),a.auditReportGroups.filter(z=>z.fetchState==="Completed"||z.fetchState==="Error").length===t.length){D(!0);let z=0;a.auditReportGroups.forEach(X=>{z=z+SZe(X.auditReport?.auditRulesGroupReport[0]?.auditRules)});const H=qyi(a),ee=Wr().startOf("month").subtract(1,"date").format(zW.visual.MMMYYYYFormat),Y=c?.customerGroup,G=Math.ceil(a.auditReportGroups[0].auditReport?.auditSummary.auditScorePercentage??0);p.trackAuditScorePercentage(Wr().format(zW.analytics.MMSlashDDSlashYYYYFormat),ee,G,c?.name??"",H,z,R,Y??null)}const O=a.auditReportGroups.find(z=>z.fetchState==="Completed");O?.auditReport?.status?.lastRefreshSuccessTime!=null&&T(O)},[a.auditReportGroups,t.length,p,c,a,R]);const K=()=>{w(RW(t,1)),A({id:t[0]?.auditRuleGroupId,index:0}),E(!1),L(1),D(!1),T(null)},q=()=>{K();const O=t.map(z=>z.auditRuleGroupId);h(O)},F=()=>{m()},_=O=>{u(O)},V=(O,z,H)=>{p.trackAuditIssuesClicked(H,c?.name??"",R,Wr().format(zW.analytics.MMSlashDDSlashYYYYFormat)),f(O,z)};return s.jsxs(Zyi,{style:d,children:[s.jsx(tbi,{windowSize:y,style:d,children:s.jsx(obi,{children:s.jsxs(rbi,{windowSize:y,children:[s.jsx(Jyi,{}),s.jsxs(ibi,{children:[s.jsx(nbi,{children:c?.name}),s.jsx(abi,{children:B?P?.auditReport?.status?.lastRefreshSuccessTime?.utc(!0).local().format(Kyi.hmmADashDDMMMCommaYYYY):ub.strings.empty})]}),s.jsxs(lbi,{children:[s.jsxs(sbi,{isGenerateClickEnabled:S,onClick:q,children:[s.jsx(dbi,{}),s.jsx(cbi,{children:Yyi.auditReportDrawer.updateScore})]}),s.jsx(pbi,{onClick:F,children:s.jsx(ubi,{})})]})]})})}),s.jsxs(Xyi,{children:[s.jsx(ebi,{children:s.jsx(Nxi,{auditSummaryData:c!=null?c.auditSummary:N,isAuditScoreLoadingCompleted:B&&e,isMonthEnd:n})}),s.jsxs(g$e,{children:[s.jsx(f$e,{children:ub.texts.business}),s.jsx(x$e,{children:t.filter(O=>O.ruleType===ub.texts.business.toLowerCase()).map(O=>{const z=a.auditReportGroups.find(H=>H.auditReportGroupId===O.auditRuleGroupId);return z!=null&&Object.keys(b).length>0?s.jsx(h$e,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:l,isMonthEnd:n,ruleGroup:O,groupIdWithActiveStatus:b,auditReportGroup:z,setGroupIdWithActiveStatus:w,onClickRetryGroupFetch:_,onClickRule:V,handleReasonAuditRule:x},O.auditRuleGroupId):null})})]}),s.jsxs(g$e,{children:[s.jsx(f$e,{children:ub.settings.title.accounting}),s.jsx(x$e,{children:t.filter(O=>O.ruleType===ub.settings.title.accounting.toLowerCase()).map(O=>{const z=a.auditReportGroups.find(H=>H.auditReportGroupId===O.auditRuleGroupId);return z!=null&&Object.keys(b).length>0?s.jsx(h$e,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:l,isMonthEnd:n,ruleGroup:O,groupIdWithActiveStatus:b,auditReportGroup:z,setGroupIdWithActiveStatus:w,onClickRetryGroupFetch:_,onClickRule:V,handleReasonAuditRule:x},O.auditRuleGroupId):null})})]})]})]})},RW=(e,t)=>{const r={},n={};return e.forEach(a=>{const{ruleType:l,sequence:c}=a;n[l]===void 0?n[l]={first:c,last:c}:(c<n[l].first&&(n[l].first=c),c>n[l].last&&(n[l].last=c))}),e.forEach(a=>{const{auditRuleGroupId:l,ruleType:c,sequence:d}=a,p=d<=t,u=d===n[c].first,h=d===n[c].last;r[l]={isActive:p,isGroupExpanded:!1,isFirst:u,isLast:h}}),r},qyi=e=>e.auditReportGroups.filter(t=>t.auditReport?.auditRulesGroupReport[0].isSuccess===!1).map(t=>t.auditReportGroupId),Zyi=i.div`
96299
96298
  display: flex;
96300
96299
  flex-direction: column;
96301
96300
  align-items: center;
@@ -96401,7 +96400,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
96401
96400
  `,ubi=i(Tt)`
96402
96401
  width: ${o.sp3};
96403
96402
  height: ${o.sp3};
96404
- `,fo=W.getLocalizedStrings(),Gb={navBarHeight:new j(62,62,62),navBarPaddingLeft:new j(C[3],C[3],C[8]),navBarPaddingRight:new j(C[3],C[3],C[8]),navBarPaddingTop:new j(12,12,C[3]),navBarPaddingBottom:new j(12,12,19)},hbi={title:new vt("extraLargeMedium","extraLargeSemiBold")},s4n=({companyView:e,allUsers:t,onRetryBankAccountConnection:r,onCloseClick:n})=>{const a=Me(),l=e!=null?hke(e):0,c=e?.onboardingInfo?.bankAccountLinked,d=e?.onboardingInfo?.qboLinked,p=e?.onboardingInfo?.identityVerified,u=e?.onboardingInfo?.businessVerified,h=e?.onboardingInfo?.accountingConnectionCreationMode==="zeni_user",m=[];if(c!=null){const f=t.find(b=>b.userId===c.userIds[0]),{errorMessage:x,successMessage:y}=mbi(c,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.common.texts.linkBankAccount} ${fo.common.strings.hyphen} ${fo.common.incompleteText}`,onClickRetry:r})}if(d!=null){const f=t.find(b=>b.userId===d.userIds[0]),{errorMessage:x,successMessage:y}=gbi(d,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.common.texts.connectToQbo} ${fo.common.strings.hyphen} ${fo.common.incompleteText}`})}if(p!=null){const f=t.find(b=>b.userId===p.userIds[0]),{errorMessage:x,successMessage:y}=fbi(p,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.cockpit.review.warningsDrawer.kyc} ${fo.common.strings.hyphen} ${p.status}`})}if(u!=null){const f=t.find(b=>b.userId===u.userIds[0]),{errorMessage:x,successMessage:y}=xbi(u,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.cockpit.review.warningsDrawer.kyb} ${fo.common.strings.hyphen} ${u.status}`})}return s.jsxs(ybi,{children:[s.jsx(bbi,{windowSize:a,children:s.jsx(wbi,{children:s.jsxs(Abi,{windowSize:a,children:[s.jsx($bi,{windowSize:a,children:e?.name}),s.jsx(Bbi,{onClick:n,children:s.jsx(Dbi,{})})]})})}),s.jsxs(vbi,{children:[s.jsx(Cbi,{children:l>0?s.jsxs(FW,{children:[s.jsx(FW,{children:wp(fo.cockpit.review.warningsDrawer.issueFound)}),s.jsx(Pbi,{children:`${fo.common.strings.openingBrace}${l}${fo.common.strings.closingBrace}`})]}):s.jsx(FW,{children:`${fo.common.no}
96403
+ `,fo=W.getLocalizedStrings(),Gb={navBarHeight:new j(62,62,62),navBarPaddingLeft:new j(C[3],C[3],C[8]),navBarPaddingRight:new j(C[3],C[3],C[8]),navBarPaddingTop:new j(12,12,C[3]),navBarPaddingBottom:new j(12,12,19)},hbi={title:new vt("extraLargeMedium","extraLargeSemiBold")},a4n=({companyView:e,allUsers:t,onRetryBankAccountConnection:r,onCloseClick:n})=>{const a=Me(),l=e!=null?hke(e):0,c=e?.onboardingInfo?.bankAccountLinked,d=e?.onboardingInfo?.qboLinked,p=e?.onboardingInfo?.identityVerified,u=e?.onboardingInfo?.businessVerified,h=e?.onboardingInfo?.accountingConnectionCreationMode==="zeni_user",m=[];if(c!=null){const f=t.find(b=>b.userId===c.userIds[0]),{errorMessage:x,successMessage:y}=mbi(c,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.common.texts.linkBankAccount} ${fo.common.strings.hyphen} ${fo.common.incompleteText}`,onClickRetry:r})}if(d!=null){const f=t.find(b=>b.userId===d.userIds[0]),{errorMessage:x,successMessage:y}=gbi(d,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.common.texts.connectToQbo} ${fo.common.strings.hyphen} ${fo.common.incompleteText}`})}if(p!=null){const f=t.find(b=>b.userId===p.userIds[0]),{errorMessage:x,successMessage:y}=fbi(p,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.cockpit.review.warningsDrawer.kyc} ${fo.common.strings.hyphen} ${p.status}`})}if(u!=null){const f=t.find(b=>b.userId===u.userIds[0]),{errorMessage:x,successMessage:y}=xbi(u,h,f);m.push({status:x!=null?"Error":y!=null?"Complete":"Incomplete",userInfo:f,message:x??y??`${fo.cockpit.review.warningsDrawer.kyb} ${fo.common.strings.hyphen} ${u.status}`})}return s.jsxs(ybi,{children:[s.jsx(bbi,{windowSize:a,children:s.jsx(wbi,{children:s.jsxs(Abi,{windowSize:a,children:[s.jsx($bi,{windowSize:a,children:e?.name}),s.jsx(Bbi,{onClick:n,children:s.jsx(Dbi,{})})]})})}),s.jsxs(vbi,{children:[s.jsx(Cbi,{children:l>0?s.jsxs(FW,{children:[s.jsx(FW,{children:wp(fo.cockpit.review.warningsDrawer.issueFound)}),s.jsx(Pbi,{children:`${fo.common.strings.openingBrace}${l}${fo.common.strings.closingBrace}`})]}):s.jsx(FW,{children:`${fo.common.no}
96405
96404
  ${wp(fo.cockpit.review.warningsDrawer.issueFound)}`})}),m.map((f,x)=>s.jsx(kbi,{isStepInError:f.status==="Error",children:s.jsxs(Sbi,{children:[s.jsx(Ebi,{children:f.status==="Complete"?s.jsx(jbi,{}):f.status==="Error"?s.jsx(A3,{}):s.jsx(Mbi,{})}),s.jsxs(Lbi,{children:[s.jsx(Ibi,{isStepInError:f.status==="Error",children:f.message}),f.status==="Error"?s.jsx(Qt,{label:fo.common.retry,onClick:f.onClickRetry,loading:e?.retryBankAccountConnectionFetchState.fetchState==="In-Progress",variant:"outline",style:{padding:`${o.sp1} ${o.sp3}`,borderRadius:o.sp1},textStyle:{...Q.smallMedium.cssObject}}):null]})]})},x))]})]})},mbi=(e,t,r)=>{const n=e.error===!0?e.errorDetails!=null?e.errorDetails.summary:fo.cockpit.review.errors.bankAccountLinked:null,a=e.completed===!0?r!=null?`${fo.common.texts.linkBankAccount} ${fo.common.strings.hyphen} ${t===!0?`${fo.common.via} ${fo.common.cockpit} `:fo.common.strings.empty}${fo.common.by} ${r.firstName} ${r.lastName}`:fo.common.texts.linkBankAccount:null;return{errorMessage:n,successMessage:a}},gbi=(e,t,r)=>{const n=e.error===!0?e.errorDetails!=null?e.errorDetails.summary:fo.cockpit.review.errors.qboLinked:null,a=e.completed===!0?r!=null?`${fo.common.texts.connectToQbo} ${fo.common.strings.hyphen} ${t===!0?`${fo.common.via} ${fo.common.cockpit} `:fo.common.strings.empty}${fo.common.by} ${r.firstName} ${r.lastName}`:`${fo.common.texts.connectToQbo}`:null;return{errorMessage:n,successMessage:a}},fbi=(e,t,r)=>{const n=e.status==="Error"?r!=null?`${fo.cockpit.review.warningsDrawer.kyc} ${fo.common.failed.toLocaleLowerCase()} ${fo.common.strings.hyphen} ${t===!0?`${fo.common.via} ${fo.common.cockpit} `:fo.common.strings.empty}${fo.common.by} ${r.firstName} ${r.lastName}`:`${fo.cockpit.review.warningsDrawer.kyc} ${fo.common.failed.toLocaleLowerCase()}`:null,a=e.status==="Complete"?r!=null?`${fo.cockpit.review.warningsDrawer.kyc} ${fo.cockpit.review.warningsDrawer.identity} ${fo.common.strings.hyphen} ${t===!0?`${fo.common.via} ${fo.common.cockpit} `:fo.common.strings.empty}${fo.common.by} ${r.firstName} ${r.lastName}`:`${fo.cockpit.review.warningsDrawer.kyc} ${fo.cockpit.review.warningsDrawer.identity}`:null;return{errorMessage:n,successMessage:a}},xbi=(e,t,r)=>{const n=e.status==="Error"?r!=null?`${fo.cockpit.review.warningsDrawer.kyb} ${fo.common.failed.toLocaleLowerCase()} ${fo.common.strings.hyphen} ${t===!0?`${fo.common.via} ${fo.common.cockpit} `:fo.common.strings.empty}${fo.common.by} ${r.firstName} ${r.lastName}`:`${fo.cockpit.review.warningsDrawer.kyb} ${fo.common.failed.toLocaleLowerCase()}`:null,a=e.status==="Complete"?r!=null?`${fo.cockpit.review.warningsDrawer.kyb} ${fo.cockpit.review.warningsDrawer.identity} ${fo.common.strings.hyphen} ${t===!0?`${fo.common.via} ${fo.common.cockpit} `:fo.common.strings.empty}${fo.common.by} ${r.firstName} ${r.lastName}`:`${fo.cockpit.review.warningsDrawer.kyb} ${fo.cockpit.review.warningsDrawer.identity}`:null;return{errorMessage:n,successMessage:a}},ybi=i.div`
96406
96405
  display: flex;
96407
96406
  flex-direction: column;
@@ -96903,7 +96902,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
96903
96902
  }
96904
96903
  `,uvi=i(bn)`
96905
96904
  color: ${e=>e.theme.colors.hero};
96906
- `,{common:LZe,cockpit:{creditAgent:Wu}}=W.getLocalizedStrings(),hvi=["All","New only","Interested","Active only"],mvi=e=>{switch(e){case"All":return LZe.all;case"New only":return Wu.focusNewOnly;case"Interested":return Wu.focusInterested;case"Active only":return Wu.focusActiveOnly}};function l4n({headerActions:e,headerData:t,creditAgentPageData:r,creditAgentPageActions:n}){const a=Me(),{macroData:l,cardProfilesData:c}=r,{onFetchMacro:d,onSaveMacro:p,onResetSaveMacro:u,onUIStateChange:h,cardProfilesActions:m}=n,{onDownloadReport:f}=m,[x,y]=g.useState(""),[b,w]=g.useState(!1),{focus:v,minScore:A}=c.uiState;g.useEffect(()=>{l.fetchState==="Not-Started"&&d()},[l.fetchState,d]),g.useEffect(()=>{l.data!=null&&!b&&y(l.data.instructions)},[l.data,b]),g.useEffect(()=>{l.updateState==="Completed"&&(w(!1),u())},[l.updateState,u]),g.useEffect(()=>{c.fetchState==="Not-Started"&&m.onFetch()},[c.fetchState,m]);const S=g.useCallback(()=>{p(x)},[p,x]),E=g.useCallback(()=>{w(!1),l.data!=null&&y(l.data.instructions),l.updateState==="Error"&&u()},[l.data,l.updateState,u]);return s.jsxs(gvi,{children:[s.jsx(V2,{headerActions:e,headerData:{...t,allTabOptions:t.allTabOptions??n0,selectedTabOption:"creditAgent"}}),s.jsxs(fvi,{windowSize:a,children:[s.jsxs(xvi,{children:[s.jsx(yvi,{}),s.jsxs(bvi,{children:[b&&s.jsxs(s.Fragment,{children:[s.jsx(Qt,{variant:"secondary",size:"small",label:LZe.cancel,onClick:E}),s.jsx(Qt,{variant:"primary",size:"small",label:l.updateState==="In-Progress"?Wu.saving:Wu.savePrompt,disabled:l.updateState==="In-Progress",onClick:S})]}),s.jsx(Qt,{variant:"secondary",size:"small",label:Wu.downloadReport,onClick:f})]})]}),s.jsxs(wvi,{children:[s.jsxs(vvi,{children:[s.jsxs(Cvi,{children:[s.jsx(Avi,{children:"✦"}),l.fetchState==="In-Progress"?s.jsx(Ao,{size:"Standard",start:!0}):s.jsx($vi,{value:x,disabled:l.updateState==="In-Progress",onChange:I=>{y(I.target.value),w(!0)},placeholder:Wu.promptPlaceholder,rows:6})]}),s.jsxs(kvi,{children:[s.jsxs(C$e,{children:[s.jsx(A$e,{children:Wu.focusLabel}),s.jsx(Svi,{children:hvi.map(I=>s.jsx(Evi,{active:v===I,onClick:()=>h({focus:I}),children:mvi(I)},I))})]}),s.jsx(Lvi,{}),s.jsxs(C$e,{children:[s.jsx(A$e,{children:Wu.minScoreLabel}),s.jsx(Ivi,{type:"range",min:0,max:100,value:A,onChange:I=>h({minScore:parseInt(I.target.value)})}),s.jsx(jvi,{children:A})]})]})]}),l.updateState==="Error"&&s.jsx(Bvi,{children:Wu.failedToSavePrompt})]}),s.jsx(Mvi,{children:s.jsx(Ywi,{cardProfilesData:c,cardProfilesActions:m,onUIStateChange:h,uiState:c.uiState})})]})]})}const gvi=i.div`
96905
+ `,{common:LZe,cockpit:{creditAgent:Wu}}=W.getLocalizedStrings(),hvi=["All","New only","Interested","Active only"],mvi=e=>{switch(e){case"All":return LZe.all;case"New only":return Wu.focusNewOnly;case"Interested":return Wu.focusInterested;case"Active only":return Wu.focusActiveOnly}};function s4n({headerActions:e,headerData:t,creditAgentPageData:r,creditAgentPageActions:n}){const a=Me(),{macroData:l,cardProfilesData:c}=r,{onFetchMacro:d,onSaveMacro:p,onResetSaveMacro:u,onUIStateChange:h,cardProfilesActions:m}=n,{onDownloadReport:f}=m,[x,y]=g.useState(""),[b,w]=g.useState(!1),{focus:v,minScore:A}=c.uiState;g.useEffect(()=>{l.fetchState==="Not-Started"&&d()},[l.fetchState,d]),g.useEffect(()=>{l.data!=null&&!b&&y(l.data.instructions)},[l.data,b]),g.useEffect(()=>{l.updateState==="Completed"&&(w(!1),u())},[l.updateState,u]),g.useEffect(()=>{c.fetchState==="Not-Started"&&m.onFetch()},[c.fetchState,m]);const S=g.useCallback(()=>{p(x)},[p,x]),E=g.useCallback(()=>{w(!1),l.data!=null&&y(l.data.instructions),l.updateState==="Error"&&u()},[l.data,l.updateState,u]);return s.jsxs(gvi,{children:[s.jsx(V2,{headerActions:e,headerData:{...t,allTabOptions:t.allTabOptions??n0,selectedTabOption:"creditAgent"}}),s.jsxs(fvi,{windowSize:a,children:[s.jsxs(xvi,{children:[s.jsx(yvi,{}),s.jsxs(bvi,{children:[b&&s.jsxs(s.Fragment,{children:[s.jsx(Qt,{variant:"secondary",size:"small",label:LZe.cancel,onClick:E}),s.jsx(Qt,{variant:"primary",size:"small",label:l.updateState==="In-Progress"?Wu.saving:Wu.savePrompt,disabled:l.updateState==="In-Progress",onClick:S})]}),s.jsx(Qt,{variant:"secondary",size:"small",label:Wu.downloadReport,onClick:f})]})]}),s.jsxs(wvi,{children:[s.jsxs(vvi,{children:[s.jsxs(Cvi,{children:[s.jsx(Avi,{children:"✦"}),l.fetchState==="In-Progress"?s.jsx(Ao,{size:"Standard",start:!0}):s.jsx($vi,{value:x,disabled:l.updateState==="In-Progress",onChange:I=>{y(I.target.value),w(!0)},placeholder:Wu.promptPlaceholder,rows:6})]}),s.jsxs(kvi,{children:[s.jsxs(C$e,{children:[s.jsx(A$e,{children:Wu.focusLabel}),s.jsx(Svi,{children:hvi.map(I=>s.jsx(Evi,{active:v===I,onClick:()=>h({focus:I}),children:mvi(I)},I))})]}),s.jsx(Lvi,{}),s.jsxs(C$e,{children:[s.jsx(A$e,{children:Wu.minScoreLabel}),s.jsx(Ivi,{type:"range",min:0,max:100,value:A,onChange:I=>h({minScore:parseInt(I.target.value)})}),s.jsx(jvi,{children:A})]})]})]}),l.updateState==="Error"&&s.jsx(Bvi,{children:Wu.failedToSavePrompt})]}),s.jsx(Mvi,{children:s.jsx(Ywi,{cardProfilesData:c,cardProfilesActions:m,onUIStateChange:h,uiState:c.uiState})})]})]})}const gvi=i.div`
96907
96906
  height: calc(100vh - 45px);
96908
96907
  overflow: hidden;
96909
96908
  background-color: ${e=>e.theme.colors.grey4};
@@ -97026,7 +97025,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
97026
97025
  `,Bvi=i(_X)`
97027
97026
  color: ${e=>e.theme.colors.alert};
97028
97027
  margin-top: ${o.sp2};
97029
- `;var Dvi=det();const Lw=eZ(Dvi);class Pvi{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER,t)}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!1:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,t)??!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!0:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,t)??!0}getSignedInUserTenant(t){return this.getSignedInUserTenants()?.find(r=>r.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){return this.getSignedInUserTenants()?.find(r=>r.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?[]:this.readEncryptedJSON(this.ZENI_FORCE_REFRESHED_COMPONENTS,t)??[]}saveForceRefreshedComponents(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),r)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,r){if(t==null||r==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.getItem(this.ZENI_SESSION_ID)!==r&&this.clearSessionKeyedEntries(),window.localStorage.setItem(this.ZENI_SESSION_ID,r),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),r))}saveSignedInUserTenants(t,r){const n=r??window.localStorage.getItem(this.ZENI_SESSION_ID);n!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),n)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),r));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),r));else throw new Error("Can't update the setting when the user is logged out!")}isSignedIn(){return[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER].map(r=>window.localStorage.getItem(r)!=null).reduce((r,n)=>r&&n)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,r))}getTheme(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t==null)return;const r=this.readEncryptedString(this.ZENI_THEME,t);if(r!=null){if(r!=="light"&&r!=="dark"){window.localStorage.removeItem(this.ZENI_THEME);return}return r}}encrypt(t,r){return Lw.AES.encrypt(t,r).toString()}decrypt(t,r){try{const n=Lw.AES.decrypt(t,r).toString(Lw.enc.Utf8);return n===""?void 0:n}catch{return}}readEncryptedString(t,r){const n=window.localStorage.getItem(t);if(n==null)return;const a=this.decrypt(n,r);return a==null&&window.localStorage.removeItem(t),a}readEncryptedJSON(t,r){const n=this.readEncryptedString(t,r);if(n!=null)try{const a=JSON.parse(n);if(a===null){window.localStorage.removeItem(t);return}return a}catch{window.localStorage.removeItem(t);return}}getSignedInUserTenants(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER_TENANTS,t)}clearSessionKeyedEntries(){this.SESSION_KEYED_IDs.forEach(t=>window.localStorage.removeItem(t))}ZENI_SESSION_ID="ZENI_SESSION_ID";ZENI_SIGNED_IN_USER="ZENI_SIGNED_IN_USER";ZENI_SIGNED_IN_USER_TENANTS="ZENI_SIGNED_IN_USER_TENANTS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF";ZENI_THEME="ZENI_THEME";ZENI_FORCE_REFRESHED_COMPONENTS="ZENI_FORCE_REFRESHED_COMPONENTS";SESSION_KEYED_IDs=[this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS];ALL_IDs=[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS]}const As=new Pvi,Tvi=({children:e})=>{const t=ret("(prefers-color-scheme: dark)"),[r,n]=$.useState({dark:t});g.useEffect(()=>{const p=As.getTheme()==null?t:As.getTheme()==="dark";r.dark!==p&&n({dark:p})},[r,t]);const a=()=>{const p=!r.dark;As.setTheme(p?"dark":"light"),n({...r,dark:p})},l=r.dark?OMo():FMo(),c=typeof window<"u"?window.__NONCE__:void 0,d=c!=null&&c.length>0?c:void 0;return Co.jsx(eko,{dark:r.dark,webAppTheme:l,toggle:a,nonce:d,children:e})},zvi=["sandbox","production"],Rvi=e=>X4(e,zvi),Fvi=e=>{switch(e){case"DEV":case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"sandbox";case"PROD":case"NEXT":return"production";default:return"sandbox"}},Ovi=["development","staging","production"],Nvi=e=>X4(e,Ovi),Hvi=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";default:return"development"}},_vi=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],Vvi=e=>X4(e,_vi),o1=Vvi("QA"),Dv=()=>o1==="DEV"||o1==="QA"||o1==="PUNE"||o1==="SUNNYVALE"||o1==="DELHI"||o1==="MOHALI",Joe="https://zeni-webapp-qa.uc.r.appspot.com",Uvi="ed1936cb971f6aad4104ddbe708f812c",c4n=Rvi(Fvi(o1)),Qvi=Nvi(Hvi(o1));function Wvi(e,t){return Lw.AES.decrypt(e,t).toString(Lw.enc.Utf8)}const Gvi="ZENI-WEB-APP-",IZe=o1==="DEV"||o1==="QA"?.2:.8,Sa={sentryDsn:"",sentryTraceSamplingRate:IZe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let J4,Xoe;function Yvi(e){Sa.sentryDsn=e.keys.SENTRY_DSN,Sa.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):IZe,Sa.googleClientId=e.keys.GOOGLE_CLIENT_ID,Sa.googleMapsAPIKey=e.keys.GOOGLE_MAP_KEY,Sa.microsoftClientId=e.keys.MICROSOFT_CLIENT_ID,Sa.mixpanelToken=e.keys.MIXPANEL_TOKEN,Sa.pusherClientSecret=e.keys.PUSHER_CLIENT_SECRET,Sa.pusherCluster=e.keys.PUSHER_CLUSTER,Sa.quickbooksKey=e.keys.QUICKBOOK_TOKEN,Sa.appUrl=e.keys.WEB_ENDPOINT,Sa.featureClientSecret=e.keys.STATSIG_CLIENT_SECRET,Sa.featureClientSecretCockpit=e.keys.STATSIG_CLIENT_SECRET_COCKPIT,Sa.cardVaultId=e.keys.UNIT_VAULT_ID,Sa.stripeKey=e.keys.STRIPE_KEY,Sa.qboRedirectionUrl=e.keys.QBO_URL,Sa.mixpanelUrl=e.keys.MIXPANEL_URL,Sa.mixpanelHMUrl=e.keys.MIXPANEL_HM_URL,Xoe=e.externalEndPoints,J4=e.apiEndPoints,Kvi()}function Kvi(){try{const e=new Set;if(J4!=null){for(const t of Object.values(J4))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const r=document.createElement("link");r.rel="preconnect",r.href=t,r.crossOrigin="anonymous",document.head.appendChild(r)}}catch{}}async function qvi(){const t=encodeURIComponent(JSON.stringify({environment:o1}));try{const r=await fetch(`${Joe}/api/keys?query=${t}`);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){return console.error("Error fetching details:",r),null}}let $$e=!1;function Kb(){$$e||(Yu.init(Uvi,{api_host:Xoe.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),$$e=!0)}let k$e=!1,S$e=!1;function jZe(){if(k$e)return;k$e=!0,Kb();const e=pl.extractUtmParamsFromUrl();Object.keys(e).length>0&&Yu.register(e),Dv()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function Zvi(){return Yu?.persistence?.props??null}const Jvi=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function Xvi(){const e=Zvi();if(e==null)return;const t=Object.keys(e).filter(r=>r.startsWith("utm_")||Jvi.has(r));for(const r of t)Yu.unregister(r);Dv()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function eCi(){S$e||(S$e=!0,Xvi())}class t4{identify(t,r){if(Kb(),this.#o=t,t!=null&&r!=null&&(t4.#t==null||NXe({userId:t,traits:r},t4.#t)!==!0)){const{$email:n,...a}={...r};Yu.identify(t),n&&n!=null&&Yu.people.set_once({$email:n}),Yu.people.set(a),t4.#t={userId:t,traits:r},Dv()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(r)} `)}}identifyUserAndCompany(t,r,n,a,l){throw Error("Use identify in the web-app!!")}track(t,r){if(Kb(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}jZe();const n={distinct_id:this.#o,...r};Yu.track(t,n),eCi(),Dv()&&console.log(`*** firing ${t} with props ${JSON.stringify(r)}`)}alias(t,r){Kb(),Yu.alias(t,r)}reset(){Kb(),Yu.reset(),this.#o=void 0,t4.#t=void 0}static get analytics(){return this.#e}static#e=new pl.Analytics(new t4);static#t;#o}const Vm=t4.analytics;function tCi(){jZe()}const oCi=()=>{const e=mj(),t=yh(r=>r.companyState);if(e.pathname.includes("/management/parent/")){const r=e.pathname.split("/")[3],n=t.companiesById[r];if(n!=null)return`${n.companyInfo.name} ${W.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const r=e.pathname.split("/")[4],n=t.companiesById[r];if(n!=null)return n.companyInfo.name}},E$e=e=>{switch(e){case"healthMonitor":return"health-monitor";case"taskManager":return"task-manager";case"aiAccountant":return"ai-accountant";case"creditAgent":return"credit-agent";default:return e}},d4n=e=>{switch(e){case"healthMonitor":return"health monitor";case"taskManager":return"task manager";case"aiAccountant":return"ai accountant";case"creditAgent":return"credit agent";default:return e}};function rCi(e,t){return{updateDownloadStateHandler:r=>{e(HXe(r))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(VW()),e(UW(!1)),As.clearAll();const r=t.locationHook.state?.origin??"/";t.navigate(r,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Vm?.trackOnboardingNewCustomerStarted()},onThreadClick:(r,n,a)=>{const l=r.entityType.split(".");if(l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(r,n,a)=>{const l=r.entityType.split(".");if(r.isGlobalComment&&l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function iCi(e,t){const{signedInUser:r,cockpitHeader:n}=t,a=e.tenantState.currentTenantId,c=yj(e)?.companyName??"",d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:a??""};return{signedInUser:r,cockpitHeader:n,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:c,cockpitEndPoint:`${Joe}/cockpitTabs`,authParams:d}}}const nCi=TJe(iCi,rCi)(Ani);function aCi(){const e=FNe(),t=As.getSignedInUser(),r=tZ(),n=mj(),a=oCi(),l=yh(p=>_Xe(p)),c={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:VXe()},d=n.pathname.split("/")[1];return Co.jsx(nCi,{locationHook:n,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:c,analytics:Vm,currentTab:d,navigate:r})}const sCi=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function lCi({appContent:e}){const t=sCi.filter(r=>zJe(r)).length===0;return Co.jsxs(Co.Fragment,{children:[t?null:Co.jsx(aCi,{}),Co.jsx(Co.Fragment,{children:e})]})}const cCi="cockpit",MZe="init-enter";function dCi({location:e,visitedUrl:t}){const{pathname:r}=e;return g.useLayoutEffect(()=>{const n=t.get(r||MZe);L$e(n!==void 0?n:0)}),null}const pCi=g.memo(dCi,(e,t)=>{const{location:r,visitedUrl:n}=e,{location:a}=t,l=r.pathname||MZe,c=uCi();return n.set(l,c),!((a.pathname!==r.pathname||a.search!==r.search)&&a.hash==="")}),L$e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),uCi=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},BZe=e=>g.lazy(async()=>{const t=e.toString(),r=As.getForceRefreshedComponents(),n=new Set(r),a=n.has(t);try{const l=await e();return n.delete(t),As.saveForceRefreshedComponents(Array.from(n)),l}catch(l){throw a||(n.add(t),As.saveForceRefreshedComponents(Array.from(n)),location.reload()),l}}),hCi=BZe(()=>r4(()=>import("./ScreenRoutes-BC9Q2kAr.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),mCi=BZe(()=>r4(()=>import("./SignInScreen-Dnv-RvHN.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function gCi(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=tZ(),r=mj();return g.useEffect(()=>{tCi()},[]),g.useEffect(()=>{const n="signin/auth";As.isSignedIn()===!1&&!r.pathname.includes(n)&&t(n,{replace:!0,state:{...r.state,message:"...",origin:r.pathname}})}),Co.jsxs(yCi,{children:[Co.jsx(pCi,{visitedUrl:e.current,location:r}),Co.jsx(fCi,{})]})}const fCi=()=>{const e=As.isSignedIn(),t=As.getSignedInUser(),r=e&&N$e(t),n=yh(p=>yj(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:n.tenantId??""},l=yh(p=>UXe(p)),d=yh(p=>QXe(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return Co.jsx(gQr,{roomId:cCi,authParams:a,users:l,companies:d,authUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:r,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:Co.jsx(xCi,{})})},xCi=()=>Co.jsx(g.Suspense,{fallback:Co.jsx(bCi,{children:Co.jsx(Ao,{size:"Large",start:!0})}),children:Co.jsxs(RJe,{children:[Co.jsx(mT,{path:"/",element:Co.jsx(FJe,{to:"management",replace:!0})}),Co.jsx(mT,{path:"/signin/auth",element:Co.jsx(mCi,{})}),Co.jsx(mT,{path:"*",element:Co.jsx(lCi,{appContent:Co.jsx(hCi,{})})})]})}),yCi=eo("div")``,bCi=eo("div")`
97028
+ `;var Dvi=det();const Lw=eZ(Dvi);class Pvi{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER,t)}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!1:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,t)??!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!0:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,t)??!0}getSignedInUserTenant(t){return this.getSignedInUserTenants()?.find(r=>r.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){return this.getSignedInUserTenants()?.find(r=>r.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?[]:this.readEncryptedJSON(this.ZENI_FORCE_REFRESHED_COMPONENTS,t)??[]}saveForceRefreshedComponents(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),r)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,r){if(t==null||r==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.getItem(this.ZENI_SESSION_ID)!==r&&this.clearSessionKeyedEntries(),window.localStorage.setItem(this.ZENI_SESSION_ID,r),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),r))}saveSignedInUserTenants(t,r){const n=r??window.localStorage.getItem(this.ZENI_SESSION_ID);n!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),n)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),r));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),r));else throw new Error("Can't update the setting when the user is logged out!")}isSignedIn(){return[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER].map(r=>window.localStorage.getItem(r)!=null).reduce((r,n)=>r&&n)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,r))}getTheme(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t==null)return;const r=this.readEncryptedString(this.ZENI_THEME,t);if(r!=null){if(r!=="light"&&r!=="dark"){window.localStorage.removeItem(this.ZENI_THEME);return}return r}}encrypt(t,r){return Lw.AES.encrypt(t,r).toString()}decrypt(t,r){try{const n=Lw.AES.decrypt(t,r).toString(Lw.enc.Utf8);return n===""?void 0:n}catch{return}}readEncryptedString(t,r){const n=window.localStorage.getItem(t);if(n==null)return;const a=this.decrypt(n,r);return a==null&&window.localStorage.removeItem(t),a}readEncryptedJSON(t,r){const n=this.readEncryptedString(t,r);if(n!=null)try{const a=JSON.parse(n);if(a===null){window.localStorage.removeItem(t);return}return a}catch{window.localStorage.removeItem(t);return}}getSignedInUserTenants(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER_TENANTS,t)}clearSessionKeyedEntries(){this.SESSION_KEYED_IDs.forEach(t=>window.localStorage.removeItem(t))}ZENI_SESSION_ID="ZENI_SESSION_ID";ZENI_SIGNED_IN_USER="ZENI_SIGNED_IN_USER";ZENI_SIGNED_IN_USER_TENANTS="ZENI_SIGNED_IN_USER_TENANTS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF";ZENI_THEME="ZENI_THEME";ZENI_FORCE_REFRESHED_COMPONENTS="ZENI_FORCE_REFRESHED_COMPONENTS";SESSION_KEYED_IDs=[this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS];ALL_IDs=[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS]}const As=new Pvi,Tvi=({children:e})=>{const t=ret("(prefers-color-scheme: dark)"),[r,n]=$.useState({dark:t});g.useEffect(()=>{const p=As.getTheme()==null?t:As.getTheme()==="dark";r.dark!==p&&n({dark:p})},[r,t]);const a=()=>{const p=!r.dark;As.setTheme(p?"dark":"light"),n({...r,dark:p})},l=r.dark?OMo():FMo(),c=typeof window<"u"?window.__NONCE__:void 0,d=c!=null&&c.length>0?c:void 0;return Co.jsx(eko,{dark:r.dark,webAppTheme:l,toggle:a,nonce:d,children:e})},zvi=["sandbox","production"],Rvi=e=>X4(e,zvi),Fvi=e=>{switch(e){case"DEV":case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"sandbox";case"PROD":case"NEXT":return"production";default:return"sandbox"}},Ovi=["development","staging","production"],Nvi=e=>X4(e,Ovi),Hvi=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";default:return"development"}},_vi=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],Vvi=e=>X4(e,_vi),o1=Vvi("QA"),Dv=()=>o1==="DEV"||o1==="QA"||o1==="PUNE"||o1==="SUNNYVALE"||o1==="DELHI"||o1==="MOHALI",Joe="https://zeni-webapp-qa.uc.r.appspot.com",Uvi="ed1936cb971f6aad4104ddbe708f812c",l4n=Rvi(Fvi(o1)),Qvi=Nvi(Hvi(o1));function Wvi(e,t){return Lw.AES.decrypt(e,t).toString(Lw.enc.Utf8)}const Gvi="ZENI-WEB-APP-",IZe=o1==="DEV"||o1==="QA"?.2:.8,Sa={sentryDsn:"",sentryTraceSamplingRate:IZe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let J4,Xoe;function Yvi(e){Sa.sentryDsn=e.keys.SENTRY_DSN,Sa.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):IZe,Sa.googleClientId=e.keys.GOOGLE_CLIENT_ID,Sa.googleMapsAPIKey=e.keys.GOOGLE_MAP_KEY,Sa.microsoftClientId=e.keys.MICROSOFT_CLIENT_ID,Sa.mixpanelToken=e.keys.MIXPANEL_TOKEN,Sa.pusherClientSecret=e.keys.PUSHER_CLIENT_SECRET,Sa.pusherCluster=e.keys.PUSHER_CLUSTER,Sa.quickbooksKey=e.keys.QUICKBOOK_TOKEN,Sa.appUrl=e.keys.WEB_ENDPOINT,Sa.featureClientSecret=e.keys.STATSIG_CLIENT_SECRET,Sa.featureClientSecretCockpit=e.keys.STATSIG_CLIENT_SECRET_COCKPIT,Sa.cardVaultId=e.keys.UNIT_VAULT_ID,Sa.stripeKey=e.keys.STRIPE_KEY,Sa.qboRedirectionUrl=e.keys.QBO_URL,Sa.mixpanelUrl=e.keys.MIXPANEL_URL,Sa.mixpanelHMUrl=e.keys.MIXPANEL_HM_URL,Xoe=e.externalEndPoints,J4=e.apiEndPoints,Kvi()}function Kvi(){try{const e=new Set;if(J4!=null){for(const t of Object.values(J4))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const r=document.createElement("link");r.rel="preconnect",r.href=t,r.crossOrigin="anonymous",document.head.appendChild(r)}}catch{}}async function qvi(){const t=encodeURIComponent(JSON.stringify({environment:o1}));try{const r=await fetch(`${Joe}/api/keys?query=${t}`);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){return console.error("Error fetching details:",r),null}}let $$e=!1;function Kb(){$$e||(Yu.init(Uvi,{api_host:Xoe.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),$$e=!0)}let k$e=!1,S$e=!1;function jZe(){if(k$e)return;k$e=!0,Kb();const e=pl.extractUtmParamsFromUrl();Object.keys(e).length>0&&Yu.register(e),Dv()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function Zvi(){return Yu?.persistence?.props??null}const Jvi=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function Xvi(){const e=Zvi();if(e==null)return;const t=Object.keys(e).filter(r=>r.startsWith("utm_")||Jvi.has(r));for(const r of t)Yu.unregister(r);Dv()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function eCi(){S$e||(S$e=!0,Xvi())}class t4{identify(t,r){if(Kb(),this.#o=t,t!=null&&r!=null&&(t4.#t==null||NXe({userId:t,traits:r},t4.#t)!==!0)){const{$email:n,...a}={...r};Yu.identify(t),n&&n!=null&&Yu.people.set_once({$email:n}),Yu.people.set(a),t4.#t={userId:t,traits:r},Dv()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(r)} `)}}identifyUserAndCompany(t,r,n,a,l){throw Error("Use identify in the web-app!!")}track(t,r){if(Kb(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}jZe();const n={distinct_id:this.#o,...r};Yu.track(t,n),eCi(),Dv()&&console.log(`*** firing ${t} with props ${JSON.stringify(r)}`)}alias(t,r){Kb(),Yu.alias(t,r)}reset(){Kb(),Yu.reset(),this.#o=void 0,t4.#t=void 0}static get analytics(){return this.#e}static#e=new pl.Analytics(new t4);static#t;#o}const Vm=t4.analytics;function tCi(){jZe()}const oCi=()=>{const e=mj(),t=yh(r=>r.companyState);if(e.pathname.includes("/management/parent/")){const r=e.pathname.split("/")[3],n=t.companiesById[r];if(n!=null)return`${n.companyInfo.name} ${W.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const r=e.pathname.split("/")[4],n=t.companiesById[r];if(n!=null)return n.companyInfo.name}},E$e=e=>{switch(e){case"healthMonitor":return"health-monitor";case"taskManager":return"task-manager";case"aiAccountant":return"ai-accountant";case"creditAgent":return"credit-agent";default:return e}},c4n=e=>{switch(e){case"healthMonitor":return"health monitor";case"taskManager":return"task manager";case"aiAccountant":return"ai accountant";case"creditAgent":return"credit agent";default:return e}};function rCi(e,t){return{updateDownloadStateHandler:r=>{e(HXe(r))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(VW()),e(UW(!1)),As.clearAll();const r=t.locationHook.state?.origin??"/";t.navigate(r,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Vm?.trackOnboardingNewCustomerStarted()},onThreadClick:(r,n,a)=>{const l=r.entityType.split(".");if(l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(r,n,a)=>{const l=r.entityType.split(".");if(r.isGlobalComment&&l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function iCi(e,t){const{signedInUser:r,cockpitHeader:n}=t,a=e.tenantState.currentTenantId,c=yj(e)?.companyName??"",d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:a??""};return{signedInUser:r,cockpitHeader:n,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:c,cockpitEndPoint:`${Joe}/cockpitTabs`,authParams:d}}}const nCi=TJe(iCi,rCi)(Ani);function aCi(){const e=FNe(),t=As.getSignedInUser(),r=tZ(),n=mj(),a=oCi(),l=yh(p=>_Xe(p)),c={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:VXe()},d=n.pathname.split("/")[1];return Co.jsx(nCi,{locationHook:n,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:c,analytics:Vm,currentTab:d,navigate:r})}const sCi=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function lCi({appContent:e}){const t=sCi.filter(r=>zJe(r)).length===0;return Co.jsxs(Co.Fragment,{children:[t?null:Co.jsx(aCi,{}),Co.jsx(Co.Fragment,{children:e})]})}const cCi="cockpit",MZe="init-enter";function dCi({location:e,visitedUrl:t}){const{pathname:r}=e;return g.useLayoutEffect(()=>{const n=t.get(r||MZe);L$e(n!==void 0?n:0)}),null}const pCi=g.memo(dCi,(e,t)=>{const{location:r,visitedUrl:n}=e,{location:a}=t,l=r.pathname||MZe,c=uCi();return n.set(l,c),!((a.pathname!==r.pathname||a.search!==r.search)&&a.hash==="")}),L$e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),uCi=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},BZe=e=>g.lazy(async()=>{const t=e.toString(),r=As.getForceRefreshedComponents(),n=new Set(r),a=n.has(t);try{const l=await e();return n.delete(t),As.saveForceRefreshedComponents(Array.from(n)),l}catch(l){throw a||(n.add(t),As.saveForceRefreshedComponents(Array.from(n)),location.reload()),l}}),hCi=BZe(()=>r4(()=>import("./ScreenRoutes-CE-2Tj1d.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),mCi=BZe(()=>r4(()=>import("./SignInScreen-BSc5qqTv.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function gCi(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=tZ(),r=mj();return g.useEffect(()=>{tCi()},[]),g.useEffect(()=>{const n="signin/auth";As.isSignedIn()===!1&&!r.pathname.includes(n)&&t(n,{replace:!0,state:{...r.state,message:"...",origin:r.pathname}})}),Co.jsxs(yCi,{children:[Co.jsx(pCi,{visitedUrl:e.current,location:r}),Co.jsx(fCi,{})]})}const fCi=()=>{const e=As.isSignedIn(),t=As.getSignedInUser(),r=e&&N$e(t),n=yh(p=>yj(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:n.tenantId??""},l=yh(p=>UXe(p)),d=yh(p=>QXe(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return Co.jsx(gQr,{roomId:cCi,authParams:a,users:l,companies:d,authUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:r,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:Co.jsx(xCi,{})})},xCi=()=>Co.jsx(g.Suspense,{fallback:Co.jsx(bCi,{children:Co.jsx(Ao,{size:"Large",start:!0})}),children:Co.jsxs(RJe,{children:[Co.jsx(mT,{path:"/",element:Co.jsx(FJe,{to:"management",replace:!0})}),Co.jsx(mT,{path:"/signin/auth",element:Co.jsx(mCi,{})}),Co.jsx(mT,{path:"*",element:Co.jsx(lCi,{appContent:Co.jsx(hCi,{})})})]})}),yCi=eo("div")``,bCi=eo("div")`
97030
97029
  display: flex;
97031
97030
  flex: 1 1 auto;
97032
97031
  flex-direction: row;
@@ -97037,4 +97036,4 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
97037
97036
  background-color: ${e=>e.theme.colors.background};
97038
97037
  `;function wCi(){W.updateAppLocaleID("en"),$Ci();const e=kCi(),[t,r]=g.useState(!1),n=g.useCallback(l=>{l.data?.type==="UPDATE_READY"?r(!0):l.data?.type==="HIDE_UPDATE_POPUP"&&r(!1)},[]);g.useEffect(()=>("serviceWorker"in navigator&&(navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.addEventListener("controllerchange",()=>{r(!1)})),()=>{navigator.serviceWorker.removeEventListener("message",n)}),[n]);const a=()=>{r(!1),window.location.reload()};return Co.jsx(Tvi,{children:Co.jsx(OJe,{store:e,children:Co.jsx(v_t,{children:Co.jsxs(Qpo,{children:[t?Co.jsx(y7o,{onPrimaryClick:a}):null,Co.jsx(CCi,{})]})})})})}const hb=new WXe,vCi=()=>{const e=As.getSignedInUser(),t=yh(L=>yj(L)),r=yh(L=>qXe(L,t.companyId)),n=mj(),a=tZ(),l=NJe(),[c,d]=g.useState(null),p=IBr(e?.userId),u=t?.excludedResources?.fetchState=="Completed"?t.excludedResources.resources:[];g.useEffect(()=>()=>{l(Bre())},[]);const h=yh(L=>ZXe(L)),m=t?.externalConnections?.accounting[0]?.connectionName,f=()=>{l(Bre())},x=g.useMemo(()=>JXe(t.userRole),[t.userRole]),y=yh(L=>L.companyViewState.zeniUsers),b=g.useMemo(()=>{const L=y.fetchState==="Error"&&XXe(y.error);return L&&console.warn("Auto-logout triggered due to invalid session"),L},[y.fetchState,y.error]),w=g.useMemo(()=>{const L=y.fetchState==="Error"&&eet(y.error)===!0;return L&&console.warn("Page is not accessible, show 404"),L},[y.fetchState,y.error]),v=g.useRef(!1);g.useEffect(()=>(b&&!v.current&&(v.current=!0,A()),()=>{v.current=!1}),[b]),g.useEffect(()=>{w&&window.open("/page-not-found","_self")},[w]);const A=g.useCallback(()=>{d(null),hb.stop(),l(VW()),l(UW(!1)),As.clearAll();const L=n.state?.origin??"/";a(L,{replace:!0})},[l,d,n,a]),S=g.useCallback((L="manual")=>{L==="auto-logout"?wBo({idleTimeoutMinutes:p.idleTimeoutMinutes}):ABo(),d(null),hb.stop(),l(VW()),l(UW(!1)),As.clearAll(),window.location.href="/signin/auth"},[l,d,p.idleTimeoutMinutes]);g.useEffect(()=>{if(e?.zeniSessionId!=null)return hb.start({idleTimeoutMinutes:p.idleTimeoutMinutes,warningDurationSeconds:p.warningDurationSeconds,heartbeatIntervalMinutes:p.heartbeatIntervalMinutes,isAutoLogoutEnabled:p.isAutoLogoutEnabled},{onHeartbeat:()=>l(tet()),onWarningStart:L=>{Vm.trackSessionTimeoutPopupShown(L),d(L)},onWarningTick:d,onAutoLogout:()=>{Vm.trackSessionTimeoutAutoLogout(),S("auto-logout")},onSessionExtended:()=>d(null)}),()=>hb.stop()},[e?.zeniSessionId,p.isAutoLogoutEnabled,p.idleTimeoutMinutes,p.warningDurationSeconds,p.heartbeatIntervalMinutes,l,S,d]);const E=g.useMemo(()=>As.getSignedInUser(),[]),I=g.useMemo(()=>({userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:t.tenantId??""}),[E,t.tenantId]);return Co.jsxs(iuo,{globalInfo:{loggedInUser:e,loggedInUserRole:t?.userRole,excludedResources:u,loggedInUserRoleMap:x,currentTenant:t,connectionName:m,controllersList:r},children:[Co.jsx(Kpo,{toolkit:{analytics:Vm,sentry:nJe,authParams:I},children:Co.jsxs(npo,{endPoint:{url:Joe},children:[Co.jsx(LCr,{isOnDashboard:!1,showSnackbar:h.isSnackbarOpen,snackbar:{message:h.message,messageType:h.messageType,onRemoveSnackbar:f,showStatusIcon:h.showStatusIcon}}),Co.jsx(gCi,{})]})}),c!=null&&e!=null?Co.jsx(sii,{secondsRemaining:c,onContinueSession:()=>{Vm.trackSessionTimeoutClicked("continue",c),hb.continueSession()},onSignOut:()=>{Vm.trackSessionTimeoutClicked("sign_out",c),S()}}):null]})},CCi=()=>{const e=As.isSignedIn(),r=yh(n=>yj(n)).companyId;return Co.jsx(u2o,{isUserSignedIn:e,featureGateCustomFields:{companyId:r},zeniFeatureConfig:{currentFeatureEnv:Qvi,featureClientSecret:Sa.featureClientSecretCockpit,providerEndPoint:Xoe.statsigBaseUrl},children:Co.jsx(vCi,{})})},ACi=rJe(wCi);function $Ci(){console.log("Initialize any 3rd party libs!")}let OW=null;function kCi(){return OW===null&&(OW=SCi(),GXe().catch(e=>{console.error("Failed to load feature epics:",e),iJe(e,{tags:{critical:"true",module:"epicManager"}}),alert(`The application failed to load required modules. Some features may not work correctly.
97039
97038
 
97040
- Please refresh the page to try again.`)})),OW}function SCi(){console.warn(`initializing epic state with url ${JSON.stringify(J4)}`);const e=As.getSignedInUser(),t=YXe(J4,e?.userId,e?.zeniSessionId,void 0,Dv()),r=KXe();return r.userId!=null&&Vm.identify(r.userId,{tenant_id:r.tenantId}),t}const I$e="zeni-chunk-reload-at",ECi=6e4,LCi=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function ICi(){window.addEventListener("vite:preloadError",e=>{const t=e;j$e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{jCi(e.reason)&&j$e(e.reason)})}function j$e(e){try{const t=Number(sessionStorage.getItem(I$e))||0;if(Date.now()-t<ECi)return!1;sessionStorage.setItem(I$e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function jCi(e){const t=String(e?.message??e??"");return LCi.some(r=>t.includes(r))}const MCi=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),BCi="QA",DCi="https://zeni-webapp-qa.uc.r.appspot.com",M$e=`/service-worker.js?v=${Date.now()}&env=${BCi}&endpoint=${encodeURIComponent(DCi)}`;function PCi(e){if("serviceWorker"in navigator){if(new URL("https://qa.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{MCi?TCi(M$e):DZe(M$e)})}}function DZe(e,t){navigator.serviceWorker.register(e).then(r=>{r.onupdatefound=()=>{const n=r.installing;n!=null&&(n.onstatechange=()=>{n.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content available; will be used when all tabs are closed."),navigator.serviceWorker.controller?.postMessage({type:"UPDATE_READY"}),r.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},r.waiting&&r.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),r.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(r=>{console.error("Error during service worker registration:",r)})}function TCi(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(r=>{const n=r.headers.get("content-type");r.status===404||n!=null&&!n.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):DZe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const zCi=As.getSignedInUser(),RCi=zCi?.zeniSessionId;async function FCi(){try{const e=await qvi(),t=Wvi(e,Gvi+o1);Yvi(JSON.parse(t)),uet.createRoot(document.getElementById("root")).render(Co.jsx($.StrictMode,{children:Co.jsx(HJe,{basename:"/cockpit",children:Co.jsx(ACi,{})})})),OCi()}catch(e){console.error("Error initializing app:",e)}}function OCi(){const e=()=>{aJe({dsn:Sa.sentryDsn,integrations:[sJe(),lJe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Sa.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(r=>r.category!=="console"?!0:(r.message??"").toLowerCase().includes("called people set")||Array.isArray(r.data?.arguments)&&r.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(r.data?.arguments)&&(r.data.arguments=r.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const c=JSON.parse(l[0]);if(c.user_roles!=null)return delete c.user_roles,a.replace(l[0],JSON.stringify(c))}}catch{}return a})),!0))),t}}),cJe("session-id",RCi)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}ICi();FCi();PCi();export{Xfn as $,t4n as A,Jfn as B,e4n as C,jqi as D,lt as E,Mqi as F,W as G,n4n as H,FMi as I,DFe as J,Zfn as K,CRi as L,Qs as M,wD as N,ARi as O,s4n as P,qfn as Q,Kfn as R,r4n as S,a4n as T,ern as U,Wfn as V,BZe as W,DMo as X,OMi as Y,Joe as Z,fQr as _,Vm as a,l4n as a0,E$e as b,Ufn as c,Sa as d,Yfn as e,o as f,d4n as g,n0 as h,iUi as i,n2o as j,i4n as k,C as l,Gfn as m,Ao as n,Me as o,Qfn as p,Gzi as q,c4n as r,pl as s,AEi as t,tCi as u,j as v,_5 as w,o4n as x,rAi as y,As as z};
97039
+ Please refresh the page to try again.`)})),OW}function SCi(){console.warn(`initializing epic state with url ${JSON.stringify(J4)}`);const e=As.getSignedInUser(),t=YXe(J4,e?.userId,e?.zeniSessionId,void 0,Dv()),r=KXe();return r.userId!=null&&Vm.identify(r.userId,{tenant_id:r.tenantId}),t}const I$e="zeni-chunk-reload-at",ECi=6e4,LCi=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function ICi(){window.addEventListener("vite:preloadError",e=>{const t=e;j$e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{jCi(e.reason)&&j$e(e.reason)})}function j$e(e){try{const t=Number(sessionStorage.getItem(I$e))||0;if(Date.now()-t<ECi)return!1;sessionStorage.setItem(I$e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function jCi(e){const t=String(e?.message??e??"");return LCi.some(r=>t.includes(r))}const MCi=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),BCi="QA",DCi="https://zeni-webapp-qa.uc.r.appspot.com",M$e=`/service-worker.js?v=${Date.now()}&env=${BCi}&endpoint=${encodeURIComponent(DCi)}`;function PCi(e){if("serviceWorker"in navigator){if(new URL("https://qa.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{MCi?TCi(M$e):DZe(M$e)})}}function DZe(e,t){navigator.serviceWorker.register(e).then(r=>{r.onupdatefound=()=>{const n=r.installing;n!=null&&(n.onstatechange=()=>{n.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content available; will be used when all tabs are closed."),navigator.serviceWorker.controller?.postMessage({type:"UPDATE_READY"}),r.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},r.waiting&&r.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),r.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(r=>{console.error("Error during service worker registration:",r)})}function TCi(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(r=>{const n=r.headers.get("content-type");r.status===404||n!=null&&!n.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):DZe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const zCi=As.getSignedInUser(),RCi=zCi?.zeniSessionId;async function FCi(){try{const e=await qvi(),t=Wvi(e,Gvi+o1);Yvi(JSON.parse(t)),uet.createRoot(document.getElementById("root")).render(Co.jsx($.StrictMode,{children:Co.jsx(HJe,{basename:"/cockpit",children:Co.jsx(ACi,{})})})),OCi()}catch(e){console.error("Error initializing app:",e)}}function OCi(){const e=()=>{aJe({dsn:Sa.sentryDsn,integrations:[sJe(),lJe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Sa.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(r=>r.category!=="console"?!0:(r.message??"").toLowerCase().includes("called people set")||Array.isArray(r.data?.arguments)&&r.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(r.data?.arguments)&&(r.data.arguments=r.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const c=JSON.parse(l[0]);if(c.user_roles!=null)return delete c.user_roles,a.replace(l[0],JSON.stringify(c))}}catch{}return a})),!0))),t}}),cJe("session-id",RCi)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}ICi();FCi();PCi();export{Jfn as $,rAi as A,e4n as B,Xfn as C,Zfn as D,lt as E,jqi as F,W as G,Mqi as H,i4n as I,DFe as J,qfn as K,CRi as L,Qs as M,wD as N,ARi as O,a4n as P,ern as Q,Kfn as R,o4n as S,n4n as T,Yfn as U,Qfn as V,BZe as W,DMo as X,OMi as Y,Joe as Z,fQr as _,Vm as a,s4n as a0,E$e as b,Vfn as c,Sa as d,Gfn as e,iUi as f,c4n as g,n0 as h,n2o as i,r4n as j,C as k,FMi as l,Wfn as m,o as n,Me as o,Ufn as p,Gzi as q,l4n as r,pl as s,Ao as t,tCi as u,j as v,_5 as w,AEi as x,t4n as y,As as z};