@zeniai/web-cockpit-ui 2.2.55-dev → 2.2.56-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/CreditAgentRoutes-CWtniLRn.js +4 -0
- package/dist/assets/{Preview-5X9P7ZmI.js → Preview-DxnZ0G_9.js} +1 -1
- package/dist/assets/{ScreenRoutes-DdbAz88l.js → ScreenRoutes-DmtEuNk4.js} +8 -8
- package/dist/assets/SignInScreen-DUsSSHl_.js +1 -0
- package/dist/assets/{analytics-BHUwgbCp.js → analytics-D6nPZhvU.js} +1 -1
- package/dist/assets/{analyticsHelper-BguNWp-6.js → analyticsHelper-BGL92ghO.js} +1 -1
- package/dist/assets/{core-CjUOFtNP.js → core-Dwew_eJI.js} +1 -1
- package/dist/assets/{dash.all.min-BwyXoGmV.js → dash.all.min-DEQx_M4d.js} +1 -1
- package/dist/assets/{empty-CGqM-fQ6.js → empty-C9URe1wE.js} +1 -1
- package/dist/assets/{empty-DIiz3tVc.js → empty-CWKS44_T.js} +1 -1
- package/dist/assets/epic-DbBUeNum.js +2 -0
- package/dist/assets/{index-Cs6eGSj4.js → index-BQ1xq9Ax.js} +2 -2
- package/dist/assets/{index-DcGIrthm.css → index-Bd7ri422.css} +1 -1
- package/dist/assets/{index-BRCfM85b.js → index-BgQY9QEb.js} +1 -1
- package/dist/assets/{index-D0y-AHOf.js → index-Bitr7r5a.js} +1 -1
- package/dist/assets/{index-7-X9ZJj6.js → index-BssKJygd.js} +20406 -20541
- package/dist/assets/{index-CdOmOrCq.js → index-DG96zgnQ.js} +1 -1
- package/dist/assets/{index-CwQciV6W.js → index-DPOaVmXP.js} +1 -1
- package/dist/assets/{index-ibUWH8aZ.js → index-urN9o0mh.js} +1 -1
- package/dist/assets/{lexical-D0-Opw0M.js → lexical-CKIF0fv8.js} +1 -1
- package/dist/assets/{liveblocks-1rPyJrPS.js → liveblocks-bdH_HyD4.js} +1 -1
- package/dist/assets/{lottie-iG9PQglI.js → lottie-ODFW7XpP.js} +1 -1
- package/dist/assets/mui-Dpk20_cL.js +138 -0
- package/dist/assets/{react-D9Pa3CZP.js → react-5k8YSArH.js} +1 -1
- package/dist/assets/{react-D2PG85gs.js → react-B58oz63_.js} +2 -2
- package/dist/assets/{react-C1L68OAC.js → react-BVou-Xve.js} +1 -1
- package/dist/assets/{react-gS9tl2fa.js → react-BrwPLcTD.js} +1 -1
- package/dist/assets/{react-Dso6ZBjL.js → react-DxYnPaL4.js} +1 -1
- package/dist/assets/{react-eH9pn9yJ.js → react-K8PNfPlF.js} +1 -1
- package/dist/assets/{react-D-BQBnLA.js → react-NOoqN2L8.js} +1 -1
- package/dist/assets/{react-odCLUV4P.js → react-dvrCYrIU.js} +1 -1
- package/dist/assets/recharts-Cy2son-o.js +65 -0
- package/dist/assets/{sentry-DnKCIlp7.js → sentry-Dwm-tWfG.js} +1 -1
- package/dist/assets/{url-CyApCW3Z.js → url-DV3lGv0k.js} +1 -1
- package/dist/assets/{url-Bv6R7pEO.js → url-DwJCVbv4.js} +1 -1
- package/dist/assets/{utils-DmBc9W1c.js → utils-ByTJL3Oq.js} +1 -1
- package/dist/assets/{zeni-epic-state-BjcbtVhk.js → zeni-epic-state-BAX-zerj.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/CreditAgentRoutes-B9qoucdM.js +0 -4
- package/dist/assets/SignInScreen-B78SkdbK.js +0 -1
- package/dist/assets/epic-DgmV8wuj.js +0 -2
- package/dist/assets/mui-BRD3zvN1.js +0 -9
- package/dist/assets/recharts-CHQcl4ep.js +0 -65
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-bdH_HyD4.js";import{u as P,P as R}from"./ScreenRoutes-DmtEuNk4.js";import{a as f}from"./sentry-Dwm-tWfG.js";import{i as v,n as U,g as m,h as T,k as C,l as I,N as j}from"./core-Dwew_eJI.js";import{Sc as N,Sd as k,lx as E,Se as M,mn as L,mq as $,mc as _,Sf as O,Sg as q,mk as B,mg as F}from"./zeni-epic-state-BAX-zerj.js";import{z as V,P as G,G as J,n as Z,S as H,R as K,w as Q,a as W,g as X,b as Y}from"./index-BssKJygd.js";import{n as ee}from"./mui-Dpk20_cL.js";import"./recharts-Cy2son-o.js";import"./analyticsHelper-BGL92ghO.js";import"./utils-ByTJL3Oq.js";import"./empty-C9URe1wE.js";import"./index-urN9o0mh.js";import"./url-DV3lGv0k.js";import"./index-Bitr7r5a.js";import"./analytics-D6nPZhvU.js";import"./lottie-ODFW7XpP.js";import"./lexical-CKIF0fv8.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="687ca5f2-e651-45e4-a2c9-dc4b7e4f42a0",a._sentryDebugIdIdentifier="sentry-dbid-687ca5f2-e651-45e4-a2c9-dc4b7e4f42a0")}catch{}})();function te(a,t){return{headerData:{allTabOptions:K,selectedTabOption:Q("creditAgent")},creditAgentPageData:{macroData:{data:t.macroCombined.data,fetchState:t.macroCombined.fetchStatus.fetchState,updateState:t.macroCombined.updateStatus.fetchState},cardProfilesData:t.cardProfilesData}}}function ne(a,t){return{headerActions:{onTabChange:n=>{const g=Y(n),c=X(n);W.trackCockpitTabClicked(c),t.navigate(`../../${g}`,{replace:!0})}},creditAgentPageActions:{onFetchMacro:()=>{a(F())},onSaveMacro:n=>{a(B(n))},onResetSaveMacro:()=>{a(q())},onUIStateChange:n=>{a(O(n))},cardProfilesActions:t.cardProfilesActions}}}const ae=T(te,ne)(H),oe=ee.div`
|
|
2
|
+
padding: ${Z.sp5};
|
|
3
|
+
text-align: center;
|
|
4
|
+
`;function re(){const a=v(),t=U(),n=m(N),g=m(k),[c,h]=f.useState(new Set),S=f.useRef(new Set),b=m(e=>e.tenantState.currentTenantId),y=m(e=>e.companyViewState.zeniUsers.fetchState);f.useEffect(()=>{y==="Not-Started"&&t(E())},[t,y]);const d=V.getSignedInUser(),A=d!=null&&[d.firstName,d.lastName].filter(Boolean).join(" ")||void 0,w=f.useMemo(()=>({onFetch:()=>{t(_())},onUpdateProfile:(e,o,r)=>{const i=r.updatedByName??A;t($({tenantId:o,tenantEmailDomain:e,update:{...r,updatedByName:i}}))},onAnalyse:e=>{h(o=>new Set(o).add(e)),t(L(e))},onDownloadReport:()=>{const e=M(n.rows),o=d?.userId??"",r=d?.zeniSessionId??"",i=b??"";if(!o||!r||!i)return;const z=encodeURIComponent(JSON.stringify(e)),D=`${G}/tableDownload?query=${z}`;fetch(D,{headers:{"zeni-user-id":o,"zeni-session-id":r,"zeni-tenant-id":i}}).then(async l=>{if(!l.ok){const u=await l.text();throw new Error(`Download failed: ${l.status} ${u}`)}return l.blob()}).then(l=>{const u=URL.createObjectURL(l),p=document.createElement("a");p.href=u,p.download=`${e.file_name}.xlsx`,p.click(),URL.revokeObjectURL(u)}).catch(()=>{})}}),[t,A,d,b,n.rows]);f.useEffect(()=>{if(c.size===0)return;const e=new Set;for(const o of c){const r=n.rows.find(i=>i.tenantId===o);r!=null&&r.isAnalyzing?S.current.add(o):r!=null&&!r.isAnalyzing&&S.current.has(o)&&(e.add(o),S.current.delete(o))}e.size>0&&h(o=>{const r=new Set(o);for(const i of e)r.delete(i);return r})},[n.rows,c]);const x=f.useMemo(()=>({fetchState:n.fetchStatus.fetchState,rows:n.rows.map(e=>e.isAnalyzing||e.tenantId!=null&&c.has(e.tenantId)?{...e,isAnalyzing:!0}:e),uiState:n.uiState}),[n,c]);return d==null?s.jsx(oe,{children:J.getLocalizedStrings().cockpit.creditAgent.notSignedIn}):s.jsx(ae,{macroCombined:g,navigate:a,cardProfilesActions:w,cardProfilesData:x})}function we(){const{isAllowed:a,isLoading:t}=P();return t?null:a?s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(R,{element:s.jsx(re,{})})})}):s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(j,{to:"/management",replace:!0})})})}export{we as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,R as n}from"./sentry-
|
|
1
|
+
import{a as h,R as n}from"./sentry-Dwm-tWfG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="f4ba052c-9e02-4735-9454-bf2cba2bc7bc",t._sentryDebugIdIdentifier="sentry-dbid-f4ba052c-9e02-4735-9454-bf2cba2bc7bc")}catch{}})();const d="64px",u={},k=({src:t,light:a,oEmbedUrl:r,onClickPreview:s,playIcon:m,previewTabIndex:I,previewAriaLabel:f})=>{const[b,o]=h.useState(null);h.useEffect(()=>{!t||!a||!r||_({src:t,light:a,oEmbedUrl:r})},[t,a,r]);const _=async({src:e,light:i,oEmbedUrl:E})=>{if(n.isValidElement(i))return;if(typeof i=="string"){o(i);return}if(u[e]){o(u[e]);return}o(null);const y=await(await fetch(E.replace("{url}",e))).json();if(y.thumbnail_url){const g=y.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");o(g),u[e]=g}},w=e=>{(e.key==="Enter"||e.key===" ")&&s?.(e)},v=e=>{s?.(e)},l=n.isValidElement(a),p={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:b&&!l?`url(${b})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...p},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:d,width:d,height:d,position:l?"absolute":void 0,...p},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},x=n.createElement("div",{style:c.shadow,className:"react-player__shadow"},n.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return n.createElement("div",{style:c.preview,className:"react-player__preview",tabIndex:I,onClick:v,onKeyDown:w,...f?{"aria-label":f}:{}},l?a:null,m||x)};var S=k;export{S as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreditAgentRoutes-
|
|
2
|
-
import{Rk as Df,Rl as Mf,ls as It,f0 as ys,Rm as Nt,f9 as nn,e_ as Ff,Rn as Jt,f5 as on,Ro as fd,Rp as hd,Rq as ur,Rr as dd,jP as Bf,lu as Ct,jM as pd,jT as Uf,Rs as _s,jV as md,jW as gd,Rt as wr,Ru as cr,ji as vd,Rv as dn,Rw as Vo,dg as yd,gZ as $o,gW as sn,h2 as Mt,h0 as _d,Rx as Vf,Ry as $f,k8 as bd,k5 as wd,Rz as Ed,kj as Sd,ke as bs,kb as Rd,k0 as Od,RA as Td,eI as xd,dn as Ad,lG as zf,RB as Id,be as an,jZ as ws,k2 as Cd,A0 as Gf,lt as pn,RC as Hf,RD as pt,lR as un,lM as Zf,kD as zo,RE as Pd,lU as kd,H as et,bm as Go,RF as jd,jf as Ld,RG as qd,RH as Wf,RI as Nd,yk as Es,xS as Dd,RJ as Md,xY as An,RK as Fd,x_ as Bd,RL as Tt,xP as Ud,d4 as Vd,lx as Yf,ly as Jf,lw as Ho,lv as Zo,lz as $d,RM as zd,yn as Gd,RN as Hd,y4 as Zd,yh as Wd,RO as Yd,y8 as Jd,RP as Kd,RQ as Kt,RR as Wo,RS as Xd,RT as Qd,rZ as ep,s3 as Kf,RU as Xf,iM as tp,Qp as Qf,RV as rp,Qj as np,RW as ip,RX as ap,s6 as op,RY as sp,Qu as up,Qi as cp,BT as eh,RZ as In,R_ as th,N6 as Yo,MU as lp,N9 as rh,MX as fp,R$ as hp,N0 as dp,MO as pp,MR as mp,S0 as gp,Nd as vp,N3 as yp,bp as _p,bd as bp,S1 as wp,S2 as zt,S3 as Ep,S4 as Sp,S5 as Rp,kr as Mo,kn as Op,kx as Tp,kA as Ss,ba as nh}from"./zeni-epic-state-BjcbtVhk.js";import{j as V}from"./liveblocks-1rPyJrPS.js";import{a as ce,p as ye,d as ih,c as Jo,g as xp}from"./sentry-DnKCIlp7.js";import{W as wt,U as xt,z as He,c as Ap,h as Ip,o as lr,E as Ft,C as Cp,w as Et,$ as ah,a as at,b as Fe,d as Pt,g as Bt,q as Pp,u as kp,_ as jp,m as Lp,e as mn,f as qp,G as fr,s as gn,n as Dt,T as Np,i as Dp,A as vn,S as Mp,j as Fp,k as Cn,P as Bp,l as oh,y as Up,p as sh,N as uh,r as Fo,t as Vp,v as $p,x as zp,B as ch,D as Gp,F as Hp,H as Zp,I as Wp,J as Yp,K as Jp,L as Kp,M as Xp,O as Qp,Q as em,R as tm,V as rm,X as lh}from"./index-7-X9ZJj6.js";import{f as nm}from"./analyticsHelper-BguNWp-6.js";import{i as Be,n as We,g as Se,o as ot,N as ir,k as gt,l as Te,p as fh,h as ze,u as Ko,j as Bo}from"./core-CjUOFtNP.js";import{D as hr,n as tt,S as Ht}from"./mui-BRD3zvN1.js";import{a as Ze,b as im,c as am,d as om,e as Xo,f as sm,g as um,h as cm,i as Zt,j as lm,k as or,l as yn,m as fm,n as dr,o as hm}from"./utils-DmBc9W1c.js";import{r as Qo}from"./empty-CGqM-fQ6.js";import{r as pr,a as dm}from"./index-ibUWH8aZ.js";import{r as pm}from"./index-D0y-AHOf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="741546be-ccc5-4454-a43b-a5f723ba8182",e._sentryDebugIdIdentifier="sentry-dbid-741546be-ccc5-4454-a43b-a5f723ba8182")}catch{}})();var Pn={},Rs;function _n(){return Rs||(Rs=1,(function(e){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function a(t,n){return Object.prototype.hasOwnProperty.call(t,n)}e.assign=function(t){for(var n=Array.prototype.slice.call(arguments,1);n.length;){var s=n.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var d in s)a(s,d)&&(t[d]=s[d])}}return t},e.shrinkBuf=function(t,n){return t.length===n?t:t.subarray?t.subarray(0,n):(t.length=n,t)};var i={arraySet:function(t,n,s,d,f){if(n.subarray&&t.subarray){t.set(n.subarray(s,s+d),f);return}for(var l=0;l<d;l++)t[f+l]=n[s+l]},flattenChunks:function(t){var n,s,d,f,l,h;for(d=0,n=0,s=t.length;n<s;n++)d+=t[n].length;for(h=new Uint8Array(d),f=0,n=0,s=t.length;n<s;n++)l=t[n],h.set(l,f),f+=l.length;return h}},o={arraySet:function(t,n,s,d,f){for(var l=0;l<d;l++)t[f+l]=n[s+l]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(r)})(Pn)),Pn}var ut={},kt={},Os;function mm(){if(Os)return kt;Os=1;var e=_n(),r=4,a=0,i=1,o=2;function t(I){for(var ne=I.length;--ne>=0;)I[ne]=0}var n=0,s=1,d=2,f=3,l=258,h=29,c=256,b=c+1+h,m=30,y=19,g=2*b+1,u=15,_=16,E=7,v=256,w=16,x=17,O=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],D=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=512,R=new Array((b+2)*2);t(R);var L=new Array(m*2);t(L);var q=new Array(S);t(q);var z=new Array(l-f+1);t(z);var P=new Array(h);t(P);var j=new Array(m);t(j);function k(I,ne,se,fe,Z){this.static_tree=I,this.extra_bits=ne,this.extra_base=se,this.elems=fe,this.max_length=Z,this.has_stree=I&&I.length}var U,W,H;function M(I,ne){this.dyn_tree=I,this.max_code=0,this.stat_desc=ne}function N(I){return I<256?q[I]:q[256+(I>>>7)]}function B(I,ne){I.pending_buf[I.pending++]=ne&255,I.pending_buf[I.pending++]=ne>>>8&255}function $(I,ne,se){I.bi_valid>_-se?(I.bi_buf|=ne<<I.bi_valid&65535,B(I,I.bi_buf),I.bi_buf=ne>>_-I.bi_valid,I.bi_valid+=se-_):(I.bi_buf|=ne<<I.bi_valid&65535,I.bi_valid+=se)}function K(I,ne,se){$(I,se[ne*2],se[ne*2+1])}function X(I,ne){var se=0;do se|=I&1,I>>>=1,se<<=1;while(--ne>0);return se>>>1}function ae(I){I.bi_valid===16?(B(I,I.bi_buf),I.bi_buf=0,I.bi_valid=0):I.bi_valid>=8&&(I.pending_buf[I.pending++]=I.bi_buf&255,I.bi_buf>>=8,I.bi_valid-=8)}function ue(I,ne){var se=ne.dyn_tree,fe=ne.max_code,Z=ne.stat_desc.static_tree,ie=ne.stat_desc.has_stree,T=ne.stat_desc.extra_bits,oe=ne.stat_desc.extra_base,be=ne.stat_desc.max_length,p,te,re,A,G,ee,_e=0;for(A=0;A<=u;A++)I.bl_count[A]=0;for(se[I.heap[I.heap_max]*2+1]=0,p=I.heap_max+1;p<g;p++)te=I.heap[p],A=se[se[te*2+1]*2+1]+1,A>be&&(A=be,_e++),se[te*2+1]=A,!(te>fe)&&(I.bl_count[A]++,G=0,te>=oe&&(G=T[te-oe]),ee=se[te*2],I.opt_len+=ee*(A+G),ie&&(I.static_len+=ee*(Z[te*2+1]+G)));if(_e!==0){do{for(A=be-1;I.bl_count[A]===0;)A--;I.bl_count[A]--,I.bl_count[A+1]+=2,I.bl_count[be]--,_e-=2}while(_e>0);for(A=be;A!==0;A--)for(te=I.bl_count[A];te!==0;)re=I.heap[--p],!(re>fe)&&(se[re*2+1]!==A&&(I.opt_len+=(A-se[re*2+1])*se[re*2],se[re*2+1]=A),te--)}}function ve(I,ne,se){var fe=new Array(u+1),Z=0,ie,T;for(ie=1;ie<=u;ie++)fe[ie]=Z=Z+se[ie-1]<<1;for(T=0;T<=ne;T++){var oe=I[T*2+1];oe!==0&&(I[T*2]=X(fe[oe]++,oe))}}function me(){var I,ne,se,fe,Z,ie=new Array(u+1);for(se=0,fe=0;fe<h-1;fe++)for(P[fe]=se,I=0;I<1<<C[fe];I++)z[se++]=fe;for(z[se-1]=fe,Z=0,fe=0;fe<16;fe++)for(j[fe]=Z,I=0;I<1<<D[fe];I++)q[Z++]=fe;for(Z>>=7;fe<m;fe++)for(j[fe]=Z<<7,I=0;I<1<<D[fe]-7;I++)q[256+Z++]=fe;for(ne=0;ne<=u;ne++)ie[ne]=0;for(I=0;I<=143;)R[I*2+1]=8,I++,ie[8]++;for(;I<=255;)R[I*2+1]=9,I++,ie[9]++;for(;I<=279;)R[I*2+1]=7,I++,ie[7]++;for(;I<=287;)R[I*2+1]=8,I++,ie[8]++;for(ve(R,b+1,ie),I=0;I<m;I++)L[I*2+1]=5,L[I*2]=X(I,5);U=new k(R,C,c+1,b,u),W=new k(L,D,0,m,u),H=new k(new Array(0),Y,0,y,E)}function we(I){var ne;for(ne=0;ne<b;ne++)I.dyn_ltree[ne*2]=0;for(ne=0;ne<m;ne++)I.dyn_dtree[ne*2]=0;for(ne=0;ne<y;ne++)I.bl_tree[ne*2]=0;I.dyn_ltree[v*2]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function Ce(I){I.bi_valid>8?B(I,I.bi_buf):I.bi_valid>0&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function ke(I,ne,se,fe){Ce(I),B(I,se),B(I,~se),e.arraySet(I.pending_buf,I.window,ne,se,I.pending),I.pending+=se}function je(I,ne,se,fe){var Z=ne*2,ie=se*2;return I[Z]<I[ie]||I[Z]===I[ie]&&fe[ne]<=fe[se]}function Ae(I,ne,se){for(var fe=I.heap[se],Z=se<<1;Z<=I.heap_len&&(Z<I.heap_len&&je(ne,I.heap[Z+1],I.heap[Z],I.depth)&&Z++,!je(ne,fe,I.heap[Z],I.depth));)I.heap[se]=I.heap[Z],se=Z,Z<<=1;I.heap[se]=fe}function Ee(I,ne,se){var fe,Z,ie=0,T,oe;if(I.last_lit!==0)do fe=I.pending_buf[I.d_buf+ie*2]<<8|I.pending_buf[I.d_buf+ie*2+1],Z=I.pending_buf[I.l_buf+ie],ie++,fe===0?K(I,Z,ne):(T=z[Z],K(I,T+c+1,ne),oe=C[T],oe!==0&&(Z-=P[T],$(I,Z,oe)),fe--,T=N(fe),K(I,T,se),oe=D[T],oe!==0&&(fe-=j[T],$(I,fe,oe)));while(ie<I.last_lit);K(I,v,ne)}function $e(I,ne){var se=ne.dyn_tree,fe=ne.stat_desc.static_tree,Z=ne.stat_desc.has_stree,ie=ne.stat_desc.elems,T,oe,be=-1,p;for(I.heap_len=0,I.heap_max=g,T=0;T<ie;T++)se[T*2]!==0?(I.heap[++I.heap_len]=be=T,I.depth[T]=0):se[T*2+1]=0;for(;I.heap_len<2;)p=I.heap[++I.heap_len]=be<2?++be:0,se[p*2]=1,I.depth[p]=0,I.opt_len--,Z&&(I.static_len-=fe[p*2+1]);for(ne.max_code=be,T=I.heap_len>>1;T>=1;T--)Ae(I,se,T);p=ie;do T=I.heap[1],I.heap[1]=I.heap[I.heap_len--],Ae(I,se,1),oe=I.heap[1],I.heap[--I.heap_max]=T,I.heap[--I.heap_max]=oe,se[p*2]=se[T*2]+se[oe*2],I.depth[p]=(I.depth[T]>=I.depth[oe]?I.depth[T]:I.depth[oe])+1,se[T*2+1]=se[oe*2+1]=p,I.heap[1]=p++,Ae(I,se,1);while(I.heap_len>=2);I.heap[--I.heap_max]=I.heap[1],ue(I,ne),ve(se,be,I.bl_count)}function st(I,ne,se){var fe,Z=-1,ie,T=ne[1],oe=0,be=7,p=4;for(T===0&&(be=138,p=3),ne[(se+1)*2+1]=65535,fe=0;fe<=se;fe++)ie=T,T=ne[(fe+1)*2+1],!(++oe<be&&ie===T)&&(oe<p?I.bl_tree[ie*2]+=oe:ie!==0?(ie!==Z&&I.bl_tree[ie*2]++,I.bl_tree[w*2]++):oe<=10?I.bl_tree[x*2]++:I.bl_tree[O*2]++,oe=0,Z=ie,T===0?(be=138,p=3):ie===T?(be=6,p=3):(be=7,p=4))}function qe(I,ne,se){var fe,Z=-1,ie,T=ne[1],oe=0,be=7,p=4;for(T===0&&(be=138,p=3),fe=0;fe<=se;fe++)if(ie=T,T=ne[(fe+1)*2+1],!(++oe<be&&ie===T)){if(oe<p)do K(I,ie,I.bl_tree);while(--oe!==0);else ie!==0?(ie!==Z&&(K(I,ie,I.bl_tree),oe--),K(I,w,I.bl_tree),$(I,oe-3,2)):oe<=10?(K(I,x,I.bl_tree),$(I,oe-3,3)):(K(I,O,I.bl_tree),$(I,oe-11,7));oe=0,Z=ie,T===0?(be=138,p=3):ie===T?(be=6,p=3):(be=7,p=4)}}function De(I){var ne;for(st(I,I.dyn_ltree,I.l_desc.max_code),st(I,I.dyn_dtree,I.d_desc.max_code),$e(I,I.bl_desc),ne=y-1;ne>=3&&I.bl_tree[F[ne]*2+1]===0;ne--);return I.opt_len+=3*(ne+1)+5+5+4,ne}function Ye(I,ne,se,fe){var Z;for($(I,ne-257,5),$(I,se-1,5),$(I,fe-4,4),Z=0;Z<fe;Z++)$(I,I.bl_tree[F[Z]*2+1],3);qe(I,I.dyn_ltree,ne-1),qe(I,I.dyn_dtree,se-1)}function J(I){var ne=4093624447,se;for(se=0;se<=31;se++,ne>>>=1)if(ne&1&&I.dyn_ltree[se*2]!==0)return a;if(I.dyn_ltree[18]!==0||I.dyn_ltree[20]!==0||I.dyn_ltree[26]!==0)return i;for(se=32;se<c;se++)if(I.dyn_ltree[se*2]!==0)return i;return a}var Q=!1;function le(I){Q||(me(),Q=!0),I.l_desc=new M(I.dyn_ltree,U),I.d_desc=new M(I.dyn_dtree,W),I.bl_desc=new M(I.bl_tree,H),I.bi_buf=0,I.bi_valid=0,we(I)}function ge(I,ne,se,fe){$(I,(n<<1)+(fe?1:0),3),ke(I,ne,se)}function he(I){$(I,s<<1,3),K(I,v,R),ae(I)}function Re(I,ne,se,fe){var Z,ie,T=0;I.level>0?(I.strm.data_type===o&&(I.strm.data_type=J(I)),$e(I,I.l_desc),$e(I,I.d_desc),T=De(I),Z=I.opt_len+3+7>>>3,ie=I.static_len+3+7>>>3,ie<=Z&&(Z=ie)):Z=ie=se+5,se+4<=Z&&ne!==-1?ge(I,ne,se,fe):I.strategy===r||ie===Z?($(I,(s<<1)+(fe?1:0),3),Ee(I,R,L)):($(I,(d<<1)+(fe?1:0),3),Ye(I,I.l_desc.max_code+1,I.d_desc.max_code+1,T+1),Ee(I,I.dyn_ltree,I.dyn_dtree)),we(I),fe&&Ce(I)}function Oe(I,ne,se){return I.pending_buf[I.d_buf+I.last_lit*2]=ne>>>8&255,I.pending_buf[I.d_buf+I.last_lit*2+1]=ne&255,I.pending_buf[I.l_buf+I.last_lit]=se&255,I.last_lit++,ne===0?I.dyn_ltree[se*2]++:(I.matches++,ne--,I.dyn_ltree[(z[se]+c+1)*2]++,I.dyn_dtree[N(ne)*2]++),I.last_lit===I.lit_bufsize-1}return kt._tr_init=le,kt._tr_stored_block=ge,kt._tr_flush_block=Re,kt._tr_tally=Oe,kt._tr_align=he,kt}var kn,Ts;function hh(){if(Ts)return kn;Ts=1;function e(r,a,i,o){for(var t=r&65535|0,n=r>>>16&65535|0,s=0;i!==0;){s=i>2e3?2e3:i,i-=s;do t=t+a[o++]|0,n=n+t|0;while(--s);t%=65521,n%=65521}return t|n<<16|0}return kn=e,kn}var jn,xs;function dh(){if(xs)return jn;xs=1;function e(){for(var i,o=[],t=0;t<256;t++){i=t;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;o[t]=i}return o}var r=e();function a(i,o,t,n){var s=r,d=n+t;i^=-1;for(var f=n;f<d;f++)i=i>>>8^s[(i^o[f])&255];return i^-1}return jn=a,jn}var Ln,As;function gm(){return As||(As=1,Ln={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Ln}var Is;function vm(){if(Is)return ut;Is=1;var e=_n(),r=mm(),a=hh(),i=dh(),o=gm(),t=0,n=1,s=3,d=4,f=5,l=0,h=1,c=-2,b=-3,m=-5,y=-1,g=1,u=2,_=3,E=4,v=0,w=2,x=8,O=9,C=15,D=8,Y=29,F=256,S=F+1+Y,R=30,L=19,q=2*S+1,z=15,P=3,j=258,k=j+P+1,U=32,W=42,H=69,M=73,N=91,B=103,$=113,K=666,X=1,ae=2,ue=3,ve=4,me=3;function we(p,te){return p.msg=o[te],te}function Ce(p){return(p<<1)-(p>4?9:0)}function ke(p){for(var te=p.length;--te>=0;)p[te]=0}function je(p){var te=p.state,re=te.pending;re>p.avail_out&&(re=p.avail_out),re!==0&&(e.arraySet(p.output,te.pending_buf,te.pending_out,re,p.next_out),p.next_out+=re,te.pending_out+=re,p.total_out+=re,p.avail_out-=re,te.pending-=re,te.pending===0&&(te.pending_out=0))}function Ae(p,te){r._tr_flush_block(p,p.block_start>=0?p.block_start:-1,p.strstart-p.block_start,te),p.block_start=p.strstart,je(p.strm)}function Ee(p,te){p.pending_buf[p.pending++]=te}function $e(p,te){p.pending_buf[p.pending++]=te>>>8&255,p.pending_buf[p.pending++]=te&255}function st(p,te,re,A){var G=p.avail_in;return G>A&&(G=A),G===0?0:(p.avail_in-=G,e.arraySet(te,p.input,p.next_in,G,re),p.state.wrap===1?p.adler=a(p.adler,te,G,re):p.state.wrap===2&&(p.adler=i(p.adler,te,G,re)),p.next_in+=G,p.total_in+=G,G)}function qe(p,te){var re=p.max_chain_length,A=p.strstart,G,ee,_e=p.prev_length,de=p.nice_match,pe=p.strstart>p.w_size-k?p.strstart-(p.w_size-k):0,xe=p.window,vt=p.w_mask,Le=p.prev,Ie=p.strstart+j,Ue=xe[A+_e-1],Je=xe[A+_e];p.prev_length>=p.good_match&&(re>>=2),de>p.lookahead&&(de=p.lookahead);do if(G=te,!(xe[G+_e]!==Je||xe[G+_e-1]!==Ue||xe[G]!==xe[A]||xe[++G]!==xe[A+1])){A+=2,G++;do;while(xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&A<Ie);if(ee=j-(Ie-A),A=Ie-j,ee>_e){if(p.match_start=te,_e=ee,ee>=de)break;Ue=xe[A+_e-1],Je=xe[A+_e]}}while((te=Le[te&vt])>pe&&--re!==0);return _e<=p.lookahead?_e:p.lookahead}function De(p){var te=p.w_size,re,A,G,ee,_e;do{if(ee=p.window_size-p.lookahead-p.strstart,p.strstart>=te+(te-k)){e.arraySet(p.window,p.window,te,te,0),p.match_start-=te,p.strstart-=te,p.block_start-=te,A=p.hash_size,re=A;do G=p.head[--re],p.head[re]=G>=te?G-te:0;while(--A);A=te,re=A;do G=p.prev[--re],p.prev[re]=G>=te?G-te:0;while(--A);ee+=te}if(p.strm.avail_in===0)break;if(A=st(p.strm,p.window,p.strstart+p.lookahead,ee),p.lookahead+=A,p.lookahead+p.insert>=P)for(_e=p.strstart-p.insert,p.ins_h=p.window[_e],p.ins_h=(p.ins_h<<p.hash_shift^p.window[_e+1])&p.hash_mask;p.insert&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[_e+P-1])&p.hash_mask,p.prev[_e&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=_e,_e++,p.insert--,!(p.lookahead+p.insert<P)););}while(p.lookahead<k&&p.strm.avail_in!==0)}function Ye(p,te){var re=65535;for(re>p.pending_buf_size-5&&(re=p.pending_buf_size-5);;){if(p.lookahead<=1){if(De(p),p.lookahead===0&&te===t)return X;if(p.lookahead===0)break}p.strstart+=p.lookahead,p.lookahead=0;var A=p.block_start+re;if((p.strstart===0||p.strstart>=A)&&(p.lookahead=p.strstart-A,p.strstart=A,Ae(p,!1),p.strm.avail_out===0)||p.strstart-p.block_start>=p.w_size-k&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=0,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):(p.strstart>p.block_start&&(Ae(p,!1),p.strm.avail_out===0),X)}function J(p,te){for(var re,A;;){if(p.lookahead<k){if(De(p),p.lookahead<k&&te===t)return X;if(p.lookahead===0)break}if(re=0,p.lookahead>=P&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart),re!==0&&p.strstart-re<=p.w_size-k&&(p.match_length=qe(p,re)),p.match_length>=P)if(A=r._tr_tally(p,p.strstart-p.match_start,p.match_length-P),p.lookahead-=p.match_length,p.match_length<=p.max_lazy_match&&p.lookahead>=P){p.match_length--;do p.strstart++,p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart;while(--p.match_length!==0);p.strstart++}else p.strstart+=p.match_length,p.match_length=0,p.ins_h=p.window[p.strstart],p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+1])&p.hash_mask;else A=r._tr_tally(p,0,p.window[p.strstart]),p.lookahead--,p.strstart++;if(A&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=p.strstart<P-1?p.strstart:P-1,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function Q(p,te){for(var re,A,G;;){if(p.lookahead<k){if(De(p),p.lookahead<k&&te===t)return X;if(p.lookahead===0)break}if(re=0,p.lookahead>=P&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart),p.prev_length=p.match_length,p.prev_match=p.match_start,p.match_length=P-1,re!==0&&p.prev_length<p.max_lazy_match&&p.strstart-re<=p.w_size-k&&(p.match_length=qe(p,re),p.match_length<=5&&(p.strategy===g||p.match_length===P&&p.strstart-p.match_start>4096)&&(p.match_length=P-1)),p.prev_length>=P&&p.match_length<=p.prev_length){G=p.strstart+p.lookahead-P,A=r._tr_tally(p,p.strstart-1-p.prev_match,p.prev_length-P),p.lookahead-=p.prev_length-1,p.prev_length-=2;do++p.strstart<=G&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart);while(--p.prev_length!==0);if(p.match_available=0,p.match_length=P-1,p.strstart++,A&&(Ae(p,!1),p.strm.avail_out===0))return X}else if(p.match_available){if(A=r._tr_tally(p,0,p.window[p.strstart-1]),A&&Ae(p,!1),p.strstart++,p.lookahead--,p.strm.avail_out===0)return X}else p.match_available=1,p.strstart++,p.lookahead--}return p.match_available&&(A=r._tr_tally(p,0,p.window[p.strstart-1]),p.match_available=0),p.insert=p.strstart<P-1?p.strstart:P-1,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function le(p,te){for(var re,A,G,ee,_e=p.window;;){if(p.lookahead<=j){if(De(p),p.lookahead<=j&&te===t)return X;if(p.lookahead===0)break}if(p.match_length=0,p.lookahead>=P&&p.strstart>0&&(G=p.strstart-1,A=_e[G],A===_e[++G]&&A===_e[++G]&&A===_e[++G])){ee=p.strstart+j;do;while(A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&G<ee);p.match_length=j-(ee-G),p.match_length>p.lookahead&&(p.match_length=p.lookahead)}if(p.match_length>=P?(re=r._tr_tally(p,1,p.match_length-P),p.lookahead-=p.match_length,p.strstart+=p.match_length,p.match_length=0):(re=r._tr_tally(p,0,p.window[p.strstart]),p.lookahead--,p.strstart++),re&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=0,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function ge(p,te){for(var re;;){if(p.lookahead===0&&(De(p),p.lookahead===0)){if(te===t)return X;break}if(p.match_length=0,re=r._tr_tally(p,0,p.window[p.strstart]),p.lookahead--,p.strstart++,re&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=0,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function he(p,te,re,A,G){this.good_length=p,this.max_lazy=te,this.nice_length=re,this.max_chain=A,this.func=G}var Re;Re=[new he(0,0,0,0,Ye),new he(4,4,8,4,J),new he(4,5,16,8,J),new he(4,6,32,32,J),new he(4,4,16,16,Q),new he(8,16,32,32,Q),new he(8,16,128,128,Q),new he(8,32,128,256,Q),new he(32,128,258,1024,Q),new he(32,258,258,4096,Q)];function Oe(p){p.window_size=2*p.w_size,ke(p.head),p.max_lazy_match=Re[p.level].max_lazy,p.good_match=Re[p.level].good_length,p.nice_match=Re[p.level].nice_length,p.max_chain_length=Re[p.level].max_chain,p.strstart=0,p.block_start=0,p.lookahead=0,p.insert=0,p.match_length=p.prev_length=P-1,p.match_available=0,p.ins_h=0}function I(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(q*2),this.dyn_dtree=new e.Buf16((2*R+1)*2),this.bl_tree=new e.Buf16((2*L+1)*2),ke(this.dyn_ltree),ke(this.dyn_dtree),ke(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(z+1),this.heap=new e.Buf16(2*S+1),ke(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*S+1),ke(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ne(p){var te;return!p||!p.state?we(p,c):(p.total_in=p.total_out=0,p.data_type=w,te=p.state,te.pending=0,te.pending_out=0,te.wrap<0&&(te.wrap=-te.wrap),te.status=te.wrap?W:$,p.adler=te.wrap===2?0:1,te.last_flush=t,r._tr_init(te),l)}function se(p){var te=ne(p);return te===l&&Oe(p.state),te}function fe(p,te){return!p||!p.state||p.state.wrap!==2?c:(p.state.gzhead=te,l)}function Z(p,te,re,A,G,ee){if(!p)return c;var _e=1;if(te===y&&(te=6),A<0?(_e=0,A=-A):A>15&&(_e=2,A-=16),G<1||G>O||re!==x||A<8||A>15||te<0||te>9||ee<0||ee>E)return we(p,c);A===8&&(A=9);var de=new I;return p.state=de,de.strm=p,de.wrap=_e,de.gzhead=null,de.w_bits=A,de.w_size=1<<de.w_bits,de.w_mask=de.w_size-1,de.hash_bits=G+7,de.hash_size=1<<de.hash_bits,de.hash_mask=de.hash_size-1,de.hash_shift=~~((de.hash_bits+P-1)/P),de.window=new e.Buf8(de.w_size*2),de.head=new e.Buf16(de.hash_size),de.prev=new e.Buf16(de.w_size),de.lit_bufsize=1<<G+6,de.pending_buf_size=de.lit_bufsize*4,de.pending_buf=new e.Buf8(de.pending_buf_size),de.d_buf=1*de.lit_bufsize,de.l_buf=3*de.lit_bufsize,de.level=te,de.strategy=ee,de.method=re,se(p)}function ie(p,te){return Z(p,te,x,C,D,v)}function T(p,te){var re,A,G,ee;if(!p||!p.state||te>f||te<0)return p?we(p,c):c;if(A=p.state,!p.output||!p.input&&p.avail_in!==0||A.status===K&&te!==d)return we(p,p.avail_out===0?m:c);if(A.strm=p,re=A.last_flush,A.last_flush=te,A.status===W)if(A.wrap===2)p.adler=0,Ee(A,31),Ee(A,139),Ee(A,8),A.gzhead?(Ee(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),Ee(A,A.gzhead.time&255),Ee(A,A.gzhead.time>>8&255),Ee(A,A.gzhead.time>>16&255),Ee(A,A.gzhead.time>>24&255),Ee(A,A.level===9?2:A.strategy>=u||A.level<2?4:0),Ee(A,A.gzhead.os&255),A.gzhead.extra&&A.gzhead.extra.length&&(Ee(A,A.gzhead.extra.length&255),Ee(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(p.adler=i(p.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=H):(Ee(A,0),Ee(A,0),Ee(A,0),Ee(A,0),Ee(A,0),Ee(A,A.level===9?2:A.strategy>=u||A.level<2?4:0),Ee(A,me),A.status=$);else{var _e=x+(A.w_bits-8<<4)<<8,de=-1;A.strategy>=u||A.level<2?de=0:A.level<6?de=1:A.level===6?de=2:de=3,_e|=de<<6,A.strstart!==0&&(_e|=U),_e+=31-_e%31,A.status=$,$e(A,_e),A.strstart!==0&&($e(A,p.adler>>>16),$e(A,p.adler&65535)),p.adler=1}if(A.status===H)if(A.gzhead.extra){for(G=A.pending;A.gzindex<(A.gzhead.extra.length&65535)&&!(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),je(p),G=A.pending,A.pending===A.pending_buf_size));)Ee(A,A.gzhead.extra[A.gzindex]&255),A.gzindex++;A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=M)}else A.status=M;if(A.status===M)if(A.gzhead.name){G=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),je(p),G=A.pending,A.pending===A.pending_buf_size)){ee=1;break}A.gzindex<A.gzhead.name.length?ee=A.gzhead.name.charCodeAt(A.gzindex++)&255:ee=0,Ee(A,ee)}while(ee!==0);A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),ee===0&&(A.gzindex=0,A.status=N)}else A.status=N;if(A.status===N)if(A.gzhead.comment){G=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),je(p),G=A.pending,A.pending===A.pending_buf_size)){ee=1;break}A.gzindex<A.gzhead.comment.length?ee=A.gzhead.comment.charCodeAt(A.gzindex++)&255:ee=0,Ee(A,ee)}while(ee!==0);A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),ee===0&&(A.status=B)}else A.status=B;if(A.status===B&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&je(p),A.pending+2<=A.pending_buf_size&&(Ee(A,p.adler&255),Ee(A,p.adler>>8&255),p.adler=0,A.status=$)):A.status=$),A.pending!==0){if(je(p),p.avail_out===0)return A.last_flush=-1,l}else if(p.avail_in===0&&Ce(te)<=Ce(re)&&te!==d)return we(p,m);if(A.status===K&&p.avail_in!==0)return we(p,m);if(p.avail_in!==0||A.lookahead!==0||te!==t&&A.status!==K){var pe=A.strategy===u?ge(A,te):A.strategy===_?le(A,te):Re[A.level].func(A,te);if((pe===ue||pe===ve)&&(A.status=K),pe===X||pe===ue)return p.avail_out===0&&(A.last_flush=-1),l;if(pe===ae&&(te===n?r._tr_align(A):te!==f&&(r._tr_stored_block(A,0,0,!1),te===s&&(ke(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),je(p),p.avail_out===0))return A.last_flush=-1,l}return te!==d?l:A.wrap<=0?h:(A.wrap===2?(Ee(A,p.adler&255),Ee(A,p.adler>>8&255),Ee(A,p.adler>>16&255),Ee(A,p.adler>>24&255),Ee(A,p.total_in&255),Ee(A,p.total_in>>8&255),Ee(A,p.total_in>>16&255),Ee(A,p.total_in>>24&255)):($e(A,p.adler>>>16),$e(A,p.adler&65535)),je(p),A.wrap>0&&(A.wrap=-A.wrap),A.pending!==0?l:h)}function oe(p){var te;return!p||!p.state?c:(te=p.state.status,te!==W&&te!==H&&te!==M&&te!==N&&te!==B&&te!==$&&te!==K?we(p,c):(p.state=null,te===$?we(p,b):l))}function be(p,te){var re=te.length,A,G,ee,_e,de,pe,xe,vt;if(!p||!p.state||(A=p.state,_e=A.wrap,_e===2||_e===1&&A.status!==W||A.lookahead))return c;for(_e===1&&(p.adler=a(p.adler,te,re,0)),A.wrap=0,re>=A.w_size&&(_e===0&&(ke(A.head),A.strstart=0,A.block_start=0,A.insert=0),vt=new e.Buf8(A.w_size),e.arraySet(vt,te,re-A.w_size,A.w_size,0),te=vt,re=A.w_size),de=p.avail_in,pe=p.next_in,xe=p.input,p.avail_in=re,p.next_in=0,p.input=te,De(A);A.lookahead>=P;){G=A.strstart,ee=A.lookahead-(P-1);do A.ins_h=(A.ins_h<<A.hash_shift^A.window[G+P-1])&A.hash_mask,A.prev[G&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=G,G++;while(--ee);A.strstart=G,A.lookahead=P-1,De(A)}return A.strstart+=A.lookahead,A.block_start=A.strstart,A.insert=A.lookahead,A.lookahead=0,A.match_length=A.prev_length=P-1,A.match_available=0,p.next_in=pe,p.input=xe,p.avail_in=de,A.wrap=_e,l}return ut.deflateInit=ie,ut.deflateInit2=Z,ut.deflateReset=se,ut.deflateResetKeep=ne,ut.deflateSetHeader=fe,ut.deflate=T,ut.deflateEnd=oe,ut.deflateSetDictionary=be,ut.deflateInfo="pako deflate (from Nodeca project)",ut}var qn,Cs;function ym(){if(Cs)return qn;Cs=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return qn=e,qn}var it={},Nn,Ps;function _m(){if(Ps)return Nn;Ps=1;var e=30,r=12;return Nn=function(i,o){var t,n,s,d,f,l,h,c,b,m,y,g,u,_,E,v,w,x,O,C,D,Y,F,S,R;t=i.state,n=i.next_in,S=i.input,s=n+(i.avail_in-5),d=i.next_out,R=i.output,f=d-(o-i.avail_out),l=d+(i.avail_out-257),h=t.dmax,c=t.wsize,b=t.whave,m=t.wnext,y=t.window,g=t.hold,u=t.bits,_=t.lencode,E=t.distcode,v=(1<<t.lenbits)-1,w=(1<<t.distbits)-1;e:do{u<15&&(g+=S[n++]<<u,u+=8,g+=S[n++]<<u,u+=8),x=_[g&v];t:for(;;){if(O=x>>>24,g>>>=O,u-=O,O=x>>>16&255,O===0)R[d++]=x&65535;else if(O&16){C=x&65535,O&=15,O&&(u<O&&(g+=S[n++]<<u,u+=8),C+=g&(1<<O)-1,g>>>=O,u-=O),u<15&&(g+=S[n++]<<u,u+=8,g+=S[n++]<<u,u+=8),x=E[g&w];r:for(;;){if(O=x>>>24,g>>>=O,u-=O,O=x>>>16&255,O&16){if(D=x&65535,O&=15,u<O&&(g+=S[n++]<<u,u+=8,u<O&&(g+=S[n++]<<u,u+=8)),D+=g&(1<<O)-1,D>h){i.msg="invalid distance too far back",t.mode=e;break e}if(g>>>=O,u-=O,O=d-f,D>O){if(O=D-O,O>b&&t.sane){i.msg="invalid distance too far back",t.mode=e;break e}if(Y=0,F=y,m===0){if(Y+=c-O,O<C){C-=O;do R[d++]=y[Y++];while(--O);Y=d-D,F=R}}else if(m<O){if(Y+=c+m-O,O-=m,O<C){C-=O;do R[d++]=y[Y++];while(--O);if(Y=0,m<C){O=m,C-=O;do R[d++]=y[Y++];while(--O);Y=d-D,F=R}}}else if(Y+=m-O,O<C){C-=O;do R[d++]=y[Y++];while(--O);Y=d-D,F=R}for(;C>2;)R[d++]=F[Y++],R[d++]=F[Y++],R[d++]=F[Y++],C-=3;C&&(R[d++]=F[Y++],C>1&&(R[d++]=F[Y++]))}else{Y=d-D;do R[d++]=R[Y++],R[d++]=R[Y++],R[d++]=R[Y++],C-=3;while(C>2);C&&(R[d++]=R[Y++],C>1&&(R[d++]=R[Y++]))}}else if((O&64)===0){x=E[(x&65535)+(g&(1<<O)-1)];continue r}else{i.msg="invalid distance code",t.mode=e;break e}break}}else if((O&64)===0){x=_[(x&65535)+(g&(1<<O)-1)];continue t}else if(O&32){t.mode=r;break e}else{i.msg="invalid literal/length code",t.mode=e;break e}break}}while(n<s&&d<l);C=u>>3,n-=C,u-=C<<3,g&=(1<<u)-1,i.next_in=n,i.next_out=d,i.avail_in=n<s?5+(s-n):5-(n-s),i.avail_out=d<l?257+(l-d):257-(d-l),t.hold=g,t.bits=u},Nn}var Dn,ks;function bm(){if(ks)return Dn;ks=1;var e=_n(),r=15,a=852,i=592,o=0,t=1,n=2,s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],d=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],f=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Dn=function(c,b,m,y,g,u,_,E){var v=E.bits,w=0,x=0,O=0,C=0,D=0,Y=0,F=0,S=0,R=0,L=0,q,z,P,j,k,U=null,W=0,H,M=new e.Buf16(r+1),N=new e.Buf16(r+1),B=null,$=0,K,X,ae;for(w=0;w<=r;w++)M[w]=0;for(x=0;x<y;x++)M[b[m+x]]++;for(D=v,C=r;C>=1&&M[C]===0;C--);if(D>C&&(D=C),C===0)return g[u++]=1<<24|64<<16|0,g[u++]=1<<24|64<<16|0,E.bits=1,0;for(O=1;O<C&&M[O]===0;O++);for(D<O&&(D=O),S=1,w=1;w<=r;w++)if(S<<=1,S-=M[w],S<0)return-1;if(S>0&&(c===o||C!==1))return-1;for(N[1]=0,w=1;w<r;w++)N[w+1]=N[w]+M[w];for(x=0;x<y;x++)b[m+x]!==0&&(_[N[b[m+x]]++]=x);if(c===o?(U=B=_,H=19):c===t?(U=s,W-=257,B=d,$-=257,H=256):(U=f,B=l,H=-1),L=0,x=0,w=O,k=u,Y=D,F=0,P=-1,R=1<<D,j=R-1,c===t&&R>a||c===n&&R>i)return 1;for(;;){K=w-F,_[x]<H?(X=0,ae=_[x]):_[x]>H?(X=B[$+_[x]],ae=U[W+_[x]]):(X=96,ae=0),q=1<<w-F,z=1<<Y,O=z;do z-=q,g[k+(L>>F)+z]=K<<24|X<<16|ae|0;while(z!==0);for(q=1<<w-1;L&q;)q>>=1;if(q!==0?(L&=q-1,L+=q):L=0,x++,--M[w]===0){if(w===C)break;w=b[m+_[x]]}if(w>D&&(L&j)!==P){for(F===0&&(F=D),k+=O,Y=w-F,S=1<<Y;Y+F<C&&(S-=M[Y+F],!(S<=0));)Y++,S<<=1;if(R+=1<<Y,c===t&&R>a||c===n&&R>i)return 1;P=L&j,g[P]=D<<24|Y<<16|k-u|0}}return L!==0&&(g[k+L]=w-F<<24|64<<16|0),E.bits=D,0},Dn}var js;function wm(){if(js)return it;js=1;var e=_n(),r=hh(),a=dh(),i=_m(),o=bm(),t=0,n=1,s=2,d=4,f=5,l=6,h=0,c=1,b=2,m=-2,y=-3,g=-4,u=-5,_=8,E=1,v=2,w=3,x=4,O=5,C=6,D=7,Y=8,F=9,S=10,R=11,L=12,q=13,z=14,P=15,j=16,k=17,U=18,W=19,H=20,M=21,N=22,B=23,$=24,K=25,X=26,ae=27,ue=28,ve=29,me=30,we=31,Ce=32,ke=852,je=592,Ae=15,Ee=Ae;function $e(Z){return(Z>>>24&255)+(Z>>>8&65280)+((Z&65280)<<8)+((Z&255)<<24)}function st(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function qe(Z){var ie;return!Z||!Z.state?m:(ie=Z.state,Z.total_in=Z.total_out=ie.total=0,Z.msg="",ie.wrap&&(Z.adler=ie.wrap&1),ie.mode=E,ie.last=0,ie.havedict=0,ie.dmax=32768,ie.head=null,ie.hold=0,ie.bits=0,ie.lencode=ie.lendyn=new e.Buf32(ke),ie.distcode=ie.distdyn=new e.Buf32(je),ie.sane=1,ie.back=-1,h)}function De(Z){var ie;return!Z||!Z.state?m:(ie=Z.state,ie.wsize=0,ie.whave=0,ie.wnext=0,qe(Z))}function Ye(Z,ie){var T,oe;return!Z||!Z.state||(oe=Z.state,ie<0?(T=0,ie=-ie):(T=(ie>>4)+1,ie<48&&(ie&=15)),ie&&(ie<8||ie>15))?m:(oe.window!==null&&oe.wbits!==ie&&(oe.window=null),oe.wrap=T,oe.wbits=ie,De(Z))}function J(Z,ie){var T,oe;return Z?(oe=new st,Z.state=oe,oe.window=null,T=Ye(Z,ie),T!==h&&(Z.state=null),T):m}function Q(Z){return J(Z,Ee)}var le=!0,ge,he;function Re(Z){if(le){var ie;for(ge=new e.Buf32(512),he=new e.Buf32(32),ie=0;ie<144;)Z.lens[ie++]=8;for(;ie<256;)Z.lens[ie++]=9;for(;ie<280;)Z.lens[ie++]=7;for(;ie<288;)Z.lens[ie++]=8;for(o(n,Z.lens,0,288,ge,0,Z.work,{bits:9}),ie=0;ie<32;)Z.lens[ie++]=5;o(s,Z.lens,0,32,he,0,Z.work,{bits:5}),le=!1}Z.lencode=ge,Z.lenbits=9,Z.distcode=he,Z.distbits=5}function Oe(Z,ie,T,oe){var be,p=Z.state;return p.window===null&&(p.wsize=1<<p.wbits,p.wnext=0,p.whave=0,p.window=new e.Buf8(p.wsize)),oe>=p.wsize?(e.arraySet(p.window,ie,T-p.wsize,p.wsize,0),p.wnext=0,p.whave=p.wsize):(be=p.wsize-p.wnext,be>oe&&(be=oe),e.arraySet(p.window,ie,T-oe,be,p.wnext),oe-=be,oe?(e.arraySet(p.window,ie,T-oe,oe,0),p.wnext=oe,p.whave=p.wsize):(p.wnext+=be,p.wnext===p.wsize&&(p.wnext=0),p.whave<p.wsize&&(p.whave+=be))),0}function I(Z,ie){var T,oe,be,p,te,re,A,G,ee,_e,de,pe,xe,vt,Le=0,Ie,Ue,Je,Xe,_r,br,Me,nt,Ge=new e.Buf8(4),yt,ht,vs=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Z||!Z.state||!Z.output||!Z.input&&Z.avail_in!==0)return m;T=Z.state,T.mode===L&&(T.mode=q),te=Z.next_out,be=Z.output,A=Z.avail_out,p=Z.next_in,oe=Z.input,re=Z.avail_in,G=T.hold,ee=T.bits,_e=re,de=A,nt=h;e:for(;;)switch(T.mode){case E:if(T.wrap===0){T.mode=q;break}for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(T.wrap&2&&G===35615){T.check=0,Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0),G=0,ee=0,T.mode=v;break}if(T.flags=0,T.head&&(T.head.done=!1),!(T.wrap&1)||(((G&255)<<8)+(G>>8))%31){Z.msg="incorrect header check",T.mode=me;break}if((G&15)!==_){Z.msg="unknown compression method",T.mode=me;break}if(G>>>=4,ee-=4,Me=(G&15)+8,T.wbits===0)T.wbits=Me;else if(Me>T.wbits){Z.msg="invalid window size",T.mode=me;break}T.dmax=1<<Me,Z.adler=T.check=1,T.mode=G&512?S:L,G=0,ee=0;break;case v:for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(T.flags=G,(T.flags&255)!==_){Z.msg="unknown compression method",T.mode=me;break}if(T.flags&57344){Z.msg="unknown header flags set",T.mode=me;break}T.head&&(T.head.text=G>>8&1),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0)),G=0,ee=0,T.mode=w;case w:for(;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.head&&(T.head.time=G),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,Ge[2]=G>>>16&255,Ge[3]=G>>>24&255,T.check=a(T.check,Ge,4,0)),G=0,ee=0,T.mode=x;case x:for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.head&&(T.head.xflags=G&255,T.head.os=G>>8),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0)),G=0,ee=0,T.mode=O;case O:if(T.flags&1024){for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.length=G,T.head&&(T.head.extra_len=G),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0)),G=0,ee=0}else T.head&&(T.head.extra=null);T.mode=C;case C:if(T.flags&1024&&(pe=T.length,pe>re&&(pe=re),pe&&(T.head&&(Me=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),e.arraySet(T.head.extra,oe,p,pe,Me)),T.flags&512&&(T.check=a(T.check,oe,pe,p)),re-=pe,p+=pe,T.length-=pe),T.length))break e;T.length=0,T.mode=D;case D:if(T.flags&2048){if(re===0)break e;pe=0;do Me=oe[p+pe++],T.head&&Me&&T.length<65536&&(T.head.name+=String.fromCharCode(Me));while(Me&&pe<re);if(T.flags&512&&(T.check=a(T.check,oe,pe,p)),re-=pe,p+=pe,Me)break e}else T.head&&(T.head.name=null);T.length=0,T.mode=Y;case Y:if(T.flags&4096){if(re===0)break e;pe=0;do Me=oe[p+pe++],T.head&&Me&&T.length<65536&&(T.head.comment+=String.fromCharCode(Me));while(Me&&pe<re);if(T.flags&512&&(T.check=a(T.check,oe,pe,p)),re-=pe,p+=pe,Me)break e}else T.head&&(T.head.comment=null);T.mode=F;case F:if(T.flags&512){for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(G!==(T.check&65535)){Z.msg="header crc mismatch",T.mode=me;break}G=0,ee=0}T.head&&(T.head.hcrc=T.flags>>9&1,T.head.done=!0),Z.adler=T.check=0,T.mode=L;break;case S:for(;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}Z.adler=T.check=$e(G),G=0,ee=0,T.mode=R;case R:if(T.havedict===0)return Z.next_out=te,Z.avail_out=A,Z.next_in=p,Z.avail_in=re,T.hold=G,T.bits=ee,b;Z.adler=T.check=1,T.mode=L;case L:if(ie===f||ie===l)break e;case q:if(T.last){G>>>=ee&7,ee-=ee&7,T.mode=ae;break}for(;ee<3;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}switch(T.last=G&1,G>>>=1,ee-=1,G&3){case 0:T.mode=z;break;case 1:if(Re(T),T.mode=H,ie===l){G>>>=2,ee-=2;break e}break;case 2:T.mode=k;break;case 3:Z.msg="invalid block type",T.mode=me}G>>>=2,ee-=2;break;case z:for(G>>>=ee&7,ee-=ee&7;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if((G&65535)!==(G>>>16^65535)){Z.msg="invalid stored block lengths",T.mode=me;break}if(T.length=G&65535,G=0,ee=0,T.mode=P,ie===l)break e;case P:T.mode=j;case j:if(pe=T.length,pe){if(pe>re&&(pe=re),pe>A&&(pe=A),pe===0)break e;e.arraySet(be,oe,p,pe,te),re-=pe,p+=pe,A-=pe,te+=pe,T.length-=pe;break}T.mode=L;break;case k:for(;ee<14;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(T.nlen=(G&31)+257,G>>>=5,ee-=5,T.ndist=(G&31)+1,G>>>=5,ee-=5,T.ncode=(G&15)+4,G>>>=4,ee-=4,T.nlen>286||T.ndist>30){Z.msg="too many length or distance symbols",T.mode=me;break}T.have=0,T.mode=U;case U:for(;T.have<T.ncode;){for(;ee<3;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.lens[vs[T.have++]]=G&7,G>>>=3,ee-=3}for(;T.have<19;)T.lens[vs[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,yt={bits:T.lenbits},nt=o(t,T.lens,0,19,T.lencode,0,T.work,yt),T.lenbits=yt.bits,nt){Z.msg="invalid code lengths set",T.mode=me;break}T.have=0,T.mode=W;case W:for(;T.have<T.nlen+T.ndist;){for(;Le=T.lencode[G&(1<<T.lenbits)-1],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(Je<16)G>>>=Ie,ee-=Ie,T.lens[T.have++]=Je;else{if(Je===16){for(ht=Ie+2;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(G>>>=Ie,ee-=Ie,T.have===0){Z.msg="invalid bit length repeat",T.mode=me;break}Me=T.lens[T.have-1],pe=3+(G&3),G>>>=2,ee-=2}else if(Je===17){for(ht=Ie+3;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Ie,ee-=Ie,Me=0,pe=3+(G&7),G>>>=3,ee-=3}else{for(ht=Ie+7;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Ie,ee-=Ie,Me=0,pe=11+(G&127),G>>>=7,ee-=7}if(T.have+pe>T.nlen+T.ndist){Z.msg="invalid bit length repeat",T.mode=me;break}for(;pe--;)T.lens[T.have++]=Me}}if(T.mode===me)break;if(T.lens[256]===0){Z.msg="invalid code -- missing end-of-block",T.mode=me;break}if(T.lenbits=9,yt={bits:T.lenbits},nt=o(n,T.lens,0,T.nlen,T.lencode,0,T.work,yt),T.lenbits=yt.bits,nt){Z.msg="invalid literal/lengths set",T.mode=me;break}if(T.distbits=6,T.distcode=T.distdyn,yt={bits:T.distbits},nt=o(s,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,yt),T.distbits=yt.bits,nt){Z.msg="invalid distances set",T.mode=me;break}if(T.mode=H,ie===l)break e;case H:T.mode=M;case M:if(re>=6&&A>=258){Z.next_out=te,Z.avail_out=A,Z.next_in=p,Z.avail_in=re,T.hold=G,T.bits=ee,i(Z,de),te=Z.next_out,be=Z.output,A=Z.avail_out,p=Z.next_in,oe=Z.input,re=Z.avail_in,G=T.hold,ee=T.bits,T.mode===L&&(T.back=-1);break}for(T.back=0;Le=T.lencode[G&(1<<T.lenbits)-1],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(Ue&&(Ue&240)===0){for(Xe=Ie,_r=Ue,br=Je;Le=T.lencode[br+((G&(1<<Xe+_r)-1)>>Xe)],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Xe+Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Xe,ee-=Xe,T.back+=Xe}if(G>>>=Ie,ee-=Ie,T.back+=Ie,T.length=Je,Ue===0){T.mode=X;break}if(Ue&32){T.back=-1,T.mode=L;break}if(Ue&64){Z.msg="invalid literal/length code",T.mode=me;break}T.extra=Ue&15,T.mode=N;case N:if(T.extra){for(ht=T.extra;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.length+=G&(1<<T.extra)-1,G>>>=T.extra,ee-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=B;case B:for(;Le=T.distcode[G&(1<<T.distbits)-1],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if((Ue&240)===0){for(Xe=Ie,_r=Ue,br=Je;Le=T.distcode[br+((G&(1<<Xe+_r)-1)>>Xe)],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Xe+Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Xe,ee-=Xe,T.back+=Xe}if(G>>>=Ie,ee-=Ie,T.back+=Ie,Ue&64){Z.msg="invalid distance code",T.mode=me;break}T.offset=Je,T.extra=Ue&15,T.mode=$;case $:if(T.extra){for(ht=T.extra;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.offset+=G&(1<<T.extra)-1,G>>>=T.extra,ee-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){Z.msg="invalid distance too far back",T.mode=me;break}T.mode=K;case K:if(A===0)break e;if(pe=de-A,T.offset>pe){if(pe=T.offset-pe,pe>T.whave&&T.sane){Z.msg="invalid distance too far back",T.mode=me;break}pe>T.wnext?(pe-=T.wnext,xe=T.wsize-pe):xe=T.wnext-pe,pe>T.length&&(pe=T.length),vt=T.window}else vt=be,xe=te-T.offset,pe=T.length;pe>A&&(pe=A),A-=pe,T.length-=pe;do be[te++]=vt[xe++];while(--pe);T.length===0&&(T.mode=M);break;case X:if(A===0)break e;be[te++]=T.length,A--,T.mode=M;break;case ae:if(T.wrap){for(;ee<32;){if(re===0)break e;re--,G|=oe[p++]<<ee,ee+=8}if(de-=A,Z.total_out+=de,T.total+=de,de&&(Z.adler=T.check=T.flags?a(T.check,be,de,te-de):r(T.check,be,de,te-de)),de=A,(T.flags?G:$e(G))!==T.check){Z.msg="incorrect data check",T.mode=me;break}G=0,ee=0}T.mode=ue;case ue:if(T.wrap&&T.flags){for(;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(G!==(T.total&4294967295)){Z.msg="incorrect length check",T.mode=me;break}G=0,ee=0}T.mode=ve;case ve:nt=c;break e;case me:nt=y;break e;case we:return g;case Ce:default:return m}return Z.next_out=te,Z.avail_out=A,Z.next_in=p,Z.avail_in=re,T.hold=G,T.bits=ee,(T.wsize||de!==Z.avail_out&&T.mode<me&&(T.mode<ae||ie!==d))&&Oe(Z,Z.output,Z.next_out,de-Z.avail_out),_e-=Z.avail_in,de-=Z.avail_out,Z.total_in+=_e,Z.total_out+=de,T.total+=de,T.wrap&&de&&(Z.adler=T.check=T.flags?a(T.check,be,de,Z.next_out-de):r(T.check,be,de,Z.next_out-de)),Z.data_type=T.bits+(T.last?64:0)+(T.mode===L?128:0)+(T.mode===H||T.mode===P?256:0),(_e===0&&de===0||ie===d)&&nt===h&&(nt=u),nt}function ne(Z){if(!Z||!Z.state)return m;var ie=Z.state;return ie.window&&(ie.window=null),Z.state=null,h}function se(Z,ie){var T;return!Z||!Z.state||(T=Z.state,(T.wrap&2)===0)?m:(T.head=ie,ie.done=!1,h)}function fe(Z,ie){var T=ie.length,oe,be,p;return!Z||!Z.state||(oe=Z.state,oe.wrap!==0&&oe.mode!==R)?m:oe.mode===R&&(be=1,be=r(be,ie,T,0),be!==oe.check)?y:(p=Oe(Z,ie,T,T),p?(oe.mode=we,g):(oe.havedict=1,h))}return it.inflateReset=De,it.inflateReset2=Ye,it.inflateResetKeep=qe,it.inflateInit=Q,it.inflateInit2=J,it.inflate=I,it.inflateEnd=ne,it.inflateGetHeader=se,it.inflateSetDictionary=fe,it.inflateInfo="pako inflate (from Nodeca project)",it}var Mn,Ls;function Em(){return Ls||(Ls=1,Mn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Mn}function Sm(){const{useDynamicConfig:e}=wt(),{configValue:r,isDynamicConfigLoading:a}=e(xt.creditAgentEnablement),i=He.getSignedInUser()?.userEmail;return{isAllowed:ce.useMemo(()=>{const t=Array.isArray(r?.allowedUserEmails)?r.allowedUserEmails:[];return i!=null&&t.includes(i)},[r,i]),isLoading:a}}function St(){const{isAllowed:e}=Sm();return e?Ap:Ip}const Rm={overlayWidth:new at(100,100,50)};function qs(){const e=Be(),r=We(),a=lr(),i=Ft(),o=St(),t=Se(F=>Df(F)),n=t.uiState.selectedCustomerTenantId,s=ce.useMemo(()=>n?t.customers.find(F=>F.tenantId===n):void 0,[t.customers,n]),d=Se(F=>n?Mf(F.aiAccountantCustomerState,F.userState,n):[]),f=t.customerViewStateByTenantId[n],l=f?.jobsFetchStatus??{fetchState:"Not-Started"},h=f?.jobsPageToken!=null;ce.useEffect(()=>{t.fetchState==="Completed"?r(It(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&r(ys())},[t.fetchState]);const c=F=>{const S=Pt(F),R=Bt(F);Fe.trackCockpitTabClicked(R),e(`../../${S}`,{replace:!0})},b=(F,S,R,L)=>{r(Nt([F.tenantId])),r(nn(S,R,L))},m=(F,S,R)=>{r(nn(F,S,R))},y=(F,S)=>{r(Nt(t.unonboardedTenantIds)),r(nn("retrain",F,S))},g=F=>{const S=t.selectedTenantIds,R=S.includes(F)?S.filter(L=>L!==F):[...S,F];r(Nt(R))},u=F=>{if(F.length===0)return;const S=t.selectedTenantIds,R=new Set(S);if(F.every(q=>R.has(q))){const q=new Set(F);r(Nt(S.filter(z=>!q.has(z))))}else{const q=Array.from(new Set([...S,...F]));r(Nt(q))}},_=()=>{r(Nt([]))},E=F=>{r(Ff(F.companyId,F.tenantId))},v=F=>{F==="aiAccountant"&&r(ys())},w=(F,S)=>{r(Jt({sortKey:F,sortOrder:S}))},x=F=>{r(Jt({selectedCustomerTenantId:F.tenantId})),r(on(F.tenantId))},O=()=>{r(Jt({selectedCustomerTenantId:""}))},C=F=>{r(Jt({filterText:F}))},D=(F,S)=>{r(Jt({filters:S}))},Y=()=>{n&&r(on(n,!0))};return V.jsxs(V.Fragment,{children:[V.jsx(Cp,{headerData:{allTabOptions:o,selectedTabOption:Et("aiAccountant")},headerActions:{onTabChange:c},aiAccountantPageData:{aiAccountantView:t},aiAccountantPageActions:{onAction:b,onBulkAction:m,onCancelOnboarding:E,onClearSelection:_,onCockpitReloadData:v,onColumnSortConfigChanged:w,onCustomerSelected:x,onEvaluateAll:y,onFilterTextChanged:C,onFiltersChange:D,onToggleAllVisible:u,onToggleTenantSelection:g}}),V.jsx(hr,{anchor:"right",open:s!=null,PaperProps:{style:{width:Rm.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:O,children:s!=null&&V.jsx(ah,{customer:s,hasMoreJobs:h,jobs:d,jobsFetchStatus:l,onAction:b,onCancelOnboarding:E,onClose:O,onLoadMoreJobs:Y})})]})}function Om(){const{tenantId:e=""}=ot(),r=Be(),a=We(),i=Se(c=>fd(c.aiAccountantCustomerState,c.userState)),o=Se(c=>Df(c)),t=i.find(c=>c.tenantId===e),n=o.customerViewStateByTenantId[e],s=Se(c=>Mf(c.aiAccountantCustomerState,c.userState,e));if(ce.useEffect(()=>{a(on(e))},[e,a]),t==null)return null;const d=(c,b,m,y)=>{a(Nt([c.tenantId])),a(nn(b,m,y))},f=c=>{a(Ff(c.companyId,c.tenantId))},l=()=>{r("../")},h=()=>{a(on(e,!0))};return V.jsx(ah,{customer:t,hasMoreJobs:n?.jobsPageToken!=null,jobs:s,jobsFetchStatus:n?.jobsFetchStatus??{fetchState:"Not-Started"},onAction:d,onCancelOnboarding:f,onClose:l,onLoadMoreJobs:h})}const ph=(e,r)=>{const a=[...e??[]];return a.push(r),a},Tm=e=>{const r=[...e??[]];return{poppedPathname:r.pop(),newStack:r}},xm=(e=2)=>{let r="../";for(let a=0;a<e;a++)r=`${r}../`;return r},Pe=({state:e,element:r})=>He.isSignedIn()===!0?V.jsx(V.Fragment,{children:r}):V.jsx(ir,{to:"/signin/auth",replace:!0,state:{...e,message:"...",origin:window.location.pathname}});function Am(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(qs,{})})}),V.jsx(Te,{path:"/detail/:tenantId",element:V.jsx(Pe,{element:V.jsx(Om,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(qs,{})})})]})}const Ut=()=>{const[e,r]=fh(),[a,i]=ce.useState(),o=ce.useRef(!1);return ce.useEffect(()=>{if(o.current===!0||!(e.has("thread_id")||e.has("entity_type")||e.has("company_id")))return;const n=Pp(e);n!=null&&i(n);const s=new URLSearchParams(e);s.delete("thread_id"),s.delete("entity_type"),s.delete("company_id"),r(s,{replace:!0}),o.current=!0},[e,r]),a},Im={overlayWidth:new at(100,100,50)},{common:{strings:Ns}}=fr.getLocalizedStrings();function Cm(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=Bt(a);Fe.trackCockpitTabClicked(o),r.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(a,i)=>{e(wr({uiState:{filterText:i}}))},onFiltersChange:(a,i)=>{i.categories!=null&&i.categoryCombinationOperator!=null&&Fe.trackHealthMonitorFiltersApplied({filterSelection:{condition:i.categories.map(o=>o.matchingOperator).join(Ns.comma),logic:i.categoryCombinationOperator,parameter:i.categories.map(o=>o.field).join(Ns.comma)}}),e(wr({uiState:{filters:i}}))}}},healthPageActions:{onRowClick:a=>{e(Uf(a))},onColumnSortConfigChanged:(a,i)=>{e(wr({uiState:{sortKey:a,sortOrder:i}}))},onCockpitReloadData:a=>{a==="healthMonitor"&&e(Bf())},onFiltersChange:a=>{e(wr({uiState:{filters:a}}))}}}}function Pm(e,r){return{healthPageData:{healthView:r.healthView,managementView:r.managementView,mixpanelUrl:r.mixpanelHMUrl}}}const km=ze(Pm,Cm)(qp);function Fn({isDrawerOpen:e}){const r=Be(),a=We(),i=Ft(),o=lr(),{companyId:t}=ot(),[n,s]=fh(),[d,f]=ce.useState(!1),l=Ut(),h=St(),c=Se(w=>hd(w)),b=Se(w=>ur(w)),{additionalChurnFactors:m}=Se(w=>dd(w)),{selectedCompanyDetail:y,selectedCompanyId:g,localFormDataAndStatusByCompanyId:u}=c,_=Se(w=>w.companyViewState.zeniUsers.fetchState),E=Se(w=>w.companyHealthMetricConfigViewState);if(ce.useEffect(()=>{const w=x=>x==="Not-Started"||x==="Error";c.fetchState==="Completed"?a(It(!1)):w(c.fetchState)&&(a(Bf()),w(_)&&a(Ct()),w(E.fetchState)&&a(pd()))},[c.fetchState,E.fetchState]),ce.useEffect(()=>{t!=null&&c.fetchState==="Completed"&&n.has("utm_source")===!0&&(a(Uf(t)),y!=null&&(kp(),Fe.trackCockpitHealthMonitorNotificationAlertClicked({companyId:y.companyInfo.companyId,companyName:y.companyInfo.name,churnProbability:y.companyHealthMetric.churnProbabilityPercentage??null}),f(!0),n.delete("utm_source"),s(n)))},[c.fetchState,y?.companyInfo.companyId,y?.companyInfo.name]),He.getSignedInUser()==null)throw Error("Can't access Health Monitor page without signing in...");return V.jsxs(V.Fragment,{children:[e===!0||g!=null&&y!=null?V.jsx(hr,{anchor:"right",open:g!=null,PaperProps:{style:{width:Im.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a(_s()),children:V.jsx(jp,{roomId:`cockpit_${g}`,autoConnect:!0,children:V.jsx(Lp,{onSaveClick:()=>{g!=null&&a(gd(g))},onSaveChangesToLocalStore:w=>{c.selectedCompanyId!=null&&a(md({companyId:c.selectedCompanyId,updatedLocalData:w}))},localData:u?.companyHealthMetricLocalData??{netPromoterScore:void 0,externalProductServiceExposure:void 0,additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]}},companyHealthMetricViewSelector:c,onCloseDrawer:()=>a(_s()),analytics:Fe,urlSource:d,additionalChurnFactorsOptions:m})})}):null,V.jsx(km,{headerData:{allTabOptions:h,selectedTabOption:Et("healthMonitor")},initialOpenThreadRequest:l??void 0,healthView:c,managementView:b,navigate:r,mixpanelHMUrl:mn.mixpanelHMUrl})]})}function jm(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/companies/:companyId",element:V.jsx(Pe,{element:V.jsx(Fn,{isDrawerOpen:!0})})}),V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(Fn,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(Fn,{})})})]})}const Lm={drawerLeftMargin:new at(0,0,240)};function mr(e){const{isOpen:r,drawerLeftMargin:a,children:i,onClose:o}=e,t=lr(),n=a?.valuePx(t)??Lm.drawerLeftMargin.valuePx(t),s=Ft();return V.jsx(hr,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${n})`}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.8,cursor:"pointer"}}},onClose:o,children:i})}const qm=({fetchState:e})=>e==="In-Progress"||e==="Not-Started"?V.jsx(Nm,{children:V.jsx(gn,{size:"ExtraLarge",start:!0})}):null,Nm=tt.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreditAgentRoutes-CWtniLRn.js","assets/liveblocks-bdH_HyD4.js","assets/sentry-Dwm-tWfG.js","assets/core-Dwew_eJI.js","assets/recharts-Cy2son-o.js","assets/zeni-epic-state-BAX-zerj.js","assets/index-BssKJygd.js","assets/mui-Dpk20_cL.js","assets/analytics-D6nPZhvU.js","assets/lottie-ODFW7XpP.js","assets/lexical-CKIF0fv8.js","assets/utils-ByTJL3Oq.js","assets/index-Bd7ri422.css","assets/analyticsHelper-BGL92ghO.js","assets/empty-C9URe1wE.js","assets/index-urN9o0mh.js","assets/url-DV3lGv0k.js","assets/index-Bitr7r5a.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Rm as Df,Rn as Mf,lv as It,f3 as ys,Ro as Nt,fc as nn,f1 as Ff,Rp as Jt,f8 as on,Rq as fd,Rr as hd,Rs as ur,Rt as dd,jS as Bf,lx as Ct,jP as pd,jW as Uf,Ru as _s,jY as md,jZ as gd,Rv as wr,Rw as cr,jl as vd,Rx as dn,Ry as Vo,dj as yd,h0 as $o,gZ as sn,h5 as Mt,h3 as _d,Rz as Vf,RA as $f,kb as bd,k8 as wd,RB as Ed,km as Sd,kh as bs,ke as Rd,k3 as Od,RC as Td,eL as xd,dr as Ad,lJ as zf,RD as Id,be as an,k0 as ws,k5 as Cd,A3 as Gf,lw as pn,RE as Hf,RF as pt,lU as un,lP as Zf,kG as zo,RG as Pd,lX as kd,H as et,bm as Go,RH as jd,ji as Ld,RI as qd,RJ as Wf,RK as Nd,yn as Es,xV as Dd,RL as Md,x$ as An,RM as Fd,y1 as Bd,RN as Tt,xS as Ud,d7 as Vd,lA as Yf,lB as Jf,lz as Ho,ly as Zo,lC as $d,RO as zd,yq as Gd,RP as Hd,y7 as Zd,yk as Wd,RQ as Yd,yb as Jd,RR as Kd,RS as Kt,RT as Wo,RU as Xd,RV as Qd,s0 as ep,s6 as Kf,RW as Xf,iP as tp,Qr as Qf,RX as rp,Ql as np,RY as ip,RZ as ap,s9 as op,R_ as sp,Qw as up,Qk as cp,BW as eh,R$ as In,S0 as th,N9 as Yo,MX as lp,Nc as rh,M_ as fp,S1 as hp,N3 as dp,MR as pp,MU as mp,S2 as gp,Ng as vp,N6 as yp,bp as _p,bd as bp,S3 as wp,S4 as zt,S5 as Ep,S6 as Sp,S7 as Rp,ku as Mo,kq as Op,kA as Tp,kD as Ss,ba as nh}from"./zeni-epic-state-BAX-zerj.js";import{j as V}from"./liveblocks-bdH_HyD4.js";import{a as ce,p as ye,d as ih,c as Jo,g as xp}from"./sentry-Dwm-tWfG.js";import{W as wt,U as xt,z as He,R as Ap,h as Ip,o as lr,H as Cp,w as Et,K as ah,$ as at,a as Fe,b as Pt,g as Ft,c as Pp,u as kp,f as jp,d as Lp,e as mn,B as qp,G as fr,i as gn,n as Dt,X as Np,N as Dp,A as vn,Z as Mp,Q as Fp,m as Cn,j as Bp,M as oh,k as Up,l as sh,p as uh,q as Fo,r as Vp,O as $p,Y as zp,s as ch,t as Gp,v as Hp,I as Zp,T as Wp,x as Yp,J as Jp,V as Kp,y as Xp,C as Qp,_ as em,D as tm,F as rm,E as lh}from"./index-BssKJygd.js";import{f as nm}from"./analyticsHelper-BGL92ghO.js";import{i as Be,n as We,g as Se,o as ot,N as ir,k as gt,l as Te,p as fh,h as ze,u as Ko,j as Bo}from"./core-Dwew_eJI.js";import{u as Bt,D as hr,n as tt,S as Ht}from"./mui-Dpk20_cL.js";import{a as Ze,b as im,c as am,d as om,e as Xo,f as sm,g as um,h as cm,i as Zt,j as lm,k as or,l as yn,m as fm,n as dr,o as hm}from"./utils-ByTJL3Oq.js";import{r as Qo}from"./empty-C9URe1wE.js";import{r as pr,a as dm}from"./index-urN9o0mh.js";import{r as pm}from"./index-Bitr7r5a.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="9ad57f8e-2dc8-4310-bd2d-5b4e72fdd5e9",e._sentryDebugIdIdentifier="sentry-dbid-9ad57f8e-2dc8-4310-bd2d-5b4e72fdd5e9")}catch{}})();var Pn={},Rs;function _n(){return Rs||(Rs=1,(function(e){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function a(t,n){return Object.prototype.hasOwnProperty.call(t,n)}e.assign=function(t){for(var n=Array.prototype.slice.call(arguments,1);n.length;){var s=n.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var d in s)a(s,d)&&(t[d]=s[d])}}return t},e.shrinkBuf=function(t,n){return t.length===n?t:t.subarray?t.subarray(0,n):(t.length=n,t)};var i={arraySet:function(t,n,s,d,f){if(n.subarray&&t.subarray){t.set(n.subarray(s,s+d),f);return}for(var l=0;l<d;l++)t[f+l]=n[s+l]},flattenChunks:function(t){var n,s,d,f,l,h;for(d=0,n=0,s=t.length;n<s;n++)d+=t[n].length;for(h=new Uint8Array(d),f=0,n=0,s=t.length;n<s;n++)l=t[n],h.set(l,f),f+=l.length;return h}},o={arraySet:function(t,n,s,d,f){for(var l=0;l<d;l++)t[f+l]=n[s+l]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(r)})(Pn)),Pn}var ut={},kt={},Os;function mm(){if(Os)return kt;Os=1;var e=_n(),r=4,a=0,i=1,o=2;function t(I){for(var ne=I.length;--ne>=0;)I[ne]=0}var n=0,s=1,d=2,f=3,l=258,h=29,c=256,b=c+1+h,m=30,y=19,g=2*b+1,u=15,_=16,E=7,v=256,w=16,x=17,O=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],D=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=512,R=new Array((b+2)*2);t(R);var L=new Array(m*2);t(L);var q=new Array(S);t(q);var z=new Array(l-f+1);t(z);var P=new Array(h);t(P);var j=new Array(m);t(j);function k(I,ne,se,fe,Z){this.static_tree=I,this.extra_bits=ne,this.extra_base=se,this.elems=fe,this.max_length=Z,this.has_stree=I&&I.length}var U,W,H;function M(I,ne){this.dyn_tree=I,this.max_code=0,this.stat_desc=ne}function N(I){return I<256?q[I]:q[256+(I>>>7)]}function B(I,ne){I.pending_buf[I.pending++]=ne&255,I.pending_buf[I.pending++]=ne>>>8&255}function $(I,ne,se){I.bi_valid>_-se?(I.bi_buf|=ne<<I.bi_valid&65535,B(I,I.bi_buf),I.bi_buf=ne>>_-I.bi_valid,I.bi_valid+=se-_):(I.bi_buf|=ne<<I.bi_valid&65535,I.bi_valid+=se)}function K(I,ne,se){$(I,se[ne*2],se[ne*2+1])}function X(I,ne){var se=0;do se|=I&1,I>>>=1,se<<=1;while(--ne>0);return se>>>1}function ae(I){I.bi_valid===16?(B(I,I.bi_buf),I.bi_buf=0,I.bi_valid=0):I.bi_valid>=8&&(I.pending_buf[I.pending++]=I.bi_buf&255,I.bi_buf>>=8,I.bi_valid-=8)}function ue(I,ne){var se=ne.dyn_tree,fe=ne.max_code,Z=ne.stat_desc.static_tree,ie=ne.stat_desc.has_stree,T=ne.stat_desc.extra_bits,oe=ne.stat_desc.extra_base,be=ne.stat_desc.max_length,p,te,re,A,G,ee,_e=0;for(A=0;A<=u;A++)I.bl_count[A]=0;for(se[I.heap[I.heap_max]*2+1]=0,p=I.heap_max+1;p<g;p++)te=I.heap[p],A=se[se[te*2+1]*2+1]+1,A>be&&(A=be,_e++),se[te*2+1]=A,!(te>fe)&&(I.bl_count[A]++,G=0,te>=oe&&(G=T[te-oe]),ee=se[te*2],I.opt_len+=ee*(A+G),ie&&(I.static_len+=ee*(Z[te*2+1]+G)));if(_e!==0){do{for(A=be-1;I.bl_count[A]===0;)A--;I.bl_count[A]--,I.bl_count[A+1]+=2,I.bl_count[be]--,_e-=2}while(_e>0);for(A=be;A!==0;A--)for(te=I.bl_count[A];te!==0;)re=I.heap[--p],!(re>fe)&&(se[re*2+1]!==A&&(I.opt_len+=(A-se[re*2+1])*se[re*2],se[re*2+1]=A),te--)}}function ve(I,ne,se){var fe=new Array(u+1),Z=0,ie,T;for(ie=1;ie<=u;ie++)fe[ie]=Z=Z+se[ie-1]<<1;for(T=0;T<=ne;T++){var oe=I[T*2+1];oe!==0&&(I[T*2]=X(fe[oe]++,oe))}}function me(){var I,ne,se,fe,Z,ie=new Array(u+1);for(se=0,fe=0;fe<h-1;fe++)for(P[fe]=se,I=0;I<1<<C[fe];I++)z[se++]=fe;for(z[se-1]=fe,Z=0,fe=0;fe<16;fe++)for(j[fe]=Z,I=0;I<1<<D[fe];I++)q[Z++]=fe;for(Z>>=7;fe<m;fe++)for(j[fe]=Z<<7,I=0;I<1<<D[fe]-7;I++)q[256+Z++]=fe;for(ne=0;ne<=u;ne++)ie[ne]=0;for(I=0;I<=143;)R[I*2+1]=8,I++,ie[8]++;for(;I<=255;)R[I*2+1]=9,I++,ie[9]++;for(;I<=279;)R[I*2+1]=7,I++,ie[7]++;for(;I<=287;)R[I*2+1]=8,I++,ie[8]++;for(ve(R,b+1,ie),I=0;I<m;I++)L[I*2+1]=5,L[I*2]=X(I,5);U=new k(R,C,c+1,b,u),W=new k(L,D,0,m,u),H=new k(new Array(0),Y,0,y,E)}function we(I){var ne;for(ne=0;ne<b;ne++)I.dyn_ltree[ne*2]=0;for(ne=0;ne<m;ne++)I.dyn_dtree[ne*2]=0;for(ne=0;ne<y;ne++)I.bl_tree[ne*2]=0;I.dyn_ltree[v*2]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function Ce(I){I.bi_valid>8?B(I,I.bi_buf):I.bi_valid>0&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function ke(I,ne,se,fe){Ce(I),B(I,se),B(I,~se),e.arraySet(I.pending_buf,I.window,ne,se,I.pending),I.pending+=se}function je(I,ne,se,fe){var Z=ne*2,ie=se*2;return I[Z]<I[ie]||I[Z]===I[ie]&&fe[ne]<=fe[se]}function Ae(I,ne,se){for(var fe=I.heap[se],Z=se<<1;Z<=I.heap_len&&(Z<I.heap_len&&je(ne,I.heap[Z+1],I.heap[Z],I.depth)&&Z++,!je(ne,fe,I.heap[Z],I.depth));)I.heap[se]=I.heap[Z],se=Z,Z<<=1;I.heap[se]=fe}function Ee(I,ne,se){var fe,Z,ie=0,T,oe;if(I.last_lit!==0)do fe=I.pending_buf[I.d_buf+ie*2]<<8|I.pending_buf[I.d_buf+ie*2+1],Z=I.pending_buf[I.l_buf+ie],ie++,fe===0?K(I,Z,ne):(T=z[Z],K(I,T+c+1,ne),oe=C[T],oe!==0&&(Z-=P[T],$(I,Z,oe)),fe--,T=N(fe),K(I,T,se),oe=D[T],oe!==0&&(fe-=j[T],$(I,fe,oe)));while(ie<I.last_lit);K(I,v,ne)}function $e(I,ne){var se=ne.dyn_tree,fe=ne.stat_desc.static_tree,Z=ne.stat_desc.has_stree,ie=ne.stat_desc.elems,T,oe,be=-1,p;for(I.heap_len=0,I.heap_max=g,T=0;T<ie;T++)se[T*2]!==0?(I.heap[++I.heap_len]=be=T,I.depth[T]=0):se[T*2+1]=0;for(;I.heap_len<2;)p=I.heap[++I.heap_len]=be<2?++be:0,se[p*2]=1,I.depth[p]=0,I.opt_len--,Z&&(I.static_len-=fe[p*2+1]);for(ne.max_code=be,T=I.heap_len>>1;T>=1;T--)Ae(I,se,T);p=ie;do T=I.heap[1],I.heap[1]=I.heap[I.heap_len--],Ae(I,se,1),oe=I.heap[1],I.heap[--I.heap_max]=T,I.heap[--I.heap_max]=oe,se[p*2]=se[T*2]+se[oe*2],I.depth[p]=(I.depth[T]>=I.depth[oe]?I.depth[T]:I.depth[oe])+1,se[T*2+1]=se[oe*2+1]=p,I.heap[1]=p++,Ae(I,se,1);while(I.heap_len>=2);I.heap[--I.heap_max]=I.heap[1],ue(I,ne),ve(se,be,I.bl_count)}function st(I,ne,se){var fe,Z=-1,ie,T=ne[1],oe=0,be=7,p=4;for(T===0&&(be=138,p=3),ne[(se+1)*2+1]=65535,fe=0;fe<=se;fe++)ie=T,T=ne[(fe+1)*2+1],!(++oe<be&&ie===T)&&(oe<p?I.bl_tree[ie*2]+=oe:ie!==0?(ie!==Z&&I.bl_tree[ie*2]++,I.bl_tree[w*2]++):oe<=10?I.bl_tree[x*2]++:I.bl_tree[O*2]++,oe=0,Z=ie,T===0?(be=138,p=3):ie===T?(be=6,p=3):(be=7,p=4))}function qe(I,ne,se){var fe,Z=-1,ie,T=ne[1],oe=0,be=7,p=4;for(T===0&&(be=138,p=3),fe=0;fe<=se;fe++)if(ie=T,T=ne[(fe+1)*2+1],!(++oe<be&&ie===T)){if(oe<p)do K(I,ie,I.bl_tree);while(--oe!==0);else ie!==0?(ie!==Z&&(K(I,ie,I.bl_tree),oe--),K(I,w,I.bl_tree),$(I,oe-3,2)):oe<=10?(K(I,x,I.bl_tree),$(I,oe-3,3)):(K(I,O,I.bl_tree),$(I,oe-11,7));oe=0,Z=ie,T===0?(be=138,p=3):ie===T?(be=6,p=3):(be=7,p=4)}}function De(I){var ne;for(st(I,I.dyn_ltree,I.l_desc.max_code),st(I,I.dyn_dtree,I.d_desc.max_code),$e(I,I.bl_desc),ne=y-1;ne>=3&&I.bl_tree[F[ne]*2+1]===0;ne--);return I.opt_len+=3*(ne+1)+5+5+4,ne}function Ye(I,ne,se,fe){var Z;for($(I,ne-257,5),$(I,se-1,5),$(I,fe-4,4),Z=0;Z<fe;Z++)$(I,I.bl_tree[F[Z]*2+1],3);qe(I,I.dyn_ltree,ne-1),qe(I,I.dyn_dtree,se-1)}function J(I){var ne=4093624447,se;for(se=0;se<=31;se++,ne>>>=1)if(ne&1&&I.dyn_ltree[se*2]!==0)return a;if(I.dyn_ltree[18]!==0||I.dyn_ltree[20]!==0||I.dyn_ltree[26]!==0)return i;for(se=32;se<c;se++)if(I.dyn_ltree[se*2]!==0)return i;return a}var Q=!1;function le(I){Q||(me(),Q=!0),I.l_desc=new M(I.dyn_ltree,U),I.d_desc=new M(I.dyn_dtree,W),I.bl_desc=new M(I.bl_tree,H),I.bi_buf=0,I.bi_valid=0,we(I)}function ge(I,ne,se,fe){$(I,(n<<1)+(fe?1:0),3),ke(I,ne,se)}function he(I){$(I,s<<1,3),K(I,v,R),ae(I)}function Re(I,ne,se,fe){var Z,ie,T=0;I.level>0?(I.strm.data_type===o&&(I.strm.data_type=J(I)),$e(I,I.l_desc),$e(I,I.d_desc),T=De(I),Z=I.opt_len+3+7>>>3,ie=I.static_len+3+7>>>3,ie<=Z&&(Z=ie)):Z=ie=se+5,se+4<=Z&&ne!==-1?ge(I,ne,se,fe):I.strategy===r||ie===Z?($(I,(s<<1)+(fe?1:0),3),Ee(I,R,L)):($(I,(d<<1)+(fe?1:0),3),Ye(I,I.l_desc.max_code+1,I.d_desc.max_code+1,T+1),Ee(I,I.dyn_ltree,I.dyn_dtree)),we(I),fe&&Ce(I)}function Oe(I,ne,se){return I.pending_buf[I.d_buf+I.last_lit*2]=ne>>>8&255,I.pending_buf[I.d_buf+I.last_lit*2+1]=ne&255,I.pending_buf[I.l_buf+I.last_lit]=se&255,I.last_lit++,ne===0?I.dyn_ltree[se*2]++:(I.matches++,ne--,I.dyn_ltree[(z[se]+c+1)*2]++,I.dyn_dtree[N(ne)*2]++),I.last_lit===I.lit_bufsize-1}return kt._tr_init=le,kt._tr_stored_block=ge,kt._tr_flush_block=Re,kt._tr_tally=Oe,kt._tr_align=he,kt}var kn,Ts;function hh(){if(Ts)return kn;Ts=1;function e(r,a,i,o){for(var t=r&65535|0,n=r>>>16&65535|0,s=0;i!==0;){s=i>2e3?2e3:i,i-=s;do t=t+a[o++]|0,n=n+t|0;while(--s);t%=65521,n%=65521}return t|n<<16|0}return kn=e,kn}var jn,xs;function dh(){if(xs)return jn;xs=1;function e(){for(var i,o=[],t=0;t<256;t++){i=t;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;o[t]=i}return o}var r=e();function a(i,o,t,n){var s=r,d=n+t;i^=-1;for(var f=n;f<d;f++)i=i>>>8^s[(i^o[f])&255];return i^-1}return jn=a,jn}var Ln,As;function gm(){return As||(As=1,Ln={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Ln}var Is;function vm(){if(Is)return ut;Is=1;var e=_n(),r=mm(),a=hh(),i=dh(),o=gm(),t=0,n=1,s=3,d=4,f=5,l=0,h=1,c=-2,b=-3,m=-5,y=-1,g=1,u=2,_=3,E=4,v=0,w=2,x=8,O=9,C=15,D=8,Y=29,F=256,S=F+1+Y,R=30,L=19,q=2*S+1,z=15,P=3,j=258,k=j+P+1,U=32,W=42,H=69,M=73,N=91,B=103,$=113,K=666,X=1,ae=2,ue=3,ve=4,me=3;function we(p,te){return p.msg=o[te],te}function Ce(p){return(p<<1)-(p>4?9:0)}function ke(p){for(var te=p.length;--te>=0;)p[te]=0}function je(p){var te=p.state,re=te.pending;re>p.avail_out&&(re=p.avail_out),re!==0&&(e.arraySet(p.output,te.pending_buf,te.pending_out,re,p.next_out),p.next_out+=re,te.pending_out+=re,p.total_out+=re,p.avail_out-=re,te.pending-=re,te.pending===0&&(te.pending_out=0))}function Ae(p,te){r._tr_flush_block(p,p.block_start>=0?p.block_start:-1,p.strstart-p.block_start,te),p.block_start=p.strstart,je(p.strm)}function Ee(p,te){p.pending_buf[p.pending++]=te}function $e(p,te){p.pending_buf[p.pending++]=te>>>8&255,p.pending_buf[p.pending++]=te&255}function st(p,te,re,A){var G=p.avail_in;return G>A&&(G=A),G===0?0:(p.avail_in-=G,e.arraySet(te,p.input,p.next_in,G,re),p.state.wrap===1?p.adler=a(p.adler,te,G,re):p.state.wrap===2&&(p.adler=i(p.adler,te,G,re)),p.next_in+=G,p.total_in+=G,G)}function qe(p,te){var re=p.max_chain_length,A=p.strstart,G,ee,_e=p.prev_length,de=p.nice_match,pe=p.strstart>p.w_size-k?p.strstart-(p.w_size-k):0,xe=p.window,vt=p.w_mask,Le=p.prev,Ie=p.strstart+j,Ue=xe[A+_e-1],Je=xe[A+_e];p.prev_length>=p.good_match&&(re>>=2),de>p.lookahead&&(de=p.lookahead);do if(G=te,!(xe[G+_e]!==Je||xe[G+_e-1]!==Ue||xe[G]!==xe[A]||xe[++G]!==xe[A+1])){A+=2,G++;do;while(xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&xe[++A]===xe[++G]&&A<Ie);if(ee=j-(Ie-A),A=Ie-j,ee>_e){if(p.match_start=te,_e=ee,ee>=de)break;Ue=xe[A+_e-1],Je=xe[A+_e]}}while((te=Le[te&vt])>pe&&--re!==0);return _e<=p.lookahead?_e:p.lookahead}function De(p){var te=p.w_size,re,A,G,ee,_e;do{if(ee=p.window_size-p.lookahead-p.strstart,p.strstart>=te+(te-k)){e.arraySet(p.window,p.window,te,te,0),p.match_start-=te,p.strstart-=te,p.block_start-=te,A=p.hash_size,re=A;do G=p.head[--re],p.head[re]=G>=te?G-te:0;while(--A);A=te,re=A;do G=p.prev[--re],p.prev[re]=G>=te?G-te:0;while(--A);ee+=te}if(p.strm.avail_in===0)break;if(A=st(p.strm,p.window,p.strstart+p.lookahead,ee),p.lookahead+=A,p.lookahead+p.insert>=P)for(_e=p.strstart-p.insert,p.ins_h=p.window[_e],p.ins_h=(p.ins_h<<p.hash_shift^p.window[_e+1])&p.hash_mask;p.insert&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[_e+P-1])&p.hash_mask,p.prev[_e&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=_e,_e++,p.insert--,!(p.lookahead+p.insert<P)););}while(p.lookahead<k&&p.strm.avail_in!==0)}function Ye(p,te){var re=65535;for(re>p.pending_buf_size-5&&(re=p.pending_buf_size-5);;){if(p.lookahead<=1){if(De(p),p.lookahead===0&&te===t)return X;if(p.lookahead===0)break}p.strstart+=p.lookahead,p.lookahead=0;var A=p.block_start+re;if((p.strstart===0||p.strstart>=A)&&(p.lookahead=p.strstart-A,p.strstart=A,Ae(p,!1),p.strm.avail_out===0)||p.strstart-p.block_start>=p.w_size-k&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=0,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):(p.strstart>p.block_start&&(Ae(p,!1),p.strm.avail_out===0),X)}function J(p,te){for(var re,A;;){if(p.lookahead<k){if(De(p),p.lookahead<k&&te===t)return X;if(p.lookahead===0)break}if(re=0,p.lookahead>=P&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart),re!==0&&p.strstart-re<=p.w_size-k&&(p.match_length=qe(p,re)),p.match_length>=P)if(A=r._tr_tally(p,p.strstart-p.match_start,p.match_length-P),p.lookahead-=p.match_length,p.match_length<=p.max_lazy_match&&p.lookahead>=P){p.match_length--;do p.strstart++,p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart;while(--p.match_length!==0);p.strstart++}else p.strstart+=p.match_length,p.match_length=0,p.ins_h=p.window[p.strstart],p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+1])&p.hash_mask;else A=r._tr_tally(p,0,p.window[p.strstart]),p.lookahead--,p.strstart++;if(A&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=p.strstart<P-1?p.strstart:P-1,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function Q(p,te){for(var re,A,G;;){if(p.lookahead<k){if(De(p),p.lookahead<k&&te===t)return X;if(p.lookahead===0)break}if(re=0,p.lookahead>=P&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart),p.prev_length=p.match_length,p.prev_match=p.match_start,p.match_length=P-1,re!==0&&p.prev_length<p.max_lazy_match&&p.strstart-re<=p.w_size-k&&(p.match_length=qe(p,re),p.match_length<=5&&(p.strategy===g||p.match_length===P&&p.strstart-p.match_start>4096)&&(p.match_length=P-1)),p.prev_length>=P&&p.match_length<=p.prev_length){G=p.strstart+p.lookahead-P,A=r._tr_tally(p,p.strstart-1-p.prev_match,p.prev_length-P),p.lookahead-=p.prev_length-1,p.prev_length-=2;do++p.strstart<=G&&(p.ins_h=(p.ins_h<<p.hash_shift^p.window[p.strstart+P-1])&p.hash_mask,re=p.prev[p.strstart&p.w_mask]=p.head[p.ins_h],p.head[p.ins_h]=p.strstart);while(--p.prev_length!==0);if(p.match_available=0,p.match_length=P-1,p.strstart++,A&&(Ae(p,!1),p.strm.avail_out===0))return X}else if(p.match_available){if(A=r._tr_tally(p,0,p.window[p.strstart-1]),A&&Ae(p,!1),p.strstart++,p.lookahead--,p.strm.avail_out===0)return X}else p.match_available=1,p.strstart++,p.lookahead--}return p.match_available&&(A=r._tr_tally(p,0,p.window[p.strstart-1]),p.match_available=0),p.insert=p.strstart<P-1?p.strstart:P-1,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function le(p,te){for(var re,A,G,ee,_e=p.window;;){if(p.lookahead<=j){if(De(p),p.lookahead<=j&&te===t)return X;if(p.lookahead===0)break}if(p.match_length=0,p.lookahead>=P&&p.strstart>0&&(G=p.strstart-1,A=_e[G],A===_e[++G]&&A===_e[++G]&&A===_e[++G])){ee=p.strstart+j;do;while(A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&A===_e[++G]&&G<ee);p.match_length=j-(ee-G),p.match_length>p.lookahead&&(p.match_length=p.lookahead)}if(p.match_length>=P?(re=r._tr_tally(p,1,p.match_length-P),p.lookahead-=p.match_length,p.strstart+=p.match_length,p.match_length=0):(re=r._tr_tally(p,0,p.window[p.strstart]),p.lookahead--,p.strstart++),re&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=0,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function ge(p,te){for(var re;;){if(p.lookahead===0&&(De(p),p.lookahead===0)){if(te===t)return X;break}if(p.match_length=0,re=r._tr_tally(p,0,p.window[p.strstart]),p.lookahead--,p.strstart++,re&&(Ae(p,!1),p.strm.avail_out===0))return X}return p.insert=0,te===d?(Ae(p,!0),p.strm.avail_out===0?ue:ve):p.last_lit&&(Ae(p,!1),p.strm.avail_out===0)?X:ae}function he(p,te,re,A,G){this.good_length=p,this.max_lazy=te,this.nice_length=re,this.max_chain=A,this.func=G}var Re;Re=[new he(0,0,0,0,Ye),new he(4,4,8,4,J),new he(4,5,16,8,J),new he(4,6,32,32,J),new he(4,4,16,16,Q),new he(8,16,32,32,Q),new he(8,16,128,128,Q),new he(8,32,128,256,Q),new he(32,128,258,1024,Q),new he(32,258,258,4096,Q)];function Oe(p){p.window_size=2*p.w_size,ke(p.head),p.max_lazy_match=Re[p.level].max_lazy,p.good_match=Re[p.level].good_length,p.nice_match=Re[p.level].nice_length,p.max_chain_length=Re[p.level].max_chain,p.strstart=0,p.block_start=0,p.lookahead=0,p.insert=0,p.match_length=p.prev_length=P-1,p.match_available=0,p.ins_h=0}function I(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(q*2),this.dyn_dtree=new e.Buf16((2*R+1)*2),this.bl_tree=new e.Buf16((2*L+1)*2),ke(this.dyn_ltree),ke(this.dyn_dtree),ke(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(z+1),this.heap=new e.Buf16(2*S+1),ke(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*S+1),ke(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ne(p){var te;return!p||!p.state?we(p,c):(p.total_in=p.total_out=0,p.data_type=w,te=p.state,te.pending=0,te.pending_out=0,te.wrap<0&&(te.wrap=-te.wrap),te.status=te.wrap?W:$,p.adler=te.wrap===2?0:1,te.last_flush=t,r._tr_init(te),l)}function se(p){var te=ne(p);return te===l&&Oe(p.state),te}function fe(p,te){return!p||!p.state||p.state.wrap!==2?c:(p.state.gzhead=te,l)}function Z(p,te,re,A,G,ee){if(!p)return c;var _e=1;if(te===y&&(te=6),A<0?(_e=0,A=-A):A>15&&(_e=2,A-=16),G<1||G>O||re!==x||A<8||A>15||te<0||te>9||ee<0||ee>E)return we(p,c);A===8&&(A=9);var de=new I;return p.state=de,de.strm=p,de.wrap=_e,de.gzhead=null,de.w_bits=A,de.w_size=1<<de.w_bits,de.w_mask=de.w_size-1,de.hash_bits=G+7,de.hash_size=1<<de.hash_bits,de.hash_mask=de.hash_size-1,de.hash_shift=~~((de.hash_bits+P-1)/P),de.window=new e.Buf8(de.w_size*2),de.head=new e.Buf16(de.hash_size),de.prev=new e.Buf16(de.w_size),de.lit_bufsize=1<<G+6,de.pending_buf_size=de.lit_bufsize*4,de.pending_buf=new e.Buf8(de.pending_buf_size),de.d_buf=1*de.lit_bufsize,de.l_buf=3*de.lit_bufsize,de.level=te,de.strategy=ee,de.method=re,se(p)}function ie(p,te){return Z(p,te,x,C,D,v)}function T(p,te){var re,A,G,ee;if(!p||!p.state||te>f||te<0)return p?we(p,c):c;if(A=p.state,!p.output||!p.input&&p.avail_in!==0||A.status===K&&te!==d)return we(p,p.avail_out===0?m:c);if(A.strm=p,re=A.last_flush,A.last_flush=te,A.status===W)if(A.wrap===2)p.adler=0,Ee(A,31),Ee(A,139),Ee(A,8),A.gzhead?(Ee(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),Ee(A,A.gzhead.time&255),Ee(A,A.gzhead.time>>8&255),Ee(A,A.gzhead.time>>16&255),Ee(A,A.gzhead.time>>24&255),Ee(A,A.level===9?2:A.strategy>=u||A.level<2?4:0),Ee(A,A.gzhead.os&255),A.gzhead.extra&&A.gzhead.extra.length&&(Ee(A,A.gzhead.extra.length&255),Ee(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(p.adler=i(p.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=H):(Ee(A,0),Ee(A,0),Ee(A,0),Ee(A,0),Ee(A,0),Ee(A,A.level===9?2:A.strategy>=u||A.level<2?4:0),Ee(A,me),A.status=$);else{var _e=x+(A.w_bits-8<<4)<<8,de=-1;A.strategy>=u||A.level<2?de=0:A.level<6?de=1:A.level===6?de=2:de=3,_e|=de<<6,A.strstart!==0&&(_e|=U),_e+=31-_e%31,A.status=$,$e(A,_e),A.strstart!==0&&($e(A,p.adler>>>16),$e(A,p.adler&65535)),p.adler=1}if(A.status===H)if(A.gzhead.extra){for(G=A.pending;A.gzindex<(A.gzhead.extra.length&65535)&&!(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),je(p),G=A.pending,A.pending===A.pending_buf_size));)Ee(A,A.gzhead.extra[A.gzindex]&255),A.gzindex++;A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=M)}else A.status=M;if(A.status===M)if(A.gzhead.name){G=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),je(p),G=A.pending,A.pending===A.pending_buf_size)){ee=1;break}A.gzindex<A.gzhead.name.length?ee=A.gzhead.name.charCodeAt(A.gzindex++)&255:ee=0,Ee(A,ee)}while(ee!==0);A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),ee===0&&(A.gzindex=0,A.status=N)}else A.status=N;if(A.status===N)if(A.gzhead.comment){G=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),je(p),G=A.pending,A.pending===A.pending_buf_size)){ee=1;break}A.gzindex<A.gzhead.comment.length?ee=A.gzhead.comment.charCodeAt(A.gzindex++)&255:ee=0,Ee(A,ee)}while(ee!==0);A.gzhead.hcrc&&A.pending>G&&(p.adler=i(p.adler,A.pending_buf,A.pending-G,G)),ee===0&&(A.status=B)}else A.status=B;if(A.status===B&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&je(p),A.pending+2<=A.pending_buf_size&&(Ee(A,p.adler&255),Ee(A,p.adler>>8&255),p.adler=0,A.status=$)):A.status=$),A.pending!==0){if(je(p),p.avail_out===0)return A.last_flush=-1,l}else if(p.avail_in===0&&Ce(te)<=Ce(re)&&te!==d)return we(p,m);if(A.status===K&&p.avail_in!==0)return we(p,m);if(p.avail_in!==0||A.lookahead!==0||te!==t&&A.status!==K){var pe=A.strategy===u?ge(A,te):A.strategy===_?le(A,te):Re[A.level].func(A,te);if((pe===ue||pe===ve)&&(A.status=K),pe===X||pe===ue)return p.avail_out===0&&(A.last_flush=-1),l;if(pe===ae&&(te===n?r._tr_align(A):te!==f&&(r._tr_stored_block(A,0,0,!1),te===s&&(ke(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),je(p),p.avail_out===0))return A.last_flush=-1,l}return te!==d?l:A.wrap<=0?h:(A.wrap===2?(Ee(A,p.adler&255),Ee(A,p.adler>>8&255),Ee(A,p.adler>>16&255),Ee(A,p.adler>>24&255),Ee(A,p.total_in&255),Ee(A,p.total_in>>8&255),Ee(A,p.total_in>>16&255),Ee(A,p.total_in>>24&255)):($e(A,p.adler>>>16),$e(A,p.adler&65535)),je(p),A.wrap>0&&(A.wrap=-A.wrap),A.pending!==0?l:h)}function oe(p){var te;return!p||!p.state?c:(te=p.state.status,te!==W&&te!==H&&te!==M&&te!==N&&te!==B&&te!==$&&te!==K?we(p,c):(p.state=null,te===$?we(p,b):l))}function be(p,te){var re=te.length,A,G,ee,_e,de,pe,xe,vt;if(!p||!p.state||(A=p.state,_e=A.wrap,_e===2||_e===1&&A.status!==W||A.lookahead))return c;for(_e===1&&(p.adler=a(p.adler,te,re,0)),A.wrap=0,re>=A.w_size&&(_e===0&&(ke(A.head),A.strstart=0,A.block_start=0,A.insert=0),vt=new e.Buf8(A.w_size),e.arraySet(vt,te,re-A.w_size,A.w_size,0),te=vt,re=A.w_size),de=p.avail_in,pe=p.next_in,xe=p.input,p.avail_in=re,p.next_in=0,p.input=te,De(A);A.lookahead>=P;){G=A.strstart,ee=A.lookahead-(P-1);do A.ins_h=(A.ins_h<<A.hash_shift^A.window[G+P-1])&A.hash_mask,A.prev[G&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=G,G++;while(--ee);A.strstart=G,A.lookahead=P-1,De(A)}return A.strstart+=A.lookahead,A.block_start=A.strstart,A.insert=A.lookahead,A.lookahead=0,A.match_length=A.prev_length=P-1,A.match_available=0,p.next_in=pe,p.input=xe,p.avail_in=de,A.wrap=_e,l}return ut.deflateInit=ie,ut.deflateInit2=Z,ut.deflateReset=se,ut.deflateResetKeep=ne,ut.deflateSetHeader=fe,ut.deflate=T,ut.deflateEnd=oe,ut.deflateSetDictionary=be,ut.deflateInfo="pako deflate (from Nodeca project)",ut}var qn,Cs;function ym(){if(Cs)return qn;Cs=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return qn=e,qn}var it={},Nn,Ps;function _m(){if(Ps)return Nn;Ps=1;var e=30,r=12;return Nn=function(i,o){var t,n,s,d,f,l,h,c,b,m,y,g,u,_,E,v,w,x,O,C,D,Y,F,S,R;t=i.state,n=i.next_in,S=i.input,s=n+(i.avail_in-5),d=i.next_out,R=i.output,f=d-(o-i.avail_out),l=d+(i.avail_out-257),h=t.dmax,c=t.wsize,b=t.whave,m=t.wnext,y=t.window,g=t.hold,u=t.bits,_=t.lencode,E=t.distcode,v=(1<<t.lenbits)-1,w=(1<<t.distbits)-1;e:do{u<15&&(g+=S[n++]<<u,u+=8,g+=S[n++]<<u,u+=8),x=_[g&v];t:for(;;){if(O=x>>>24,g>>>=O,u-=O,O=x>>>16&255,O===0)R[d++]=x&65535;else if(O&16){C=x&65535,O&=15,O&&(u<O&&(g+=S[n++]<<u,u+=8),C+=g&(1<<O)-1,g>>>=O,u-=O),u<15&&(g+=S[n++]<<u,u+=8,g+=S[n++]<<u,u+=8),x=E[g&w];r:for(;;){if(O=x>>>24,g>>>=O,u-=O,O=x>>>16&255,O&16){if(D=x&65535,O&=15,u<O&&(g+=S[n++]<<u,u+=8,u<O&&(g+=S[n++]<<u,u+=8)),D+=g&(1<<O)-1,D>h){i.msg="invalid distance too far back",t.mode=e;break e}if(g>>>=O,u-=O,O=d-f,D>O){if(O=D-O,O>b&&t.sane){i.msg="invalid distance too far back",t.mode=e;break e}if(Y=0,F=y,m===0){if(Y+=c-O,O<C){C-=O;do R[d++]=y[Y++];while(--O);Y=d-D,F=R}}else if(m<O){if(Y+=c+m-O,O-=m,O<C){C-=O;do R[d++]=y[Y++];while(--O);if(Y=0,m<C){O=m,C-=O;do R[d++]=y[Y++];while(--O);Y=d-D,F=R}}}else if(Y+=m-O,O<C){C-=O;do R[d++]=y[Y++];while(--O);Y=d-D,F=R}for(;C>2;)R[d++]=F[Y++],R[d++]=F[Y++],R[d++]=F[Y++],C-=3;C&&(R[d++]=F[Y++],C>1&&(R[d++]=F[Y++]))}else{Y=d-D;do R[d++]=R[Y++],R[d++]=R[Y++],R[d++]=R[Y++],C-=3;while(C>2);C&&(R[d++]=R[Y++],C>1&&(R[d++]=R[Y++]))}}else if((O&64)===0){x=E[(x&65535)+(g&(1<<O)-1)];continue r}else{i.msg="invalid distance code",t.mode=e;break e}break}}else if((O&64)===0){x=_[(x&65535)+(g&(1<<O)-1)];continue t}else if(O&32){t.mode=r;break e}else{i.msg="invalid literal/length code",t.mode=e;break e}break}}while(n<s&&d<l);C=u>>3,n-=C,u-=C<<3,g&=(1<<u)-1,i.next_in=n,i.next_out=d,i.avail_in=n<s?5+(s-n):5-(n-s),i.avail_out=d<l?257+(l-d):257-(d-l),t.hold=g,t.bits=u},Nn}var Dn,ks;function bm(){if(ks)return Dn;ks=1;var e=_n(),r=15,a=852,i=592,o=0,t=1,n=2,s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],d=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],f=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Dn=function(c,b,m,y,g,u,_,E){var v=E.bits,w=0,x=0,O=0,C=0,D=0,Y=0,F=0,S=0,R=0,L=0,q,z,P,j,k,U=null,W=0,H,M=new e.Buf16(r+1),N=new e.Buf16(r+1),B=null,$=0,K,X,ae;for(w=0;w<=r;w++)M[w]=0;for(x=0;x<y;x++)M[b[m+x]]++;for(D=v,C=r;C>=1&&M[C]===0;C--);if(D>C&&(D=C),C===0)return g[u++]=1<<24|64<<16|0,g[u++]=1<<24|64<<16|0,E.bits=1,0;for(O=1;O<C&&M[O]===0;O++);for(D<O&&(D=O),S=1,w=1;w<=r;w++)if(S<<=1,S-=M[w],S<0)return-1;if(S>0&&(c===o||C!==1))return-1;for(N[1]=0,w=1;w<r;w++)N[w+1]=N[w]+M[w];for(x=0;x<y;x++)b[m+x]!==0&&(_[N[b[m+x]]++]=x);if(c===o?(U=B=_,H=19):c===t?(U=s,W-=257,B=d,$-=257,H=256):(U=f,B=l,H=-1),L=0,x=0,w=O,k=u,Y=D,F=0,P=-1,R=1<<D,j=R-1,c===t&&R>a||c===n&&R>i)return 1;for(;;){K=w-F,_[x]<H?(X=0,ae=_[x]):_[x]>H?(X=B[$+_[x]],ae=U[W+_[x]]):(X=96,ae=0),q=1<<w-F,z=1<<Y,O=z;do z-=q,g[k+(L>>F)+z]=K<<24|X<<16|ae|0;while(z!==0);for(q=1<<w-1;L&q;)q>>=1;if(q!==0?(L&=q-1,L+=q):L=0,x++,--M[w]===0){if(w===C)break;w=b[m+_[x]]}if(w>D&&(L&j)!==P){for(F===0&&(F=D),k+=O,Y=w-F,S=1<<Y;Y+F<C&&(S-=M[Y+F],!(S<=0));)Y++,S<<=1;if(R+=1<<Y,c===t&&R>a||c===n&&R>i)return 1;P=L&j,g[P]=D<<24|Y<<16|k-u|0}}return L!==0&&(g[k+L]=w-F<<24|64<<16|0),E.bits=D,0},Dn}var js;function wm(){if(js)return it;js=1;var e=_n(),r=hh(),a=dh(),i=_m(),o=bm(),t=0,n=1,s=2,d=4,f=5,l=6,h=0,c=1,b=2,m=-2,y=-3,g=-4,u=-5,_=8,E=1,v=2,w=3,x=4,O=5,C=6,D=7,Y=8,F=9,S=10,R=11,L=12,q=13,z=14,P=15,j=16,k=17,U=18,W=19,H=20,M=21,N=22,B=23,$=24,K=25,X=26,ae=27,ue=28,ve=29,me=30,we=31,Ce=32,ke=852,je=592,Ae=15,Ee=Ae;function $e(Z){return(Z>>>24&255)+(Z>>>8&65280)+((Z&65280)<<8)+((Z&255)<<24)}function st(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function qe(Z){var ie;return!Z||!Z.state?m:(ie=Z.state,Z.total_in=Z.total_out=ie.total=0,Z.msg="",ie.wrap&&(Z.adler=ie.wrap&1),ie.mode=E,ie.last=0,ie.havedict=0,ie.dmax=32768,ie.head=null,ie.hold=0,ie.bits=0,ie.lencode=ie.lendyn=new e.Buf32(ke),ie.distcode=ie.distdyn=new e.Buf32(je),ie.sane=1,ie.back=-1,h)}function De(Z){var ie;return!Z||!Z.state?m:(ie=Z.state,ie.wsize=0,ie.whave=0,ie.wnext=0,qe(Z))}function Ye(Z,ie){var T,oe;return!Z||!Z.state||(oe=Z.state,ie<0?(T=0,ie=-ie):(T=(ie>>4)+1,ie<48&&(ie&=15)),ie&&(ie<8||ie>15))?m:(oe.window!==null&&oe.wbits!==ie&&(oe.window=null),oe.wrap=T,oe.wbits=ie,De(Z))}function J(Z,ie){var T,oe;return Z?(oe=new st,Z.state=oe,oe.window=null,T=Ye(Z,ie),T!==h&&(Z.state=null),T):m}function Q(Z){return J(Z,Ee)}var le=!0,ge,he;function Re(Z){if(le){var ie;for(ge=new e.Buf32(512),he=new e.Buf32(32),ie=0;ie<144;)Z.lens[ie++]=8;for(;ie<256;)Z.lens[ie++]=9;for(;ie<280;)Z.lens[ie++]=7;for(;ie<288;)Z.lens[ie++]=8;for(o(n,Z.lens,0,288,ge,0,Z.work,{bits:9}),ie=0;ie<32;)Z.lens[ie++]=5;o(s,Z.lens,0,32,he,0,Z.work,{bits:5}),le=!1}Z.lencode=ge,Z.lenbits=9,Z.distcode=he,Z.distbits=5}function Oe(Z,ie,T,oe){var be,p=Z.state;return p.window===null&&(p.wsize=1<<p.wbits,p.wnext=0,p.whave=0,p.window=new e.Buf8(p.wsize)),oe>=p.wsize?(e.arraySet(p.window,ie,T-p.wsize,p.wsize,0),p.wnext=0,p.whave=p.wsize):(be=p.wsize-p.wnext,be>oe&&(be=oe),e.arraySet(p.window,ie,T-oe,be,p.wnext),oe-=be,oe?(e.arraySet(p.window,ie,T-oe,oe,0),p.wnext=oe,p.whave=p.wsize):(p.wnext+=be,p.wnext===p.wsize&&(p.wnext=0),p.whave<p.wsize&&(p.whave+=be))),0}function I(Z,ie){var T,oe,be,p,te,re,A,G,ee,_e,de,pe,xe,vt,Le=0,Ie,Ue,Je,Xe,_r,br,Me,nt,Ge=new e.Buf8(4),yt,ht,vs=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Z||!Z.state||!Z.output||!Z.input&&Z.avail_in!==0)return m;T=Z.state,T.mode===L&&(T.mode=q),te=Z.next_out,be=Z.output,A=Z.avail_out,p=Z.next_in,oe=Z.input,re=Z.avail_in,G=T.hold,ee=T.bits,_e=re,de=A,nt=h;e:for(;;)switch(T.mode){case E:if(T.wrap===0){T.mode=q;break}for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(T.wrap&2&&G===35615){T.check=0,Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0),G=0,ee=0,T.mode=v;break}if(T.flags=0,T.head&&(T.head.done=!1),!(T.wrap&1)||(((G&255)<<8)+(G>>8))%31){Z.msg="incorrect header check",T.mode=me;break}if((G&15)!==_){Z.msg="unknown compression method",T.mode=me;break}if(G>>>=4,ee-=4,Me=(G&15)+8,T.wbits===0)T.wbits=Me;else if(Me>T.wbits){Z.msg="invalid window size",T.mode=me;break}T.dmax=1<<Me,Z.adler=T.check=1,T.mode=G&512?S:L,G=0,ee=0;break;case v:for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(T.flags=G,(T.flags&255)!==_){Z.msg="unknown compression method",T.mode=me;break}if(T.flags&57344){Z.msg="unknown header flags set",T.mode=me;break}T.head&&(T.head.text=G>>8&1),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0)),G=0,ee=0,T.mode=w;case w:for(;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.head&&(T.head.time=G),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,Ge[2]=G>>>16&255,Ge[3]=G>>>24&255,T.check=a(T.check,Ge,4,0)),G=0,ee=0,T.mode=x;case x:for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.head&&(T.head.xflags=G&255,T.head.os=G>>8),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0)),G=0,ee=0,T.mode=O;case O:if(T.flags&1024){for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.length=G,T.head&&(T.head.extra_len=G),T.flags&512&&(Ge[0]=G&255,Ge[1]=G>>>8&255,T.check=a(T.check,Ge,2,0)),G=0,ee=0}else T.head&&(T.head.extra=null);T.mode=C;case C:if(T.flags&1024&&(pe=T.length,pe>re&&(pe=re),pe&&(T.head&&(Me=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),e.arraySet(T.head.extra,oe,p,pe,Me)),T.flags&512&&(T.check=a(T.check,oe,pe,p)),re-=pe,p+=pe,T.length-=pe),T.length))break e;T.length=0,T.mode=D;case D:if(T.flags&2048){if(re===0)break e;pe=0;do Me=oe[p+pe++],T.head&&Me&&T.length<65536&&(T.head.name+=String.fromCharCode(Me));while(Me&&pe<re);if(T.flags&512&&(T.check=a(T.check,oe,pe,p)),re-=pe,p+=pe,Me)break e}else T.head&&(T.head.name=null);T.length=0,T.mode=Y;case Y:if(T.flags&4096){if(re===0)break e;pe=0;do Me=oe[p+pe++],T.head&&Me&&T.length<65536&&(T.head.comment+=String.fromCharCode(Me));while(Me&&pe<re);if(T.flags&512&&(T.check=a(T.check,oe,pe,p)),re-=pe,p+=pe,Me)break e}else T.head&&(T.head.comment=null);T.mode=F;case F:if(T.flags&512){for(;ee<16;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(G!==(T.check&65535)){Z.msg="header crc mismatch",T.mode=me;break}G=0,ee=0}T.head&&(T.head.hcrc=T.flags>>9&1,T.head.done=!0),Z.adler=T.check=0,T.mode=L;break;case S:for(;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}Z.adler=T.check=$e(G),G=0,ee=0,T.mode=R;case R:if(T.havedict===0)return Z.next_out=te,Z.avail_out=A,Z.next_in=p,Z.avail_in=re,T.hold=G,T.bits=ee,b;Z.adler=T.check=1,T.mode=L;case L:if(ie===f||ie===l)break e;case q:if(T.last){G>>>=ee&7,ee-=ee&7,T.mode=ae;break}for(;ee<3;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}switch(T.last=G&1,G>>>=1,ee-=1,G&3){case 0:T.mode=z;break;case 1:if(Re(T),T.mode=H,ie===l){G>>>=2,ee-=2;break e}break;case 2:T.mode=k;break;case 3:Z.msg="invalid block type",T.mode=me}G>>>=2,ee-=2;break;case z:for(G>>>=ee&7,ee-=ee&7;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if((G&65535)!==(G>>>16^65535)){Z.msg="invalid stored block lengths",T.mode=me;break}if(T.length=G&65535,G=0,ee=0,T.mode=P,ie===l)break e;case P:T.mode=j;case j:if(pe=T.length,pe){if(pe>re&&(pe=re),pe>A&&(pe=A),pe===0)break e;e.arraySet(be,oe,p,pe,te),re-=pe,p+=pe,A-=pe,te+=pe,T.length-=pe;break}T.mode=L;break;case k:for(;ee<14;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(T.nlen=(G&31)+257,G>>>=5,ee-=5,T.ndist=(G&31)+1,G>>>=5,ee-=5,T.ncode=(G&15)+4,G>>>=4,ee-=4,T.nlen>286||T.ndist>30){Z.msg="too many length or distance symbols",T.mode=me;break}T.have=0,T.mode=U;case U:for(;T.have<T.ncode;){for(;ee<3;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.lens[vs[T.have++]]=G&7,G>>>=3,ee-=3}for(;T.have<19;)T.lens[vs[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,yt={bits:T.lenbits},nt=o(t,T.lens,0,19,T.lencode,0,T.work,yt),T.lenbits=yt.bits,nt){Z.msg="invalid code lengths set",T.mode=me;break}T.have=0,T.mode=W;case W:for(;T.have<T.nlen+T.ndist;){for(;Le=T.lencode[G&(1<<T.lenbits)-1],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(Je<16)G>>>=Ie,ee-=Ie,T.lens[T.have++]=Je;else{if(Je===16){for(ht=Ie+2;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(G>>>=Ie,ee-=Ie,T.have===0){Z.msg="invalid bit length repeat",T.mode=me;break}Me=T.lens[T.have-1],pe=3+(G&3),G>>>=2,ee-=2}else if(Je===17){for(ht=Ie+3;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Ie,ee-=Ie,Me=0,pe=3+(G&7),G>>>=3,ee-=3}else{for(ht=Ie+7;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Ie,ee-=Ie,Me=0,pe=11+(G&127),G>>>=7,ee-=7}if(T.have+pe>T.nlen+T.ndist){Z.msg="invalid bit length repeat",T.mode=me;break}for(;pe--;)T.lens[T.have++]=Me}}if(T.mode===me)break;if(T.lens[256]===0){Z.msg="invalid code -- missing end-of-block",T.mode=me;break}if(T.lenbits=9,yt={bits:T.lenbits},nt=o(n,T.lens,0,T.nlen,T.lencode,0,T.work,yt),T.lenbits=yt.bits,nt){Z.msg="invalid literal/lengths set",T.mode=me;break}if(T.distbits=6,T.distcode=T.distdyn,yt={bits:T.distbits},nt=o(s,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,yt),T.distbits=yt.bits,nt){Z.msg="invalid distances set",T.mode=me;break}if(T.mode=H,ie===l)break e;case H:T.mode=M;case M:if(re>=6&&A>=258){Z.next_out=te,Z.avail_out=A,Z.next_in=p,Z.avail_in=re,T.hold=G,T.bits=ee,i(Z,de),te=Z.next_out,be=Z.output,A=Z.avail_out,p=Z.next_in,oe=Z.input,re=Z.avail_in,G=T.hold,ee=T.bits,T.mode===L&&(T.back=-1);break}for(T.back=0;Le=T.lencode[G&(1<<T.lenbits)-1],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(Ue&&(Ue&240)===0){for(Xe=Ie,_r=Ue,br=Je;Le=T.lencode[br+((G&(1<<Xe+_r)-1)>>Xe)],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Xe+Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Xe,ee-=Xe,T.back+=Xe}if(G>>>=Ie,ee-=Ie,T.back+=Ie,T.length=Je,Ue===0){T.mode=X;break}if(Ue&32){T.back=-1,T.mode=L;break}if(Ue&64){Z.msg="invalid literal/length code",T.mode=me;break}T.extra=Ue&15,T.mode=N;case N:if(T.extra){for(ht=T.extra;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.length+=G&(1<<T.extra)-1,G>>>=T.extra,ee-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=B;case B:for(;Le=T.distcode[G&(1<<T.distbits)-1],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if((Ue&240)===0){for(Xe=Ie,_r=Ue,br=Je;Le=T.distcode[br+((G&(1<<Xe+_r)-1)>>Xe)],Ie=Le>>>24,Ue=Le>>>16&255,Je=Le&65535,!(Xe+Ie<=ee);){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}G>>>=Xe,ee-=Xe,T.back+=Xe}if(G>>>=Ie,ee-=Ie,T.back+=Ie,Ue&64){Z.msg="invalid distance code",T.mode=me;break}T.offset=Je,T.extra=Ue&15,T.mode=$;case $:if(T.extra){for(ht=T.extra;ee<ht;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}T.offset+=G&(1<<T.extra)-1,G>>>=T.extra,ee-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){Z.msg="invalid distance too far back",T.mode=me;break}T.mode=K;case K:if(A===0)break e;if(pe=de-A,T.offset>pe){if(pe=T.offset-pe,pe>T.whave&&T.sane){Z.msg="invalid distance too far back",T.mode=me;break}pe>T.wnext?(pe-=T.wnext,xe=T.wsize-pe):xe=T.wnext-pe,pe>T.length&&(pe=T.length),vt=T.window}else vt=be,xe=te-T.offset,pe=T.length;pe>A&&(pe=A),A-=pe,T.length-=pe;do be[te++]=vt[xe++];while(--pe);T.length===0&&(T.mode=M);break;case X:if(A===0)break e;be[te++]=T.length,A--,T.mode=M;break;case ae:if(T.wrap){for(;ee<32;){if(re===0)break e;re--,G|=oe[p++]<<ee,ee+=8}if(de-=A,Z.total_out+=de,T.total+=de,de&&(Z.adler=T.check=T.flags?a(T.check,be,de,te-de):r(T.check,be,de,te-de)),de=A,(T.flags?G:$e(G))!==T.check){Z.msg="incorrect data check",T.mode=me;break}G=0,ee=0}T.mode=ue;case ue:if(T.wrap&&T.flags){for(;ee<32;){if(re===0)break e;re--,G+=oe[p++]<<ee,ee+=8}if(G!==(T.total&4294967295)){Z.msg="incorrect length check",T.mode=me;break}G=0,ee=0}T.mode=ve;case ve:nt=c;break e;case me:nt=y;break e;case we:return g;case Ce:default:return m}return Z.next_out=te,Z.avail_out=A,Z.next_in=p,Z.avail_in=re,T.hold=G,T.bits=ee,(T.wsize||de!==Z.avail_out&&T.mode<me&&(T.mode<ae||ie!==d))&&Oe(Z,Z.output,Z.next_out,de-Z.avail_out),_e-=Z.avail_in,de-=Z.avail_out,Z.total_in+=_e,Z.total_out+=de,T.total+=de,T.wrap&&de&&(Z.adler=T.check=T.flags?a(T.check,be,de,Z.next_out-de):r(T.check,be,de,Z.next_out-de)),Z.data_type=T.bits+(T.last?64:0)+(T.mode===L?128:0)+(T.mode===H||T.mode===P?256:0),(_e===0&&de===0||ie===d)&&nt===h&&(nt=u),nt}function ne(Z){if(!Z||!Z.state)return m;var ie=Z.state;return ie.window&&(ie.window=null),Z.state=null,h}function se(Z,ie){var T;return!Z||!Z.state||(T=Z.state,(T.wrap&2)===0)?m:(T.head=ie,ie.done=!1,h)}function fe(Z,ie){var T=ie.length,oe,be,p;return!Z||!Z.state||(oe=Z.state,oe.wrap!==0&&oe.mode!==R)?m:oe.mode===R&&(be=1,be=r(be,ie,T,0),be!==oe.check)?y:(p=Oe(Z,ie,T,T),p?(oe.mode=we,g):(oe.havedict=1,h))}return it.inflateReset=De,it.inflateReset2=Ye,it.inflateResetKeep=qe,it.inflateInit=Q,it.inflateInit2=J,it.inflate=I,it.inflateEnd=ne,it.inflateGetHeader=se,it.inflateSetDictionary=fe,it.inflateInfo="pako inflate (from Nodeca project)",it}var Mn,Ls;function Em(){return Ls||(Ls=1,Mn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Mn}function Sm(){const{useDynamicConfig:e}=wt(),{configValue:r,isDynamicConfigLoading:a}=e(xt.creditAgentEnablement),i=He.getSignedInUser()?.userEmail;return{isAllowed:ce.useMemo(()=>{const t=Array.isArray(r?.allowedUserEmails)?r.allowedUserEmails:[];return i!=null&&t.includes(i)},[r,i]),isLoading:a}}function St(){const{isAllowed:e}=Sm();return e?Ap:Ip}const Rm={overlayWidth:new at(100,100,50)};function qs(){const e=Be(),r=We(),a=lr(),i=Bt(),o=St(),t=Se(F=>Df(F)),n=t.uiState.selectedCustomerTenantId,s=ce.useMemo(()=>n?t.customers.find(F=>F.tenantId===n):void 0,[t.customers,n]),d=Se(F=>n?Mf(F.aiAccountantCustomerState,F.userState,n):[]),f=t.customerViewStateByTenantId[n],l=f?.jobsFetchStatus??{fetchState:"Not-Started"},h=f?.jobsPageToken!=null;ce.useEffect(()=>{t.fetchState==="Completed"?r(It(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&r(ys())},[t.fetchState]);const c=F=>{const S=Pt(F),R=Ft(F);Fe.trackCockpitTabClicked(R),e(`../../${S}`,{replace:!0})},b=(F,S,R,L)=>{r(Nt([F.tenantId])),r(nn(S,R,L))},m=(F,S,R)=>{r(nn(F,S,R))},y=(F,S)=>{r(Nt(t.unonboardedTenantIds)),r(nn("retrain",F,S))},g=F=>{const S=t.selectedTenantIds,R=S.includes(F)?S.filter(L=>L!==F):[...S,F];r(Nt(R))},u=F=>{if(F.length===0)return;const S=t.selectedTenantIds,R=new Set(S);if(F.every(q=>R.has(q))){const q=new Set(F);r(Nt(S.filter(z=>!q.has(z))))}else{const q=Array.from(new Set([...S,...F]));r(Nt(q))}},_=()=>{r(Nt([]))},E=F=>{r(Ff(F.companyId,F.tenantId))},v=F=>{F==="aiAccountant"&&r(ys())},w=(F,S)=>{r(Jt({sortKey:F,sortOrder:S}))},x=F=>{r(Jt({selectedCustomerTenantId:F.tenantId})),r(on(F.tenantId))},O=()=>{r(Jt({selectedCustomerTenantId:""}))},C=F=>{r(Jt({filterText:F}))},D=(F,S)=>{r(Jt({filters:S}))},Y=()=>{n&&r(on(n,!0))};return V.jsxs(V.Fragment,{children:[V.jsx(Cp,{headerData:{allTabOptions:o,selectedTabOption:Et("aiAccountant")},headerActions:{onTabChange:c},aiAccountantPageData:{aiAccountantView:t},aiAccountantPageActions:{onAction:b,onBulkAction:m,onCancelOnboarding:E,onClearSelection:_,onCockpitReloadData:v,onColumnSortConfigChanged:w,onCustomerSelected:x,onEvaluateAll:y,onFilterTextChanged:C,onFiltersChange:D,onToggleAllVisible:u,onToggleTenantSelection:g}}),V.jsx(hr,{anchor:"right",open:s!=null,PaperProps:{style:{width:Rm.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:O,children:s!=null&&V.jsx(ah,{customer:s,hasMoreJobs:h,jobs:d,jobsFetchStatus:l,onAction:b,onCancelOnboarding:E,onClose:O,onLoadMoreJobs:Y})})]})}function Om(){const{tenantId:e=""}=ot(),r=Be(),a=We(),i=Se(c=>fd(c.aiAccountantCustomerState,c.userState)),o=Se(c=>Df(c)),t=i.find(c=>c.tenantId===e),n=o.customerViewStateByTenantId[e],s=Se(c=>Mf(c.aiAccountantCustomerState,c.userState,e));if(ce.useEffect(()=>{a(on(e))},[e,a]),t==null)return null;const d=(c,b,m,y)=>{a(Nt([c.tenantId])),a(nn(b,m,y))},f=c=>{a(Ff(c.companyId,c.tenantId))},l=()=>{r("../")},h=()=>{a(on(e,!0))};return V.jsx(ah,{customer:t,hasMoreJobs:n?.jobsPageToken!=null,jobs:s,jobsFetchStatus:n?.jobsFetchStatus??{fetchState:"Not-Started"},onAction:d,onCancelOnboarding:f,onClose:l,onLoadMoreJobs:h})}const ph=(e,r)=>{const a=[...e??[]];return a.push(r),a},Tm=e=>{const r=[...e??[]];return{poppedPathname:r.pop(),newStack:r}},xm=(e=2)=>{let r="../";for(let a=0;a<e;a++)r=`${r}../`;return r},Pe=({state:e,element:r})=>He.isSignedIn()===!0?V.jsx(V.Fragment,{children:r}):V.jsx(ir,{to:"/signin/auth",replace:!0,state:{...e,message:"...",origin:window.location.pathname}});function Am(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(qs,{})})}),V.jsx(Te,{path:"/detail/:tenantId",element:V.jsx(Pe,{element:V.jsx(Om,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(qs,{})})})]})}const Ut=()=>{const[e,r]=fh(),[a,i]=ce.useState(),o=ce.useRef(!1);return ce.useEffect(()=>{if(o.current===!0||!(e.has("thread_id")||e.has("entity_type")||e.has("company_id")))return;const n=Pp(e);n!=null&&i(n);const s=new URLSearchParams(e);s.delete("thread_id"),s.delete("entity_type"),s.delete("company_id"),r(s,{replace:!0}),o.current=!0},[e,r]),a},Im={overlayWidth:new at(100,100,50)},{common:{strings:Ns}}=fr.getLocalizedStrings();function Cm(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=Ft(a);Fe.trackCockpitTabClicked(o),r.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(a,i)=>{e(wr({uiState:{filterText:i}}))},onFiltersChange:(a,i)=>{i.categories!=null&&i.categoryCombinationOperator!=null&&Fe.trackHealthMonitorFiltersApplied({filterSelection:{condition:i.categories.map(o=>o.matchingOperator).join(Ns.comma),logic:i.categoryCombinationOperator,parameter:i.categories.map(o=>o.field).join(Ns.comma)}}),e(wr({uiState:{filters:i}}))}}},healthPageActions:{onRowClick:a=>{e(Uf(a))},onColumnSortConfigChanged:(a,i)=>{e(wr({uiState:{sortKey:a,sortOrder:i}}))},onCockpitReloadData:a=>{a==="healthMonitor"&&e(Bf())},onFiltersChange:a=>{e(wr({uiState:{filters:a}}))}}}}function Pm(e,r){return{healthPageData:{healthView:r.healthView,managementView:r.managementView,mixpanelUrl:r.mixpanelHMUrl}}}const km=ze(Pm,Cm)(qp);function Fn({isDrawerOpen:e}){const r=Be(),a=We(),i=Bt(),o=lr(),{companyId:t}=ot(),[n,s]=fh(),[d,f]=ce.useState(!1),l=Ut(),h=St(),c=Se(w=>hd(w)),b=Se(w=>ur(w)),{additionalChurnFactors:m}=Se(w=>dd(w)),{selectedCompanyDetail:y,selectedCompanyId:g,localFormDataAndStatusByCompanyId:u}=c,_=Se(w=>w.companyViewState.zeniUsers.fetchState),E=Se(w=>w.companyHealthMetricConfigViewState);if(ce.useEffect(()=>{const w=x=>x==="Not-Started"||x==="Error";c.fetchState==="Completed"?a(It(!1)):w(c.fetchState)&&(a(Bf()),w(_)&&a(Ct()),w(E.fetchState)&&a(pd()))},[c.fetchState,E.fetchState]),ce.useEffect(()=>{t!=null&&c.fetchState==="Completed"&&n.has("utm_source")===!0&&(a(Uf(t)),y!=null&&(kp(),Fe.trackCockpitHealthMonitorNotificationAlertClicked({companyId:y.companyInfo.companyId,companyName:y.companyInfo.name,churnProbability:y.companyHealthMetric.churnProbabilityPercentage??null}),f(!0),n.delete("utm_source"),s(n)))},[c.fetchState,y?.companyInfo.companyId,y?.companyInfo.name]),He.getSignedInUser()==null)throw Error("Can't access Health Monitor page without signing in...");return V.jsxs(V.Fragment,{children:[e===!0||g!=null&&y!=null?V.jsx(hr,{anchor:"right",open:g!=null,PaperProps:{style:{width:Im.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a(_s()),children:V.jsx(jp,{roomId:`cockpit_${g}`,autoConnect:!0,children:V.jsx(Lp,{onSaveClick:()=>{g!=null&&a(gd(g))},onSaveChangesToLocalStore:w=>{c.selectedCompanyId!=null&&a(md({companyId:c.selectedCompanyId,updatedLocalData:w}))},localData:u?.companyHealthMetricLocalData??{netPromoterScore:void 0,externalProductServiceExposure:void 0,additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]}},companyHealthMetricViewSelector:c,onCloseDrawer:()=>a(_s()),analytics:Fe,urlSource:d,additionalChurnFactorsOptions:m})})}):null,V.jsx(km,{headerData:{allTabOptions:h,selectedTabOption:Et("healthMonitor")},initialOpenThreadRequest:l??void 0,healthView:c,managementView:b,navigate:r,mixpanelHMUrl:mn.mixpanelHMUrl})]})}function jm(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/companies/:companyId",element:V.jsx(Pe,{element:V.jsx(Fn,{isDrawerOpen:!0})})}),V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(Fn,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(Fn,{})})})]})}const Lm={drawerLeftMargin:new at(0,0,240)};function mr(e){const{isOpen:r,drawerLeftMargin:a,children:i,onClose:o}=e,t=lr(),n=a?.valuePx(t)??Lm.drawerLeftMargin.valuePx(t),s=Bt();return V.jsx(hr,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${n})`}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.8,cursor:"pointer"}}},onClose:o,children:i})}const qm=({fetchState:e})=>e==="In-Progress"||e==="Not-Started"?V.jsx(Nm,{children:V.jsx(gn,{size:"ExtraLarge",start:!0})}):null,Nm=tt.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
@@ -20,7 +20,7 @@ import{Rk as Df,Rl as Mf,ls as It,f0 as ys,Rm as Nt,f9 as nn,e_ as Ff,Rn as Jt,f
|
|
|
20
20
|
display: flex;
|
|
21
21
|
min-height: 100%;
|
|
22
22
|
flex-direction: column;
|
|
23
|
-
`;function zm(){const e=We(),r=Be(),{companyId:a,reportDate:i}=ot(),o=Se(d=>ur(d).fetchState);if(a==null||i==null)throw Error("Can't access historic Email without company id and reportDate...");const t=Se(d=>Id(d,a,an(i))),n=ce.useCallback(d=>{r(`../../management/month-end-report-history/company/${a}/${d.format(fr.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`),e(ws(a,d))},[a]),s=ce.useCallback(()=>{o==="Completed"&&t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&(e(Cd(a)),e(ws(a,an(i))))},[a,o,i,t.fetchState]);return ce.useEffect(()=>{e(zf(!1))},[]),ce.useEffect(()=>{s()},[s]),V.jsx(Fp,{monthEndReportHistoricData:t,reportSentDate:an(i),onDateChange:n,onNavigateBack:()=>r("../../"),onRefresh:s})}function Gm({isOpen:e,emailHistoryMode:r,onClose:a}){return r?V.jsx(mr,{drawerLeftMargin:new at(Cn[0],Cn[0],Cn[0]),isOpen:e,onClose:a,children:V.jsx(zm,{})}):V.jsx(Bp,{isOpen:e,children:V.jsx(Vm,{onClose:a})})}const{common:{strings:Bn},dateFormat:Hm}=fr.getLocalizedStrings();function Zm(e,r){const{loggedInUserRole:a,loggedInUser:i,navigate:o}=r;return{headerActions:{onTabChange:t=>{const n=Pt(t),s=Bt(t);Fe.trackCockpitTabClicked(s),o(`../../${n}`,{replace:!0})},filterActions:{onFilterTextChanged:(t,n)=>{e(pt({filterText:n}))},onFiltersChange:(t,n)=>{e(pt({filters:n}))}}},managementPageActions:{onColumnSortConfigChanged:(t,n)=>{e(pt({sortKey:t,sortOrder:n}))},changeHandlers:(t,n)=>{const s=Jm(n);Object.keys(s).length>0&&e(zo(t,s))},onProductVerticalsChanged:(t,n)=>{e(Zf(t,n))},onRealmIdReset:t=>{e(un(t))},onRealmIdUpdate:(t,n)=>{e(un(t,n))},onScroll:t=>{e(pt({scrollYOffset:t}))},onViewDetailsLinkClicked:t=>{t!=null?o(`/management/parent/${encodeURIComponent(t)}`):console.warn("Parent company ID is missing.")},onCompanyNameClicked:t=>window.open(`/${t.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:t=>window.open(`/${t.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onMonthEndReportPageClick:t=>{o(`/management/month-end-report/company/${t.company.company.companyInfo.companyId}`)},onTaskIconClicked:t=>{const n=t.controllers.map(s=>s.user.email);t.company.company.companyInfo.tenantId!=null&&i.userEmail!=null&&Fe.trackCockpitTaskCardClicked({tenantName:t.company.company.companyInfo.name,tenantId:t.company.company.companyInfo.tenantId,user:{name:i.firstName!=null?i.firstName.concat(Bn.space,i.lastName??Bn.empty).trim():i.lastName??Bn.empty,email:i.userEmail,role:a?.userRoles??[]},controllerEmails:n}),window.open(`/${t.company.company.companyInfo.primaryEmailDomain}/tasks`)},onFiltersChange:(t,n)=>{e(pt({filters:n}))},onCockpitReloadData:t=>{t==="management"&&e(pn())},showMonthEndReportHistoricData:(t,n)=>{o(`/management/month-end-report-history/company/${t}/${n.startOf("month").format(Hm.analytics.YYYYDashMMDashDDFormat)}`)}}}}function Wm(e,r){const a={};for(const i of r.managementView.companies){const{companyId:o}=i.company.company.companyInfo;a[o]=Hf(e,o).fetchState}return{managementPageData:{loggedInUser:r.loggedInUser,loggedInUserRole:r.loggedInUserRole,managementView:r.managementView,realmIdUpdateStatusByCompanyId:a}}}const Ym=ze(Wm,Zm)(oh);function Er({isMonthEndEmailDrawerOpen:e=!1,emailHistoryMode:r=!1}){const a=Be(),i=We(),o=Ut(),{useDynamicConfig:t}=wt(),{configValue:n}=t(xt.monthEndInsightsEnablement),{configValue:s}=t(xt.expenseAutomationEnablement),d=St(),f=ce.useMemo(()=>({allTabOptions:d,selectedTabOption:Et("management")}),[d]),l=He.getSignedInUser();if(l==null)throw Error("Can't access Management page without signing in...");const h=Se(y=>ur(y)),c=Se(y=>Gf(y.userRoleState,l.userId)),b=Se(y=>y.companyViewState.zeniUsers.fetchState);ce.useEffect(()=>{h.fetchState==="Completed"?i(It(!1)):(h.fetchState==="Not-Started"||h.fetchState==="Error")&&(i(pn()),(b==="Not-Started"||b==="Error")&&i(Ct()))},[h.fetchState]);const m=()=>{a(-1)};return V.jsxs(V.Fragment,{children:[e===!0?V.jsx(Gm,{isOpen:e===!0,emailHistoryMode:r===!0,onClose:m}):null,V.jsx(Ym,{headerData:f,initialOpenThreadRequest:o??void 0,loggedInUser:l,loggedInUserRole:c,managementView:h,navigate:a,companiesExcludedFromMonthEndReport:n.companiesExcludedFromMonthEndReport!=null?n.companiesExcludedFromMonthEndReport:[],expenseAutomationEnabledCompanies:s.expenseAutomationEnabledCompanies!=null&&Array.isArray(s.expenseAutomationEnabledCompanies)?s.expenseAutomationEnabledCompanies:[]})]})}const Jm=e=>{const{status:r,group:a,taxStatus:i,reportSent:o,users:t,customerSatisfaction:n}=e;return r?{statusCode:r?.selectedValue?.code}:a?{companyGroupId:a?.selectedValue?.id}:i?{taxStatusCode:i?.selectedValue?.code}:o?{lastReportSentDate:o?.date,lastReportSentBusinessDay:o?.businessDay}:t?{users:t}:n?{customerSatisfaction:n}:{}};function Km(e,r){return{onGoBack:()=>{r.navigate(-1)},onGoHome:()=>{r.navigate("/")}}}const Xm=ze(null,Km)(Up);function es(){const e=Be();return V.jsx(Xm,{navigate:e})}const Qm=Object.freeze(Object.defineProperty({__proto__:null,default:es},Symbol.toStringTag,{value:"Module"})),{dateFormat:eg}=fr.getLocalizedStrings();function tg(e,r){const{navigate:a}=r;return{headerActions:{onNavigateBack:()=>{r.navigate("../")},filterActions:{onFilterTextChanged:(i,o)=>{i==="management"&&e(pt({filterText:o}))},onFiltersChange:(i,o)=>{i==="management"&&e(pt({filters:o}))}}},managementPageActions:{onColumnSortConfigChanged:(i,o)=>{e(pt({sortKey:i,sortOrder:o}))},changeHandlers:(i,o)=>{const t=ag(o);Object.keys(t).length>0&&e(zo(i,t))},onProductVerticalsChanged:(i,o)=>{e(Zf(i,o))},onRealmIdReset:i=>{e(un(i))},onRealmIdUpdate:(i,o)=>{e(un(i,o))},onScroll:i=>{e(pt({scrollYOffset:i}))},onCompanyNameClicked:i=>window.open(`/${i.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:i=>window.open(`/${i.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onFiltersChange:(i,o)=>{i==="management"&&e(pt({filters:o}))},onMonthEndReportPageClick:i=>{a(`/management/month-end-report/company/${i.company.company.companyInfo.companyId}`)},onCockpitReloadData:i=>{i==="management"&&e(pn())},showMonthEndReportHistoricData:(i,o)=>{a(`/management/month-end-report-history/company/${i}/${o.startOf("month").format(eg.analytics.YYYYDashMMDashDDFormat)}`)}}}}function rg(e,r){const a={};for(const i of r.managementView.companies){const{companyId:o}=i.company.company.companyInfo;a[o]=Hf(e,o).fetchState}return{managementPageData:{loggedInUser:r.loggedInUser,loggedInUserRole:r.loggedInUserRole,showDetailsPageLink:!1,realmIdUpdateStatusByCompanyId:a,managementView:{...r.managementView,uiState:{...r.managementView.uiState,scrollYOffset:0}}}}}const ng=ze(rg,tg)(oh);function ig(){const e=Be(),[r,a]=ce.useState(!1),i=We(),{parentId:o}=ot(),{useDynamicConfig:t}=wt(),{configValue:n}=t(xt.monthEndInsightsEnablement),{configValue:s}=t(xt.expenseAutomationEnablement),d=St(),f=o!=null?Se(b=>Pd(b,o)):void 0;ce.useEffect(()=>{r===!1&&o!=null&&(a(!0),i(kd(!1,o)))},[r]);const l=He.getSignedInUser();if(l==null)throw Error("Can't access Management Parent Subsidiary page without signing in...");const h=Se(b=>Gf(b.userRoleState,l.userId)),c=ce.useMemo(()=>({allTabOptions:d,selectedTabOption:Et("management"),showBackButton:!0}),[d]);return o==null?V.jsx(es,{}):f!=null?V.jsx(ng,{headerData:c,loggedInUser:l,loggedInUserRole:h,managementView:f,navigate:e,companiesExcludedFromMonthEndReport:n.companiesExcludedFromMonthEndReport!=null?n.companiesExcludedFromMonthEndReport:[],expenseAutomationEnabledCompanies:s.expenseAutomationEnabledCompanies!=null&&Array.isArray(s.expenseAutomationEnabledCompanies)?s.expenseAutomationEnabledCompanies:[]}):null}const ag=e=>{const{status:r,group:a,taxStatus:i,reportSent:o,users:t,customerSatisfaction:n}=e;return r?{statusCode:r?.selectedValue?.code}:a?{companyGroupId:a?.selectedValue?.id}:i?{taxStatusCode:i?.selectedValue?.code}:o?{lastReportSentDate:o?.date,lastReportSentBusinessDay:o?.businessDay}:t?{users:t}:n?{customerSatisfaction:n}:{}};function og(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(Er,{})})}),V.jsx(Te,{path:"/parent/:parentId",element:V.jsx(Pe,{element:V.jsx(ig,{})})}),V.jsx(Te,{path:"/month-end-report/company/:companyId",element:V.jsx(Pe,{element:V.jsx(Er,{isMonthEndEmailDrawerOpen:!0})})}),V.jsx(Te,{path:"/month-end-report-history/company/:companyId/:reportDate",element:V.jsx(Pe,{element:V.jsx(Er,{emailHistoryMode:!0,isMonthEndEmailDrawerOpen:!0})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(Er,{})})})]})}var Un={exports:{}},Ds;function sg(){return Ds||(Ds=1,(function(e){(function(r){function a(o){return typeof o=="function"?o:typeof et=="function"?function(n){return new et(n,"base64").toString("binary")}:typeof r.base64js=="object"?function(n){var s=r.base64js.b64ToByteArray(n);return Array.prototype.map.call(s,function(d){return String.fromCharCode(d)}).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")}}var i=a(r.atob);r.atob=i,e&&e.exports&&(e.exports=i)})(window)})(Un)),Un.exports}var Sr={exports:{}},Vn={exports:{}},$n={},Ms;function gh(){if(Ms)return $n;Ms=1;function e(_){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},e(_)}function r(_,E,v){return Object.defineProperty(_,"prototype",{writable:!1}),_}function a(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function i(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),Object.defineProperty(_,"prototype",{writable:!1}),E&&o(_,E)}function o(_,E){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,x){return w.__proto__=x,w},o(_,E)}function t(_){var E=d();return function(){var w=f(_),x;if(E){var O=f(this).constructor;x=Reflect.construct(w,arguments,O)}else x=w.apply(this,arguments);return n(this,x)}}function n(_,E){if(E&&(e(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(_)}function s(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function d(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function f(_){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(v){return v.__proto__||Object.getPrototypeOf(v)},f(_)}var l={},h,c;function b(_,E,v){v||(v=Error);function w(O,C,D){return typeof E=="string"?E:E(O,C,D)}var x=(function(O){i(D,O);var C=t(D);function D(Y,F,S){var R;return a(this,D),R=C.call(this,w(Y,F,S)),R.code=_,R}return r(D)})(v);l[_]=x}function m(_,E){if(Array.isArray(_)){var v=_.length;return _=_.map(function(w){return String(w)}),v>2?"one of ".concat(E," ").concat(_.slice(0,v-1).join(", "),", or ")+_[v-1]:v===2?"one of ".concat(E," ").concat(_[0]," or ").concat(_[1]):"of ".concat(E," ").concat(_[0])}else return"of ".concat(E," ").concat(String(_))}function y(_,E,v){return _.substr(0,E.length)===E}function g(_,E,v){return(v===void 0||v>_.length)&&(v=_.length),_.substring(v-E.length,v)===E}function u(_,E,v){return typeof v!="number"&&(v=0),v+E.length>_.length?!1:_.indexOf(E,v)!==-1}return b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",function(_,E,v){h===void 0&&(h=sr()),h(typeof _=="string","'name' must be a string");var w;typeof E=="string"&&y(E,"not ")?(w="must not be",E=E.replace(/^not /,"")):w="must be";var x;if(g(_," argument"))x="The ".concat(_," ").concat(w," ").concat(m(E,"type"));else{var O=u(_,".")?"property":"argument";x='The "'.concat(_,'" ').concat(O," ").concat(w," ").concat(m(E,"type"))}return x+=". Received type ".concat(e(v)),x},TypeError),b("ERR_INVALID_ARG_VALUE",function(_,E){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";c===void 0&&(c=Ze());var w=c.inspect(E);return w.length>128&&(w="".concat(w.slice(0,128),"...")),"The argument '".concat(_,"' ").concat(v,". Received ").concat(w)},TypeError),b("ERR_INVALID_RETURN_VALUE",function(_,E,v){var w;return v&&v.constructor&&v.constructor.name?w="instance of ".concat(v.constructor.name):w="type ".concat(e(v)),"Expected ".concat(_,' to be returned from the "').concat(E,'"')+" function but got ".concat(w,".")},TypeError),b("ERR_MISSING_ARGS",function(){for(var _=arguments.length,E=new Array(_),v=0;v<_;v++)E[v]=arguments[v];h===void 0&&(h=sr()),h(E.length>0,"At least one arg needs to be specified");var w="The ",x=E.length;switch(E=E.map(function(O){return'"'.concat(O,'"')}),x){case 1:w+="".concat(E[0]," argument");break;case 2:w+="".concat(E[0]," and ").concat(E[1]," arguments");break;default:w+=E.slice(0,x-1).join(", "),w+=", and ".concat(E[x-1]," arguments");break}return"".concat(w," must be specified")},TypeError),$n.codes=l,$n}var zn,Fs;function ug(){if(Fs)return zn;Fs=1;function e(k,U){var W=Object.keys(k);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(k);U&&(H=H.filter(function(M){return Object.getOwnPropertyDescriptor(k,M).enumerable})),W.push.apply(W,H)}return W}function r(k){for(var U=1;U<arguments.length;U++){var W=arguments[U]!=null?arguments[U]:{};U%2?e(Object(W),!0).forEach(function(H){a(k,H,W[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(W)):e(Object(W)).forEach(function(H){Object.defineProperty(k,H,Object.getOwnPropertyDescriptor(W,H))})}return k}function a(k,U,W){return U=n(U),U in k?Object.defineProperty(k,U,{value:W,enumerable:!0,configurable:!0,writable:!0}):k[U]=W,k}function i(k,U){if(!(k instanceof U))throw new TypeError("Cannot call a class as a function")}function o(k,U){for(var W=0;W<U.length;W++){var H=U[W];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(k,n(H.key),H)}}function t(k,U,W){return U&&o(k.prototype,U),Object.defineProperty(k,"prototype",{writable:!1}),k}function n(k){var U=s(k,"string");return _(U)==="symbol"?U:String(U)}function s(k,U){if(_(k)!=="object"||k===null)return k;var W=k[Symbol.toPrimitive];if(W!==void 0){var H=W.call(k,U);if(_(H)!=="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(k)}function d(k,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(U&&U.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),U&&g(k,U)}function f(k){var U=m();return function(){var H=u(k),M;if(U){var N=u(this).constructor;M=Reflect.construct(H,arguments,N)}else M=H.apply(this,arguments);return l(this,M)}}function l(k,U){if(U&&(_(U)==="object"||typeof U=="function"))return U;if(U!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(k)}function h(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function c(k){var U=typeof Map=="function"?new Map:void 0;return c=function(H){if(H===null||!y(H))return H;if(typeof H!="function")throw new TypeError("Super expression must either be null or a function");if(typeof U<"u"){if(U.has(H))return U.get(H);U.set(H,M)}function M(){return b(H,arguments,u(this).constructor)}return M.prototype=Object.create(H.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),g(M,H)},c(k)}function b(k,U,W){return m()?b=Reflect.construct.bind():b=function(M,N,B){var $=[null];$.push.apply($,N);var K=Function.bind.apply(M,$),X=new K;return B&&g(X,B.prototype),X},b.apply(null,arguments)}function m(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y(k){return Function.toString.call(k).indexOf("[native code]")!==-1}function g(k,U){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(H,M){return H.__proto__=M,H},g(k,U)}function u(k){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(W){return W.__proto__||Object.getPrototypeOf(W)},u(k)}function _(k){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},_(k)}var E=Ze(),v=E.inspect,w=gh(),x=w.codes.ERR_INVALID_ARG_TYPE;function O(k,U,W){return(W===void 0||W>k.length)&&(W=k.length),k.substring(W-U.length,W)===U}function C(k,U){if(U=Math.floor(U),k.length==0||U==0)return"";var W=k.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)k+=k,U--;return k+=k.substring(0,W-k.length),k}var D="",Y="",F="",S="",R={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},L=10;function q(k){var U=Object.keys(k),W=Object.create(Object.getPrototypeOf(k));return U.forEach(function(H){W[H]=k[H]}),Object.defineProperty(W,"message",{value:k.message}),W}function z(k){return v(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function P(k,U,W){var H="",M="",N=0,B="",$=!1,K=z(k),X=K.split(`
|
|
23
|
+
`;function zm(){const e=We(),r=Be(),{companyId:a,reportDate:i}=ot(),o=Se(d=>ur(d).fetchState);if(a==null||i==null)throw Error("Can't access historic Email without company id and reportDate...");const t=Se(d=>Id(d,a,an(i))),n=ce.useCallback(d=>{r(`../../management/month-end-report-history/company/${a}/${d.format(fr.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`),e(ws(a,d))},[a]),s=ce.useCallback(()=>{o==="Completed"&&t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&(e(Cd(a)),e(ws(a,an(i))))},[a,o,i,t.fetchState]);return ce.useEffect(()=>{e(zf(!1))},[]),ce.useEffect(()=>{s()},[s]),V.jsx(Fp,{monthEndReportHistoricData:t,reportSentDate:an(i),onDateChange:n,onNavigateBack:()=>r("../../"),onRefresh:s})}function Gm({isOpen:e,emailHistoryMode:r,onClose:a}){return r?V.jsx(mr,{drawerLeftMargin:new at(Cn[0],Cn[0],Cn[0]),isOpen:e,onClose:a,children:V.jsx(zm,{})}):V.jsx(Bp,{isOpen:e,children:V.jsx(Vm,{onClose:a})})}const{common:{strings:Bn},dateFormat:Hm}=fr.getLocalizedStrings();function Zm(e,r){const{loggedInUserRole:a,loggedInUser:i,navigate:o}=r;return{headerActions:{onTabChange:t=>{const n=Pt(t),s=Ft(t);Fe.trackCockpitTabClicked(s),o(`../../${n}`,{replace:!0})},filterActions:{onFilterTextChanged:(t,n)=>{e(pt({filterText:n}))},onFiltersChange:(t,n)=>{e(pt({filters:n}))}}},managementPageActions:{onColumnSortConfigChanged:(t,n)=>{e(pt({sortKey:t,sortOrder:n}))},changeHandlers:(t,n)=>{const s=Jm(n);Object.keys(s).length>0&&e(zo(t,s))},onProductVerticalsChanged:(t,n)=>{e(Zf(t,n))},onRealmIdReset:t=>{e(un(t))},onRealmIdUpdate:(t,n)=>{e(un(t,n))},onScroll:t=>{e(pt({scrollYOffset:t}))},onViewDetailsLinkClicked:t=>{t!=null?o(`/management/parent/${encodeURIComponent(t)}`):console.warn("Parent company ID is missing.")},onCompanyNameClicked:t=>window.open(`/${t.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:t=>window.open(`/${t.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onMonthEndReportPageClick:t=>{o(`/management/month-end-report/company/${t.company.company.companyInfo.companyId}`)},onTaskIconClicked:t=>{const n=t.controllers.map(s=>s.user.email);t.company.company.companyInfo.tenantId!=null&&i.userEmail!=null&&Fe.trackCockpitTaskCardClicked({tenantName:t.company.company.companyInfo.name,tenantId:t.company.company.companyInfo.tenantId,user:{name:i.firstName!=null?i.firstName.concat(Bn.space,i.lastName??Bn.empty).trim():i.lastName??Bn.empty,email:i.userEmail,role:a?.userRoles??[]},controllerEmails:n}),window.open(`/${t.company.company.companyInfo.primaryEmailDomain}/tasks`)},onFiltersChange:(t,n)=>{e(pt({filters:n}))},onCockpitReloadData:t=>{t==="management"&&e(pn())},showMonthEndReportHistoricData:(t,n)=>{o(`/management/month-end-report-history/company/${t}/${n.startOf("month").format(Hm.analytics.YYYYDashMMDashDDFormat)}`)}}}}function Wm(e,r){const a={};for(const i of r.managementView.companies){const{companyId:o}=i.company.company.companyInfo;a[o]=Hf(e,o).fetchState}return{managementPageData:{loggedInUser:r.loggedInUser,loggedInUserRole:r.loggedInUserRole,managementView:r.managementView,realmIdUpdateStatusByCompanyId:a}}}const Ym=ze(Wm,Zm)(oh);function Er({isMonthEndEmailDrawerOpen:e=!1,emailHistoryMode:r=!1}){const a=Be(),i=We(),o=Ut(),{useDynamicConfig:t}=wt(),{configValue:n}=t(xt.monthEndInsightsEnablement),{configValue:s}=t(xt.expenseAutomationEnablement),d=St(),f=ce.useMemo(()=>({allTabOptions:d,selectedTabOption:Et("management")}),[d]),l=He.getSignedInUser();if(l==null)throw Error("Can't access Management page without signing in...");const h=Se(y=>ur(y)),c=Se(y=>Gf(y.userRoleState,l.userId)),b=Se(y=>y.companyViewState.zeniUsers.fetchState);ce.useEffect(()=>{h.fetchState==="Completed"?i(It(!1)):(h.fetchState==="Not-Started"||h.fetchState==="Error")&&(i(pn()),(b==="Not-Started"||b==="Error")&&i(Ct()))},[h.fetchState]);const m=()=>{a(-1)};return V.jsxs(V.Fragment,{children:[e===!0?V.jsx(Gm,{isOpen:e===!0,emailHistoryMode:r===!0,onClose:m}):null,V.jsx(Ym,{headerData:f,initialOpenThreadRequest:o??void 0,loggedInUser:l,loggedInUserRole:c,managementView:h,navigate:a,companiesExcludedFromMonthEndReport:n.companiesExcludedFromMonthEndReport!=null?n.companiesExcludedFromMonthEndReport:[],expenseAutomationEnabledCompanies:s.expenseAutomationEnabledCompanies!=null&&Array.isArray(s.expenseAutomationEnabledCompanies)?s.expenseAutomationEnabledCompanies:[]})]})}const Jm=e=>{const{status:r,group:a,taxStatus:i,reportSent:o,users:t,customerSatisfaction:n}=e;return r?{statusCode:r?.selectedValue?.code}:a?{companyGroupId:a?.selectedValue?.id}:i?{taxStatusCode:i?.selectedValue?.code}:o?{lastReportSentDate:o?.date,lastReportSentBusinessDay:o?.businessDay}:t?{users:t}:n?{customerSatisfaction:n}:{}};function Km(e,r){return{onGoBack:()=>{r.navigate(-1)},onGoHome:()=>{r.navigate("/")}}}const Xm=ze(null,Km)(Up);function es(){const e=Be();return V.jsx(Xm,{navigate:e})}const Qm=Object.freeze(Object.defineProperty({__proto__:null,default:es},Symbol.toStringTag,{value:"Module"})),{dateFormat:eg}=fr.getLocalizedStrings();function tg(e,r){const{navigate:a}=r;return{headerActions:{onNavigateBack:()=>{r.navigate("../")},filterActions:{onFilterTextChanged:(i,o)=>{i==="management"&&e(pt({filterText:o}))},onFiltersChange:(i,o)=>{i==="management"&&e(pt({filters:o}))}}},managementPageActions:{onColumnSortConfigChanged:(i,o)=>{e(pt({sortKey:i,sortOrder:o}))},changeHandlers:(i,o)=>{const t=ag(o);Object.keys(t).length>0&&e(zo(i,t))},onProductVerticalsChanged:(i,o)=>{e(Zf(i,o))},onRealmIdReset:i=>{e(un(i))},onRealmIdUpdate:(i,o)=>{e(un(i,o))},onScroll:i=>{e(pt({scrollYOffset:i}))},onCompanyNameClicked:i=>window.open(`/${i.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:i=>window.open(`/${i.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onFiltersChange:(i,o)=>{i==="management"&&e(pt({filters:o}))},onMonthEndReportPageClick:i=>{a(`/management/month-end-report/company/${i.company.company.companyInfo.companyId}`)},onCockpitReloadData:i=>{i==="management"&&e(pn())},showMonthEndReportHistoricData:(i,o)=>{a(`/management/month-end-report-history/company/${i}/${o.startOf("month").format(eg.analytics.YYYYDashMMDashDDFormat)}`)}}}}function rg(e,r){const a={};for(const i of r.managementView.companies){const{companyId:o}=i.company.company.companyInfo;a[o]=Hf(e,o).fetchState}return{managementPageData:{loggedInUser:r.loggedInUser,loggedInUserRole:r.loggedInUserRole,showDetailsPageLink:!1,realmIdUpdateStatusByCompanyId:a,managementView:{...r.managementView,uiState:{...r.managementView.uiState,scrollYOffset:0}}}}}const ng=ze(rg,tg)(oh);function ig(){const e=Be(),[r,a]=ce.useState(!1),i=We(),{parentId:o}=ot(),{useDynamicConfig:t}=wt(),{configValue:n}=t(xt.monthEndInsightsEnablement),{configValue:s}=t(xt.expenseAutomationEnablement),d=St(),f=o!=null?Se(b=>Pd(b,o)):void 0;ce.useEffect(()=>{r===!1&&o!=null&&(a(!0),i(kd(!1,o)))},[r]);const l=He.getSignedInUser();if(l==null)throw Error("Can't access Management Parent Subsidiary page without signing in...");const h=Se(b=>Gf(b.userRoleState,l.userId)),c=ce.useMemo(()=>({allTabOptions:d,selectedTabOption:Et("management"),showBackButton:!0}),[d]);return o==null?V.jsx(es,{}):f!=null?V.jsx(ng,{headerData:c,loggedInUser:l,loggedInUserRole:h,managementView:f,navigate:e,companiesExcludedFromMonthEndReport:n.companiesExcludedFromMonthEndReport!=null?n.companiesExcludedFromMonthEndReport:[],expenseAutomationEnabledCompanies:s.expenseAutomationEnabledCompanies!=null&&Array.isArray(s.expenseAutomationEnabledCompanies)?s.expenseAutomationEnabledCompanies:[]}):null}const ag=e=>{const{status:r,group:a,taxStatus:i,reportSent:o,users:t,customerSatisfaction:n}=e;return r?{statusCode:r?.selectedValue?.code}:a?{companyGroupId:a?.selectedValue?.id}:i?{taxStatusCode:i?.selectedValue?.code}:o?{lastReportSentDate:o?.date,lastReportSentBusinessDay:o?.businessDay}:t?{users:t}:n?{customerSatisfaction:n}:{}};function og(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(Er,{})})}),V.jsx(Te,{path:"/parent/:parentId",element:V.jsx(Pe,{element:V.jsx(ig,{})})}),V.jsx(Te,{path:"/month-end-report/company/:companyId",element:V.jsx(Pe,{element:V.jsx(Er,{isMonthEndEmailDrawerOpen:!0})})}),V.jsx(Te,{path:"/month-end-report-history/company/:companyId/:reportDate",element:V.jsx(Pe,{element:V.jsx(Er,{emailHistoryMode:!0,isMonthEndEmailDrawerOpen:!0})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(Er,{})})})]})}var Un={exports:{}},Ds;function sg(){return Ds||(Ds=1,(function(e){(function(r){function a(o){return typeof o=="function"?o:typeof et=="function"?function(n){return new et(n,"base64").toString("binary")}:typeof r.base64js=="object"?function(n){var s=r.base64js.b64ToByteArray(n);return Array.prototype.map.call(s,function(d){return String.fromCharCode(d)}).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")}}var i=a(r.atob);r.atob=i,e&&e.exports&&(e.exports=i)})(window)})(Un)),Un.exports}var Sr={exports:{}},Vn={exports:{}},$n={},Ms;function gh(){if(Ms)return $n;Ms=1;function e(_){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},e(_)}function r(_,E,v){return Object.defineProperty(_,"prototype",{writable:!1}),_}function a(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function i(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),Object.defineProperty(_,"prototype",{writable:!1}),E&&o(_,E)}function o(_,E){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,x){return w.__proto__=x,w},o(_,E)}function t(_){var E=d();return function(){var w=f(_),x;if(E){var O=f(this).constructor;x=Reflect.construct(w,arguments,O)}else x=w.apply(this,arguments);return n(this,x)}}function n(_,E){if(E&&(e(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(_)}function s(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function d(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function f(_){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(v){return v.__proto__||Object.getPrototypeOf(v)},f(_)}var l={},h,c;function b(_,E,v){v||(v=Error);function w(O,C,D){return typeof E=="string"?E:E(O,C,D)}var x=(function(O){i(D,O);var C=t(D);function D(Y,F,S){var R;return a(this,D),R=C.call(this,w(Y,F,S)),R.code=_,R}return r(D)})(v);l[_]=x}function m(_,E){if(Array.isArray(_)){var v=_.length;return _=_.map(function(w){return String(w)}),v>2?"one of ".concat(E," ").concat(_.slice(0,v-1).join(", "),", or ")+_[v-1]:v===2?"one of ".concat(E," ").concat(_[0]," or ").concat(_[1]):"of ".concat(E," ").concat(_[0])}else return"of ".concat(E," ").concat(String(_))}function y(_,E,v){return _.substr(0,E.length)===E}function g(_,E,v){return(v===void 0||v>_.length)&&(v=_.length),_.substring(v-E.length,v)===E}function u(_,E,v){return typeof v!="number"&&(v=0),v+E.length>_.length?!1:_.indexOf(E,v)!==-1}return b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",function(_,E,v){h===void 0&&(h=sr()),h(typeof _=="string","'name' must be a string");var w;typeof E=="string"&&y(E,"not ")?(w="must not be",E=E.replace(/^not /,"")):w="must be";var x;if(g(_," argument"))x="The ".concat(_," ").concat(w," ").concat(m(E,"type"));else{var O=u(_,".")?"property":"argument";x='The "'.concat(_,'" ').concat(O," ").concat(w," ").concat(m(E,"type"))}return x+=". Received type ".concat(e(v)),x},TypeError),b("ERR_INVALID_ARG_VALUE",function(_,E){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";c===void 0&&(c=Ze());var w=c.inspect(E);return w.length>128&&(w="".concat(w.slice(0,128),"...")),"The argument '".concat(_,"' ").concat(v,". Received ").concat(w)},TypeError),b("ERR_INVALID_RETURN_VALUE",function(_,E,v){var w;return v&&v.constructor&&v.constructor.name?w="instance of ".concat(v.constructor.name):w="type ".concat(e(v)),"Expected ".concat(_,' to be returned from the "').concat(E,'"')+" function but got ".concat(w,".")},TypeError),b("ERR_MISSING_ARGS",function(){for(var _=arguments.length,E=new Array(_),v=0;v<_;v++)E[v]=arguments[v];h===void 0&&(h=sr()),h(E.length>0,"At least one arg needs to be specified");var w="The ",x=E.length;switch(E=E.map(function(O){return'"'.concat(O,'"')}),x){case 1:w+="".concat(E[0]," argument");break;case 2:w+="".concat(E[0]," and ").concat(E[1]," arguments");break;default:w+=E.slice(0,x-1).join(", "),w+=", and ".concat(E[x-1]," arguments");break}return"".concat(w," must be specified")},TypeError),$n.codes=l,$n}var zn,Fs;function ug(){if(Fs)return zn;Fs=1;function e(k,U){var W=Object.keys(k);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(k);U&&(H=H.filter(function(M){return Object.getOwnPropertyDescriptor(k,M).enumerable})),W.push.apply(W,H)}return W}function r(k){for(var U=1;U<arguments.length;U++){var W=arguments[U]!=null?arguments[U]:{};U%2?e(Object(W),!0).forEach(function(H){a(k,H,W[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(W)):e(Object(W)).forEach(function(H){Object.defineProperty(k,H,Object.getOwnPropertyDescriptor(W,H))})}return k}function a(k,U,W){return U=n(U),U in k?Object.defineProperty(k,U,{value:W,enumerable:!0,configurable:!0,writable:!0}):k[U]=W,k}function i(k,U){if(!(k instanceof U))throw new TypeError("Cannot call a class as a function")}function o(k,U){for(var W=0;W<U.length;W++){var H=U[W];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(k,n(H.key),H)}}function t(k,U,W){return U&&o(k.prototype,U),Object.defineProperty(k,"prototype",{writable:!1}),k}function n(k){var U=s(k,"string");return _(U)==="symbol"?U:String(U)}function s(k,U){if(_(k)!=="object"||k===null)return k;var W=k[Symbol.toPrimitive];if(W!==void 0){var H=W.call(k,U);if(_(H)!=="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(k)}function d(k,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(U&&U.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),U&&g(k,U)}function f(k){var U=m();return function(){var H=u(k),M;if(U){var N=u(this).constructor;M=Reflect.construct(H,arguments,N)}else M=H.apply(this,arguments);return l(this,M)}}function l(k,U){if(U&&(_(U)==="object"||typeof U=="function"))return U;if(U!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(k)}function h(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function c(k){var U=typeof Map=="function"?new Map:void 0;return c=function(H){if(H===null||!y(H))return H;if(typeof H!="function")throw new TypeError("Super expression must either be null or a function");if(typeof U<"u"){if(U.has(H))return U.get(H);U.set(H,M)}function M(){return b(H,arguments,u(this).constructor)}return M.prototype=Object.create(H.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),g(M,H)},c(k)}function b(k,U,W){return m()?b=Reflect.construct.bind():b=function(M,N,B){var $=[null];$.push.apply($,N);var K=Function.bind.apply(M,$),X=new K;return B&&g(X,B.prototype),X},b.apply(null,arguments)}function m(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y(k){return Function.toString.call(k).indexOf("[native code]")!==-1}function g(k,U){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(H,M){return H.__proto__=M,H},g(k,U)}function u(k){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(W){return W.__proto__||Object.getPrototypeOf(W)},u(k)}function _(k){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},_(k)}var E=Ze(),v=E.inspect,w=gh(),x=w.codes.ERR_INVALID_ARG_TYPE;function O(k,U,W){return(W===void 0||W>k.length)&&(W=k.length),k.substring(W-U.length,W)===U}function C(k,U){if(U=Math.floor(U),k.length==0||U==0)return"";var W=k.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)k+=k,U--;return k+=k.substring(0,W-k.length),k}var D="",Y="",F="",S="",R={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},L=10;function q(k){var U=Object.keys(k),W=Object.create(Object.getPrototypeOf(k));return U.forEach(function(H){W[H]=k[H]}),Object.defineProperty(W,"message",{value:k.message}),W}function z(k){return v(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function P(k,U,W){var H="",M="",N=0,B="",$=!1,K=z(k),X=K.split(`
|
|
24
24
|
`),ae=z(U).split(`
|
|
25
25
|
`),ue=0,ve="";if(W==="strictEqual"&&_(k)==="object"&&_(U)==="object"&&k!==null&&U!==null&&(W="strictEqualObject"),X.length===1&&ae.length===1&&X[0]!==ae[0]){var me=X[0].length+ae[0].length;if(me<=L){if((_(k)!=="object"||k===null)&&(_(U)!=="object"||U===null)&&(k!==0||U!==0))return"".concat(R[W],`
|
|
26
26
|
|
|
@@ -129,7 +129,7 @@ Found: ${a.toString().split(`
|
|
|
129
129
|
align-items: center;
|
|
130
130
|
background-color: ${e=>e.theme.colors.grey5};
|
|
131
131
|
box-shadow: ${e=>`0px 2px 4px ${e.theme.colors.dropShadowNormal}`};
|
|
132
|
-
`;function e_(e,r){const{address:a,showNavbarWithClose:i,sectionStyles:o,navbarStyles:t}=r;return{showNavbarWithClose:i,addressToEdit:a?.addressToCreate,loadingState:a?.status.fetchState,googleAPIKey:mn.googleMapsAPIKey,sectionStyles:o,navbarStyles:t}}function t_(e,r){return{onSubmitHandler:a=>{const i=i_(a);e(Ld({addressType:"company_address",addressToCreate:i})),r.closeDrawerHandler?.()},onCancel:()=>{r.closeDrawerHandler?.()}}}const r_=ze(e_,t_)(Vp);function n_({closeDrawerHandler:e}){const r=
|
|
132
|
+
`;function e_(e,r){const{address:a,showNavbarWithClose:i,sectionStyles:o,navbarStyles:t}=r;return{showNavbarWithClose:i,addressToEdit:a?.addressToCreate,loadingState:a?.status.fetchState,googleAPIKey:mn.googleMapsAPIKey,sectionStyles:o,navbarStyles:t}}function t_(e,r){return{onSubmitHandler:a=>{const i=i_(a);e(Ld({addressType:"company_address",addressToCreate:i})),r.closeDrawerHandler?.()},onCancel:()=>{r.closeDrawerHandler?.()}}}const r_=ze(e_,t_)(Vp);function n_({closeDrawerHandler:e}){const r=Bt(),a=Be(),i=Ko(),{addressType:o}=ot(),t=lr(),n=He.getSignedInUser(),s=Se(f=>jd("company_address",f));if(n==null)throw Error("Can't access address page without signing in...");const d=f=>f.trackPageLoaded(s?.newAddressId!=null?Fo.Event.editAddress:Fo.Event.addAddress);return o!=null&&!o.match(/(company_address)$/g)?V.jsx(es,{}):V.jsxs(V.Fragment,{children:[V.jsx(uh,{analytics:Fe,onLoad:d}),V.jsx(Qy,{windowSize:t,children:V.jsx(r_,{location:i,navigate:a,address:s,closeDrawerHandler:e,showNavbarWithClose:!0,navbarStyles:{backgroundColor:r.colors.grey5},sectionStyles:{backgroundColor:r.colors.grey5}})})]})}const i_=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),a_={drawerLeftMargin:new at(0,0,240)},o_=({isAddressDrawerOpen:e,closeDrawerHandler:r})=>{const a=Bt(),i=lr(),o=a_.drawerLeftMargin.valuePx(i),t=()=>{r?.()};return V.jsx(hr,{anchor:"right",open:e,PaperProps:{style:{width:`calc(100% - ${o})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClick:()=>t(),children:V.jsx(s_,{onClick:n=>n.stopPropagation(),children:V.jsx(n_,{closeDrawerHandler:r})})})},s_=tt(Ht)`
|
|
133
133
|
display: flex;
|
|
134
134
|
min-height: 100%;
|
|
135
135
|
flex-direction: column;
|
|
@@ -141,7 +141,7 @@ Found: ${a.toString().split(`
|
|
|
141
141
|
justify-content: center;
|
|
142
142
|
align-items: center;
|
|
143
143
|
background-color: ${e=>e.theme.colors.grey4};
|
|
144
|
-
`,c_=({companyId:e,isOnboardingCustomerDrawerOpen:r,closeDrawerHandler:a})=>{const i=Be(),o=
|
|
144
|
+
`,c_=({companyId:e,isOnboardingCustomerDrawerOpen:r,closeDrawerHandler:a})=>{const i=Be(),o=Bt(),t=We(),{useFeatureGate:n}=wt(),[s,d]=ce.useState(!1),[f,l]=ce.useState(!1),[h,c]=ce.useState(!1),[b,m]=ce.useState(!1),{isFeatureEnabled:y}=n(vn.isDebitCardFeatureEnabled),g=fr.getLocalizedStrings(),{code:u,realmId:_,state:E}=gs(location.search),v={onOkClick:()=>{d(!1),W()},onCancelClick:()=>{d(!1)}},w=Se(K=>qd(K)),{newOnboardedCustomerId:x}=w,O=w.companyView?.company.companyInfo.tenantId,C=w.newOnboardingCustomerLocalData.selectedProducts??[],D=C.includes("zeni_checking")&&!C.includes("bookkeeping"),Y=Se(K=>Wf(K)),F=Se(K=>Nd(K)),S=Se(K=>K.userState),R=w.companyView?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,L=w.externalConnections?.accounting[0],q=L?.connectionType,z=L?.connectionName,P=L?.connectionId??"",j=w.customerLocalStoreInitState!=="Completed"||w.onboardingCompletedCompanies.fetchState!=="Completed"||F.fetchState==="In-Progress",k=He.getSignedInUser();if(k==null)throw Error("Can't access onboarding customer page without signing in...");const U=ce.useCallback(()=>{m(!0),t(Es(!1,!0))},[]),W=()=>{t(Tt({selectedStep:""})),t(An()),a()},H=K=>{t(Es(K)),t(Tt({selectedStep:""}))},M=K=>{K!=null&&i(K==="management"?"../../management":"../")},N=K=>{t(Ud(K))},B=K=>{const X=l_(K,w);t(Bd(X)),l(!0)},$=()=>{document.cookie="pre_board_questionnaire_id= ;path=/;",window.open("/pre-onboard")};return ce.useEffect(()=>{Y.fetchState==="Completed"&&t(Dd(y,e))},[e,Y.fetchState,S.userByUserId]),ce.useEffect(()=>{O!=null&&R!==!0&&!D&&t(Md(k.userId,O))},[O,R]),ce.useEffect(()=>{e!=null&&tn.initiatedCompanyID!==e&&R!==!0&&tn.init("/cockpit/onboarding/auth",e)},[e]),ce.useEffect(()=>{w.sendInviteFetchState.fetchState==="Completed"&&(t(An()),a())},[w.sendInviteFetchState.fetchState]),ce.useEffect(()=>{w.customerLocalStoreInitState==="Error"&&i("../../onboarding")},[w.customerLocalStoreInitState]),ce.useEffect(()=>{Jy({code:u,realmId:_,state:E,connectionId:P,signedInuserId:k.userId,tenantId:O,companyId:e,onboardingViewFetchState:Y.fetchState,saveConnectionFetchState:w.externalConnections?.saveConnectionState})&&O!=null&&(t(Fd(O,{connection_type:q??"accounting",connection_name:z??"quickbooks_online",authorization_code:u,realm_id:_,connection_id:P,user_id:k.userId},Go(window.location.origin+"/cockpit/onboarding/auth"),e,k.userId)),i(`/onboarding/edit/${e}`))},[q,z,u,_,E,P,k.userId,w.externalConnections?.saveConnectionState,location.pathname,Y.fetchState,O,e]),ce.useEffect(()=>{w.fetchState==="Completed"&&(b===!0?e==null&&x!=null?i(`../../onboarding/edit/${x}`):e!=null&&x==null&&tn.handleClick():(t(An()),a()))},[w.fetchState,e,b]),ce.useEffect(()=>{w.externalConnections?.fetchState==="Completed"&&b===!0&&x!=null&&tn.handleClick()},[w.externalConnections?.fetchState,b,x]),V.jsx(hr,{anchor:"right",open:r,PaperProps:{style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.8,cursor:"pointer"}}},onClose:()=>{f===!0?d(!0):W()},children:V.jsxs(f_,{children:[s===!0?V.jsx($p,{titleComponent:V.jsx(h_,{children:g.common.confirmationPopup.discardTitle}),descriptionComponent:V.jsx(d_,{children:g.cockpit.onboarding.discardDescription}),primaryButtonText:g.common.confirmationPopup.discard,secondaryButtonText:g.common.cancel,action:v}):null,j?V.jsx(u_,{children:V.jsx(gn,{size:"Large",start:!0})}):V.jsxs(V.Fragment,{children:[V.jsx(zp,{localData:w,analytics:Fe,onCloseClick:W,onCompanyDomainBlurred:N,onSaveClick:H,onViewClick:M,onOnboardingCustomerDataUpdated:B,onNavigateToPreOnboarding:$,screenType:e!=null?"edit":"create",onQBOConnectClick:U,qboConnectClicked:b}),h===!0?V.jsx(o_,{isAddressDrawerOpen:h,closeDrawerHandler:()=>{c(!1)}}):null]})]})})},l_=(e,r)=>{const a={},{companySection:i,customerSection:o,groupSection:t,qboConnectionSection:n}=e,{newOnboardingCustomerLocalData:s}=r;return s.companyId==null&&(a.companyEmailDomain=i.companyDomain),s.isEmailGroupCreated!==!0&&(a.groupId=t.groupEmail,a.groupName=t.groupName,a.groupDescription=t.groupDescription),a.email=o.email,a.customerName={firstName:o.customerName.firstName,lastName:o.customerName.lastName},a.name=o.name,a.chargebeeId=o.chargebeeId,a.qboRealmId=o.realmId,a.hubSpotId=o.hubSpotId,a.selectedProducts=o.products.selectedOptions.map(d=>Vd(d)).filter(d=>d!=null),o.entityType.selectedOption!=null?o.entityType.selectedOption?.value==="Subsidiary"?(a.isSubsidiary=!0,o.company.selectedOption!=null&&(a.parentCompanyId=o.company.selectedOption.value)):a.isSubsidiary=!1:a.isSubsidiary=void 0,n.accountingConnectionCreationMode!=null&&(a.accountingConnectionCreationMode=n.accountingConnectionCreationMode),a},f_=tt(Ht)`
|
|
145
145
|
display: flex;
|
|
146
146
|
min-height: 100%;
|
|
147
147
|
flex-direction: column;
|
|
@@ -158,7 +158,7 @@ Found: ${a.toString().split(`
|
|
|
158
158
|
margin-bottom: 30px;
|
|
159
159
|
margin-top: ${Dt.sp4};
|
|
160
160
|
white-space: pre-line;
|
|
161
|
-
`,jf=(()=>{let e="",r;return{init:(o,t="create-qbo-subscription")=>{r=new mt({clientId:mn.quickbooksKey,clientSecret:"",environment:sh,redirectUri:`${window.location.origin}${o}`}),e=r.authorizeUri({state:t,scope:[mt.scopes.Accounting,mt.scopes.OpenId,mt.scopes.Email,mt.scopes.Profile,cd]})},handleClick:()=>{window.open(e,"_self","noopener")}}})(),p_=(e,r,a,i)=>e!==""&&r!==""&&a!==""&&i!=null&&i!=="",m_=({code:e,realmId:r,state:a,signedInuserId:i})=>p_(e,r,a,i)===!0;function g_(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=
|
|
161
|
+
`,jf=(()=>{let e="",r;return{init:(o,t="create-qbo-subscription")=>{r=new mt({clientId:mn.quickbooksKey,clientSecret:"",environment:sh,redirectUri:`${window.location.origin}${o}`}),e=r.authorizeUri({state:t,scope:[mt.scopes.Accounting,mt.scopes.OpenId,mt.scopes.Email,mt.scopes.Profile,cd]})},handleClick:()=>{window.open(e,"_self","noopener")}}})(),p_=(e,r,a,i)=>e!==""&&r!==""&&a!==""&&i!=null&&i!=="",m_=({code:e,realmId:r,state:a,signedInuserId:i})=>p_(e,r,a,i)===!0;function g_(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=Ft(a);Fe.trackCockpitTabClicked(o),r.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(a,i)=>{e(Tt({filterText:i}))}}},onboardingPageActions:{onOnboardingStepClicked:(a,i)=>{e(Tt({selectedStep:i})),r.navigate(`../edit/${a}`)},onCancelClicked:()=>{e(Tt({showGoLivePopUp:!1}))},onGoLiveClicked:a=>{e(Jd(a.companyId,a))},onUpdateCustomerCreationStatus:()=>{e(Yd())},onSendInviteClick:a=>{e(Wd(a))},onColumnSortConfigChanged:(a,i)=>{e(Tt({sortKey:a,sortOrder:i}))},redirectToDashboardOnboarding:a=>{window.open(`/${a}/onboarding`)},onRetryBankAccountConnection:a=>{e(Zd({companyId:a}))},onFilterTextChanged:(a,i)=>{e(Tt({filterText:i}))},onCockpitReloadData:a=>{a==="onboarding"&&(e(Yf()),e(Jf()))},onQBOConnectClick:()=>{jf.init("/cockpit/onboarding/auth","create-qbo-subscription"),jf.handleClick()},onScroll:a=>{}}}}function v_(e,r){return{onboardingPageData:{onboardingView:r.onboardingView,loggedInUser:r.signedInUser,qboConnectionPoolFlag:r.qboConnectionPoolFlag}}}const y_=ze(v_,g_)(Gp);function rn({isOnboardingCustomerDrawerOpen:e}){const r=Be(),a=We(),i=Ut(),{onboardingCustomerCompanyId:o}=ot(),[t,n]=ce.useState(!1),{useDynamicConfig:s}=wt(),{configValue:d}=s(xt.qboConnectionPoolEnablement),f=St(),{code:l,realmId:h,state:c}=gs(location.search),b=Se(u=>Wf(u)),m=He.getSignedInUser();if(m==null)throw Error("Can't access onboarding customer page without signing in...");ce.useEffect(()=>{e!=null&&e===!0?n(!0):n(!1)},[e]);const y=Se(u=>u.companyViewState.zeniUsers.fetchState);ce.useEffect(()=>{b.fetchState==="Completed"?a(It(!1)):(b.fetchState==="Not-Started"||b.fetchState==="Error")&&(a(Yf()),(y==="Not-Started"||y==="Error")&&a(Ct()),b.qboConnectionPool.fetchState==="Not-Started"&&a(Jf()))},[b.fetchState]),ce.useEffect(()=>{b.updateStatus.fetchState==="Completed"&&(a(pn(!0)),a(Ho(!0)),a(Zo(!0)),a($d()),b.uiState.showGoLivePopUp&&a(Tt({showGoLivePopUp:!1})),setTimeout(()=>{a(zd())},5e3))},[b.updateStatus.fetchState]),ce.useEffect(()=>{m_({code:l,realmId:h,state:c,signedInuserId:m.userId})&&c==="create-qbo-subscription"&&(a(Gd({connection_type:"accounting",connection_name:"quickbooks_online",connection_id:"",authorization_code:l,realm_id:h,user_id:m.userId},Go(window.location.origin+"/cockpit/onboarding/auth"),m.userId)),r("/onboarding"))},[l,h,c,m.userId,location.pathname]);const g=()=>{n(!1),a(Hd()),r("../")};return V.jsxs(V.Fragment,{children:[t===!0?V.jsx(c_,{isOnboardingCustomerDrawerOpen:t,closeDrawerHandler:g,companyId:o}):null,V.jsx(y_,{headerData:{allTabOptions:f,selectedTabOption:Et("onboarding")},initialOpenThreadRequest:i??void 0,onboardingView:b,qboConnectionPoolFlag:Array.isArray(d.userEmailAccessForQBOConnectionPool)&&d.userEmailAccessForQBOConnectionPool.includes(m.userEmail),navigate:r,signedInUser:m})]})}function __(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(rn,{})})}),V.jsx(Te,{path:"/new",element:V.jsx(Pe,{element:V.jsx(rn,{isOnboardingCustomerDrawerOpen:!0})})}),V.jsx(Te,{path:"/edit/:onboardingCustomerCompanyId",element:V.jsx(Pe,{element:V.jsx(rn,{isOnboardingCustomerDrawerOpen:!0})})}),V.jsx(Te,{path:"/auth",element:V.jsx(Pe,{element:V.jsx(Ky,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(rn,{})})})]})}function b_(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=Ft(a);Fe.trackCockpitTabClicked(o),r.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(a,i)=>{e(Kt({filterText:i}))},onFiltersChange:(a,i)=>{e(Kt({filters:i}))}}},portfolioPageActions:{onColumnSortConfigChanged:(a,i)=>{e(Kt({sortKey:a,sortOrder:i}))},onScroll:a=>{e(Kt({scrollYOffset:a}))},onCompanyNameClicked:a=>window.open(`/${a.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:a=>window.open(`/${a.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onFiltersChange:(a,i)=>{e(Kt({filters:i}))},onCockpitReloadData:a=>{a==="portfolio"&&e(Ho())}}}}function w_(e,r){return{portfolioPageData:{portfolioView:r.portfolioView}}}const E_=ze(w_,b_)(Hp);function Lf(){const e=Be(),r=We(),a=Ut(),i=St(),o=Se(n=>Kd(n)),t=Se(n=>n.companyViewState.zeniUsers.fetchState);return ce.useEffect(()=>{o.fetchState==="Completed"?r(It(!1)):(o.fetchState==="Not-Started"||o.fetchState==="Error")&&(r(Ho()),(t==="Not-Started"||t==="Error")&&r(Ct()))},[o.fetchState]),V.jsx(E_,{headerData:{allTabOptions:i,selectedTabOption:Et("portfolio")},initialOpenThreadRequest:a??void 0,portfolioView:o,navigate:e})}function S_(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(Lf,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(Lf,{})})})]})}function R_(e,r){const{merchantId:a}=r,i=Wo(e);return{tenantMerchant:a!=null?Qd(e,a):void 0,globalMerchantView:i,analytics:Fe}}function O_(e,r){const{merchantId:a,navigate:i}=r;return{updateCreateGlobalMerchantLocalData:(o,t,n)=>{e(Xf(o,t,n!=null?tp(n):void 0))},fetchRecommendation:()=>{e(Kf("global"))},onSaveClick:()=>{e(ep(a,"vendor_global_review"))},onBackClick:()=>{i("../vendors")}}}const T_=ze(R_,O_)(Zp);function x_(){const e=Be(),r=We(),{merchantId:a}=ot(),i=Se(o=>Wo(o).newGlobalMerchantData?.status.fetchState);return ce.useEffect(()=>{i==="Completed"&&(r(Xd()),e("../vendors"))},[i]),V.jsx(T_,{merchantId:a,navigate:e})}function A_(e){const r=rp(e);return{vendorGlobalReviewView:np(e),globalMerchantAutoCompleteView:r,analytics:Fe}}function I_(e,r){const{navigate:a}=r;return{onApproveGlobalReview:i=>{e(cp(i))},onRejectGlobalReview:i=>{e(up(i))},onCreateGlobalMerchant:(i,o,t)=>{o!=null&&(e(Xf(o,null,t)),e(Kf("global"))),i!=null?a(`./create/${i}`):a("./create")},onFetchGlobalReviewList:(i,o,t)=>{e(Qf(i,o,t))},onUpdateGlobalReviewUIState:i=>{e(sp(i))},onFetchGlobalMerchantAutoCompleteResults:i=>{e(op({searchString:i,globalMerchantType:"vendor"}))},onUpdateSelectedGlobalMerchant:(i,o,t)=>{const n=P_(o);e(ap({merchantId:i,currentSelection:n,customMerchantId:t}))},onClearGlobalMerchantAutoCompleteResults:()=>{e(ip())},onBackClick:()=>{a("../../management")}}}const C_=ze(A_,I_)(Wp);function qo(){const e=Be(),r=We(),a=Bo("/reconciliation/vendors/create/*")!=null,i=Se(t=>Wo(t));ce.useEffect(()=>{a&&i.fetchState==="Not-Started"&&e("../vendors"),r(Qf(void 0,!1))},[]);const o=t=>t.trackPageLoaded(Fo.Event.vendorGlobalReviewListPage);return V.jsxs(V.Fragment,{children:[V.jsx(uh,{analytics:Fe,onLoad:o}),V.jsx(mr,{isOpen:a,drawerLeftMargin:new at(0,0,300,450),onClose:()=>{i.newGlobalMerchantData!=null&&Fe.trackVendorReviewNewVendorCanceled({reviewSource:"global_review",newRequestedVendorName:i.newGlobalMerchantData.globalMerchantName,tenantName:null,recommendedVendorName:i.recommendedGlobalMerchants[0]?.globalMerchantName??null,recommendedVendorReason:i.recommendedGlobalMerchants[0]?.reason??null}),e("../vendors")},children:V.jsx(k_,{onClick:t=>t.stopPropagation(),children:V.jsx(x_,{})})}),V.jsx(C_,{navigate:e})]})}const P_=e=>e.originalVendor===!0?"originalVendor":e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.requested===!0?"requested":null,k_=tt(Ht)`
|
|
162
162
|
display: flex;
|
|
163
163
|
min-height: 100%;
|
|
164
164
|
flex-direction: column;
|
|
@@ -170,11 +170,11 @@ Found: ${a.toString().split(`
|
|
|
170
170
|
justify-content: center;
|
|
171
171
|
align-items: center;
|
|
172
172
|
background-color: ${e=>e.theme.colors.grey4};
|
|
173
|
-
`;function q_(e,r){const{companyId:a,reviewView:i}=r;return{allUsers:i.zeniUsers,companyView:i.companies.find(o=>o.companyId===a)}}function N_(e,r){const{companyId:a}=r;return{onRetryBankAccountConnection:()=>{a!=null&&e(eh({companyId:a}))},onCloseClick:()=>{r.navigate("../")}}}const D_=ze(q_,N_)(Yp);function M_(){const e=Be(),{companyId:r}=ot(),a=Se(i=>cr(i));return V.jsx(V.Fragment,{children:a.fetchState==="In-Progress"?V.jsx(L_,{children:V.jsx(gn,{size:"Large",start:!0})}):V.jsx(D_,{companyId:r,reviewView:a,navigate:e})})}function F_(e,r){const{expenseAutomationEnabledCompanies:a,navigate:i}=r;return{headerActions:{onTabChange:o=>{const t=Pt(o),n=
|
|
173
|
+
`;function q_(e,r){const{companyId:a,reviewView:i}=r;return{allUsers:i.zeniUsers,companyView:i.companies.find(o=>o.companyId===a)}}function N_(e,r){const{companyId:a}=r;return{onRetryBankAccountConnection:()=>{a!=null&&e(eh({companyId:a}))},onCloseClick:()=>{r.navigate("../")}}}const D_=ze(q_,N_)(Yp);function M_(){const e=Be(),{companyId:r}=ot(),a=Se(i=>cr(i));return V.jsx(V.Fragment,{children:a.fetchState==="In-Progress"?V.jsx(L_,{children:V.jsx(gn,{size:"Large",start:!0})}):V.jsx(D_,{companyId:r,reviewView:a,navigate:e})})}function F_(e,r){const{expenseAutomationEnabledCompanies:a,navigate:i}=r;return{headerActions:{onTabChange:o=>{const t=Pt(o),n=Ft(o);Fe.trackCockpitTabClicked(n),i(`../../${t}`,{replace:!0})},filterActions:{onFilterTextChanged:(o,t)=>{e(In({filterText:t}))}}},reviewPageActions:{onColumnSortConfigChanged:(o,t)=>{e(In({sortKey:o,sortOrder:t}))},onTransactionTagClicked:(o,t,n)=>{const s=a.includes(o.companyId);t==="expense"&&s?window.open(`/${o.primaryEmailDomain}/month_end_close_checks/review`):window.open(`/${o.primaryEmailDomain}/transactions/${n}-${t}`)},onReviewVendorTagClicked:o=>window.open(`/${o.primaryEmailDomain}/vendors/review`),onCompanyNameClicked:o=>window.open(`/${o.primaryEmailDomain}/dashboard`),onRetryBankAccountConnection:o=>{e(eh({companyId:o}))},onUncategorizedAccountsErrorClick:o=>{window.open(`/${o}/accounts/mapping`)},onClickAuditScore:o=>{if(o!=null){const t=`/audit/report/${encodeURIComponent(o)}`;i(t)}},onClickWarningsCount:o=>{if(o!=null){const t=`/audit/warnings/${encodeURIComponent(o)}`;i(t)}},onFilterTextChanged:(o,t)=>{e(In({filterText:t}))},onCockpitReloadData:o=>{o==="audit"&&e(Mt())},onScroll:o=>{}}}}function B_(e,r){return{reviewPageData:{reviewView:r.reviewView,zeniUserFetchState:r.zeniUserFetchState,allUsers:r.reviewView.zeniUsers,isReviewVendorColumnVisible:r.isReviewVendorColumnVisible},analytics:Fe}}const U_=ze(B_,F_)(Jp);function No(){const e=Be(),r=We(),a=Ut(),i=Bo("/audit/report/*")!=null,o=Bo("/audit/warnings/*")!=null,{useFeatureGate:t}=wt(),{isFeatureEnabled:n}=t(vn.isReviewTabVendorColumnEnabled),{useDynamicConfig:s}=wt(),{configValue:d}=s(xt.expenseAutomationEnablement),f=St(),l=Se(b=>cr(b)),h=Se(b=>dn(b)),c=Se(b=>b.companyViewState.zeniUsers.fetchState);return ce.useEffect(()=>{l.fetchState==="Completed"?r(It(!1)):(l.fetchState==="Not-Started"||l.fetchState==="Error")&&(r(Mt()),(c==="Not-Started"||c==="Error")&&r(Ct()))},[l.fetchState]),ce.useEffect(()=>{l.fetchState==="Completed"&&h.fetchState==="Not-Started"&&r($o())},[l.fetchState]),V.jsxs(V.Fragment,{children:[V.jsx(mr,{isOpen:i||o,drawerLeftMargin:i?new at(0,0,0,0):o?new at(0,0,300,650):new at(0,0,300,650),onClose:()=>{i&&r(Mt()),e("../")},children:V.jsx(V_,{onClick:b=>b.stopPropagation(),children:i?V.jsx(mh,{}):o?V.jsx(M_,{}):null})}),V.jsx(U_,{headerData:{allTabOptions:f,selectedTabOption:Et("audit")},initialOpenThreadRequest:a??void 0,reviewView:l,navigate:e,isReviewVendorColumnVisible:n,zeniUserFetchState:c,expenseAutomationEnabledCompanies:d.expenseAutomationEnabledCompanies!=null&&Array.isArray(d.expenseAutomationEnabledCompanies)?d.expenseAutomationEnabledCompanies:[]})]})}const V_=tt(Ht)`
|
|
174
174
|
display: flex;
|
|
175
175
|
min-height: 100%;
|
|
176
176
|
flex-direction: column;
|
|
177
177
|
`;function $_(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/report/:companyId",element:V.jsx(Pe,{element:V.jsx(No,{})})}),V.jsx(Te,{path:"/warnings/:companyId",element:V.jsx(Pe,{element:V.jsx(No,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(No,{})})})]})}function z_(e,r){const a=th(e,r.tenantId),i=a.estimateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{localData:a,isDisabled:i}}function G_(e,r){const{tenantId:a,companyId:i,location:o,navigate:t}=r;return{onSubscriptionDetailsChanged:n=>{const{addPlan:s,invoiceOption:d}=n,{subscriptionPlan:f,recurringAddOns:l,coupon:h}=s,c={subscriptionPlanId:f.selectedOption??"",subscriptionAddOnIds:l.filter(b=>b.selectedOption!=null).map(b=>b.selectedOption),subscriptionCouponIds:h.selectedOption!=null?[h.selectedOption]:[],invoiceImmediately:d.invoicingOption!=null};s.planStartDate!=null&&(c.startDate=an(s.planStartDate.toString())),e(rh({tenantId:a,subscriptionData:c}))},onEstimateSuccess:()=>{const n=ph(o.state?.pathnameStackToGoBack,o.pathname);t(`../tenants/${a}/companies/${i}/summary`,{state:{pathnameStackToGoBack:n}})},onReviewClick:()=>{e(lp(a))},onBackClick:()=>{t(`../tenants/${a}/companies/${i}`)},onResetClick:()=>{e(Yo(a))}}}const H_=ze(z_,G_)(Kp),Z_=e=>{const{tenantId:r,companyId:a,location:i,navigate:o}=e;return V.jsx(H_,{tenantId:r,companyId:a,location:i,navigate:o})};function W_(e,r){const{companyId:a,tenantId:i}=r,o=hp(e,a,i),t=o.fetchState!=="In-Progress";return{subscriptionDetailView:o,canUpdate:t}}function Y_(e,r){const{tenantId:a,location:i,navigate:o}=r;return{onUpdateOrAddPlanClick:t=>{e(Yo(a,t)),e(dp()),e(pp()),e(mp()),t!=null?o(`${i.pathname}/update`):o(`${i.pathname}/add`)},onCloseClick:()=>{o("../")}}}const J_=ze(W_,Y_)(Xp),K_=e=>{const{tenantId:r,companyId:a,location:i,navigate:o}=e,t=We(),[n,s]=ce.useState(!1),d=Se(f=>f.subscriptionViewState.subscriptionDetailsByCompanyId[a]?.fetchStatus);return ce.useEffect(()=>{!n&&(d==null||d?.fetchState==="Not-Started")&&(s(!0),t(fp(a)))},[n,d,a,t]),ce.useEffect(()=>{n&&d!=null&&d?.fetchState==="Error"&&o("../subscription")},[n,d]),V.jsx(J_,{tenantId:r,companyId:a,location:i,navigate:o})};function X_(e,r){return{subscriptionEstimateData:gp(e,r.tenantId)}}function Q_(e,r){const{tenantId:a,companyId:i,location:o,navigate:t}=r,n=()=>{const s=Tm(o.state?.pathnameStackToGoBack),d=s.poppedPathname??xm(1);t(d,{state:{pathnameStackToGoBack:s.newStack}})};return{onBackClick:()=>{n()},onCancelClick:()=>{n()},onConfirmClick:()=>{e(vp(a))},onConfirmSuccess:()=>{t(`../tenants/${a}/companies/${i}`)}}}const eb=ze(X_,Q_)(Qp),tb=e=>{const{tenantId:r,companyId:a,location:i,navigate:o}=e;return V.jsx(eb,{companyId:a,tenantId:r,location:i,navigate:o})};function rb(e,r){const a=th(e,r.tenantId),i=a.estimateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{localData:a,isDisabled:i}}function nb(e,r){const{tenantId:a,companyId:i,location:o,navigate:t}=r;return{onSubscriptionDetailsChanged:n=>{const{updatePlan:s,applyChanges:d}=n,{subscriptionPlan:f,recurringAddOns:l,coupon:h}=s,c={subscriptionPlanId:f.selectedOption??"",subscriptionAddOnIds:l.filter(b=>b.selectedOption!=null).map(b=>b.selectedOption),subscriptionCouponIds:h.selectedOption!=null?[h.selectedOption]:[],invoiceImmediately:!0,applyEndOfTerm:d.changeType==="applyEndOfTerm",shouldProrate:d.shouldProrate};e(rh({tenantId:a,subscriptionData:c}))},onEstimateSuccess:()=>{const n=ph(o.state?.pathnameStackToGoBack,o.pathname);t(`../tenants/${a}/companies/${i}/summary`,{state:{pathnameStackToGoBack:n}})},onReviewClick:()=>{e(yp(a))},onBackClick:()=>{t(`../tenants/${a}/companies/${i}`)},onResetClick:n=>{e(Yo(a,n.subscription.subscription.subscriptionId))}}}const ib=ze(rb,nb)(em),ab=e=>{const{tenantId:r,companyId:a,location:i,navigate:o}=e;return V.jsx(ib,{tenantId:r,companyId:a,location:i,navigate:o})},ld=["add","update","summary"],ob=e=>bp(e,ld),sb=e=>_p(e,ld),ub=()=>{const[e,r]=ce.useState(!0),{tenantId:a,companyId:i,updatePageType:o}=ot(),t=Be(),n=Se(d=>a!=null?d.subscriptionViewState.subscriptionUpdateViewDataByTenantId[a]:null);if(He.getSignedInUser()==null)throw Error("Can't access subscription details drawer without signing in...");return ce.useEffect(()=>{(n==null&&o!=null||sb(o??"")==null)&&t(`../tenants/${a}/companies/${i}`)},[n]),V.jsx(mr,{isOpen:e,onClose:()=>{r(!1),t("../subscription")},children:V.jsx(lb,{children:V.jsx(cb,{tenantId:a,companyId:i,updatePageType:o!=null?ob(o):void 0})})})},cb=({tenantId:e,companyId:r,updatePageType:a})=>{const i=Be(),o=Ko(),t={tenantId:e,companyId:r,navigate:i,location:o};if(a==null)return V.jsx(K_,{...t});switch(a){case"update":return V.jsx(ab,{...t});case"add":return V.jsx(Z_,{...t});case"summary":return V.jsx(tb,{...t});default:return console.error("Subscription Update Page - Invalid Url"),V.jsx(ir,{to:"/",replace:!0})}},lb=tt(Ht)`
|
|
178
178
|
display: flex;
|
|
179
179
|
min-height: 100%;
|
|
180
|
-
`;function fb(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=
|
|
180
|
+
`;function fb(e,r){return{headerActions:{onTabChange:a=>{const i=Pt(a),o=Ft(a);Fe.trackCockpitTabClicked(o),r.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(a,i)=>{e(zt({filterText:i}))},onFiltersChange:(a,i)=>{e(zt({filters:i}))}}},subscriptionPageActions:{onColumnSortConfigChanged:(a,i)=>{e(zt({sortKey:a,sortOrder:i}))},onCollapseToggled:(a,i)=>{e(zt({isRowCollapseToggled:{companyId:a,isCollapsed:i}}))},onScroll:a=>{e(zt({scrollYOffset:a}))},changeHandlers:(a,i)=>{const o=pb(i);Object.keys(o).length>0&&e(zo(a,o))},onCompanyNameClicked:a=>window.open(`/${a.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:a=>window.open(`/${a.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onPlanOrAddOnClicked:(a,i)=>{e(Ep({tenantId:i})),r.navigate(`../tenants/${i}/companies/${a}`)},onFiltersChange:(a,i)=>{e(zt({filters:i}))},onCockpitReloadData:a=>{a==="subscription"&&e(Zo())}}}}function hb(e,r){return{subscriptionPageData:{loggedInUser:r.signedInUser,subscriptionView:r.subscriptionView}}}const db=ze(hb,fb)(tm);function Do({isDrawerOpen:e}){const r=Be(),a=We(),i=Ut(),o=St(),t=Se(d=>wp(d)),n=Se(d=>d.companyViewState.zeniUsers.fetchState);ce.useEffect(()=>{t.fetchState==="Completed"?a(It(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&(a(Zo()),(n==="Not-Started"||n==="Error")&&a(Ct()))},[t.fetchState]);const s=He.getSignedInUser();return V.jsxs(V.Fragment,{children:[e===!0?V.jsx(ub,{}):null,V.jsx(db,{headerData:{allTabOptions:o,selectedTabOption:Et("subscription")},initialOpenThreadRequest:i??void 0,signedInUser:s,subscriptionView:t,navigate:r})]})}const pb=e=>{const{users:r}=e;return r?{users:r}:{}};function mb(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/tenants/:tenantId/companies/:companyId",element:V.jsx(Pe,{element:V.jsx(Do,{isDrawerOpen:!0})})}),V.jsx(Te,{path:"/tenants/:tenantId/companies/:companyId/:updatePageType",element:V.jsx(Pe,{element:V.jsx(Do,{isDrawerOpen:!0})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(Do,{})})})]})}function gb(e,r){const{navigate:a}=r;return{headerActions:{onTabChange:i=>{const o=Pt(i);a(`../../${o}`,{replace:!0})},filterActions:{onFilterTextChanged:(i,o)=>{e(Ss({filterText:o}))},onFiltersChange:(i,o)=>{e(Ss({filters:o}))}}},taskManagerPageActions:{onRowClick:(i,o)=>{window.open(`/${i}/tasks/${o}`)},onCockpitReloadData:i=>{i==="taskManager"&&e(Mo(0,"dueDate","descending",!1))},onFetchTaskManagerView:(i,o,t,n,s,d)=>{e(Mo(i,o,t,n,s,d))}}}}function vb(e,r){return{isBirdsEyeViewEnabled:r.isBirdsEyeViewEnabled,taskManagerPageData:{companyTaskManagerView:r.companyTaskManagerView}}}const yb=ze(vb,gb)(rm);function qf(){const e=Be(),r=We(),a=Ut(),i=St(),{useFeatureGate:o}=wt(),{isFeatureEnabled:t}=o(vn.isBirdsEyeViewEnabled),n=Se(h=>Sp(h)),s=Se(h=>Rp(h)),d=Se(h=>h.companyViewState.zeniUsers.fetchState);if(ce.useEffect(()=>{n.fetchState==="Completed"?r(It(!1)):n.fetchState==="Not-Started"&&(r(Mo(0,"dueDate","descending",!1)),r(Op()),(d==="Not-Started"||d==="Error")&&r(Ct()))},[n.fetchState]),ce.useEffect(()=>{t&&(n.metricsFetchState==="Not-Started"||n.metricsFetchState==="Error")&&r(Tp())},[t,n.metricsFetchState]),He.getSignedInUser()==null)throw Error("Can't access task manager page without signing in...");const l=ce.useMemo(()=>({allTabOptions:i,selectedTabOption:Et("taskManager")}),[i]);return V.jsx(yb,{headerData:l,companyTaskManagerView:n,isBirdsEyeViewEnabled:t,initialOpenThreadRequest:a,navigate:e,reviewCount:s})}function _b(){return V.jsxs(gt,{children:[V.jsx(Te,{path:"/",element:V.jsx(Pe,{element:V.jsx(qf,{})})}),V.jsx(Te,{path:"/*",element:V.jsx(Pe,{element:V.jsx(qf,{})})})]})}const bb=lh(()=>nh(()=>import("./CreditAgentRoutes-CWtniLRn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])));let Nf=!1;const wb=lh(()=>nh(()=>Promise.resolve().then(()=>Qm),void 0));function Eb(){const e=He.getSignedInUser(),r=Bt().mode;return ce.useEffect(()=>{He.isSignedIn()&&!Nf&&e!=null&&(nm(e,r),Nf=!0)},[e]),V.jsxs(gt,{children:[V.jsx(Te,{path:"/ai-accountant/*",element:V.jsx(Am,{})}),V.jsx(Te,{path:"/management/*",element:V.jsx(og,{})}),V.jsx(Te,{path:"/subscription/*",element:V.jsx(mb,{})}),V.jsx(Te,{path:"/onboarding/*",element:V.jsx(__,{})}),V.jsx(Te,{path:"/portfolio/*",element:V.jsx(S_,{})}),V.jsx(Te,{path:"/audit/*",element:V.jsx($_,{})}),V.jsx(Te,{path:"/reconciliation/*",element:V.jsx(j_,{})}),V.jsx(Te,{path:"/health-monitor/*",element:V.jsx(jm,{})}),V.jsx(Te,{path:"/task-manager/*",element:V.jsx(_b,{})}),V.jsx(Te,{path:"/credit-agent/*",element:V.jsx(bb,{})}),V.jsx(Te,{path:"/*",element:V.jsx(wb,{})})]})}const Lb=Object.freeze(Object.defineProperty({__proto__:null,default:Eb},Symbol.toStringTag,{value:"Module"}));export{Pe as P,Lb as S,Sm as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-bdH_HyD4.js";import{a as S,R as f,n as m}from"./sentry-Dwm-tWfG.js";import{n as I,i as w,g,u as h,N as y,h as b}from"./core-Dwew_eJI.js";import{z as l,G as C,a as v,q as E,L as T,e as p}from"./index-BssKJygd.js";import{S8 as U,S9 as L,Sa as x,Sb as z,bm as u}from"./zeni-epic-state-BAX-zerj.js";import{f as D}from"./analyticsHelper-BGL92ghO.js";import{u as A}from"./mui-Dpk20_cL.js";import"./recharts-Cy2son-o.js";import"./analytics-D6nPZhvU.js";import"./lottie-ODFW7XpP.js";import"./lexical-CKIF0fv8.js";import"./utils-ByTJL3Oq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="45806c19-c8a3-442c-876a-de7431d25810",e._sentryDebugIdIdentifier="sentry-dbid-45806c19-c8a3-442c-876a-de7431d25810")}catch{}})();function N(e){const o=e.tenantState.fetchState,i=e.tenantState.sendEmailMagicLinkFetchState;return{googleClientId:p.googleClientId,microsoftClientId:p.microsoftClientId,signInError:e.tenantState.error?.error,fetchState:o,sendMagicLinkStatus:i,showEmailLogin:!1}}function k(e,o){const{location:i,navigate:r}=o;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,t)=>{m({message:`OAuth error from provider ${t} with error ${n}`,level:"error",tags:{authProvider:t,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,t)=>{const s=t==="google"?window.location.origin:window.location.origin+window.location.pathname;e(z({authCode:n,oauthProvider:t,appType:"web",redirectUri:u(s),sourceUri:u(i.state!=null?i.state.origin:"")}))},getSignedInUser:()=>l.getSignedInUser(),onSignedInCallback:()=>{const n=i.state?.origin;n&&n!=="/"?r(n,{replace:!0}):window.open(window.location.origin,"_self")},clearSignInError:()=>{e(x())}}}const P=b(N,k)(T),_=f.memo(P);function W(){const e=I(),o=w(),i=l.getSignedInUser(),r=g(a=>a.tenantState.fetchState),n=g(a=>a.tenantState.signInState),t=g(a=>a.tenantState.loggedInUser),s=A().mode,c=h();if(S.useEffect(()=>{n==="In-Progress"&&r==="Completed"&&t?.zeniSessionId!=null&&(l.saveSignedInUserWithSession(t,t.zeniSessionId),U(t.userId,t.zeniSessionId),e(L("Completed")),C.updateAppLocaleID("en"),D(t,s),setTimeout(()=>{v.trackLogin(E.Event.loginSuccess,t.authProvider??"google")},2e3))},[]),n==="In-Progress"&&r==="Completed"&&t?.zeniSessionId!=null||i!=null){const a=c.state?.origin??"/";return d.jsx(y,{to:a,state:{...c.state,origin:""}})}else return d.jsx(_,{navigate:o,location:c})}export{W as default};
|